x

Resource Not Found while trying to process a simple payment using Square Connect API

Hi guys, I'm testing out the Square Connect API in the Sandbox environment and getting the following results below.

 

I'm using my Sandbox Application ID and Sandbox Access Token. What is the reason that I'd be getting a "Resource Not Found" error message. I'm using a location that does have Credit Card processing enabled. I'm just using the basic example code found here --> https://github.com/square/connect-api-examples/tree/master/connect-examples/v2/php_payment

 

Caught exception!
Response body:

object(stdClass)#6 (1) {
  ["errors"]=>
  array(1) {
    [0]=>
    object(stdClass)#7 (4) {
      ["category"]=>
      string(21) "INVALID_REQUEST_ERROR"
      ["code"]=>
      string(9) "NOT_FOUND"
      ["detail"]=>
      string(19) "Resource not found."
      ["field"]=>
      string(10) "card_nonce"
    }
  }
}


Response headers:

array(12) {
  [0]=>
  string(22) "HTTP/1.1 404 Not Found"
  ["Content-Type"]=>
  string(16) "application/json"
  ["Vary"]=>
  string(15) "Accept-Encoding"
  ["X-Content-Type-Options"]=>
  string(7) "nosniff"
  ["X-Download-Options"]=>
  string(6) "noopen"
  ["X-Frame-Options"]=>
  string(10) "SAMEORIGIN"
  ["X-Permitted-Cross-Domain-Policies"]=>
  string(4) "none"
  ["X-Xss-Protection"]=>
  string(13) "1; mode=block"
  ["Date"]=>
  string(29) "Fri, 24 Jun 2016 03:45:38 GMT"
  ["Content-Length"]=>
  string(3) "121"
  ["Keep-Alive"]=>
  string(10) "timeout=60"
  ["Strict-Transport-Security"]=>
  string(17) "max-age=631152000"
}

 

7,405 Views
Message 1 of 26
Report
25 REPLIES 25

Hi! I am also having this same problem. I had one customer complete a purchase earlier today, and we have had many before that. But another this afternoon had a failed order. This is through a WooCommerce-enabled WordPress site. I received the same error code:

[category] => INVALID_REQUEST_ERROR
[code] => NOT_FOUND
[detail] => Resource not found.
[field] => card_nonce

 

Thanks for helping me serve my customers well!

1,332 Views
Message 22 of 26
Report

I've also received this error on one order yesterday, while another order yesterday came through without a hitch (as have all my other orders to date). I see someone noted a Firefox issue, potentially?

 

error code in WooCommerce:

 

Array
(
[0] => stdClass Object
(
[category] => INVALID_REQUEST_ERROR
[code] => MISSING_REQUIRED_PARAMETER
[detail] => Missing required parameter.
[field] => card_nonce
)

)
Order status changed from Pending payment to Failed.

1,111 Views
Message 23 of 26
Report
Square Community Moderator

Hi @TheSpinningLoft

 

That does look a bit strange. We might need to get you in contact with our API Developer team so they can have a look with you. 

 

Reach out to us directly and we'll get you taken care of. 

1,094 Views
Message 24 of 26
Report

Thanks, EJ.

 

It had seemed to be a one-off that disappeared after updating and some site cleanup, but it appeared again. I've sent in the issue + basic specifics (error, versions running) trhough the contact form, so we'll get to the bottom of this.

1,048 Views
Message 25 of 26
Report

When the user press the submit button, your code must call javascript function to retreive the card_nonce. If it function success, you must call 'again' the submit proccess, having the card_nonce.

Try first populating a visible input text (card_nonce) and stop the script;

1,043 Views
Message 26 of 26
Report