x

Card nonce not found in this `production` application environment

I'm trying to add the square payment form to my website and I'm getting the following error when running a production card (not in sandbox).

 

Response body:

object(stdClass)#7 (1) {
  ["errors"]=>
  array(1) {
    [0]=>
    object(stdClass)#6 (3) {
      ["category"]=>
      string(21) "INVALID_REQUEST_ERROR"
      ["code"]=>
      string(9) "NOT_FOUND"
      ["detail"]=>
      string(163) "Card nonce not found in this `production` application environment. Please ensure an application ID belonging to the same environment is used for the SqPaymentForm."
    }
  }
}


Response headers:

array(12) {
  [0]=>
  string(22) "HTTP/1.1 404 Not Found"
  ["Content-Type"]=>
  string(16) "application/json"
  ["Vary"]=>
  string(23) "Origin, 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) "Wed, 29 Mar 2017 00:03:37 GMT"
  ["Keep-Alive"]=>
  string(10) "timeout=60"
  ["Strict-Transport-Security"]=>
  string(17) "max-age=631152000"
  ["content-length"]=>
  string(3) "243"
}

The application ID in both the square payment form and my process card php file are the same. Why am I getting this error? Thanks.

Tags (1)
5,013 Views
Message 1 of 10
Report
9 REPLIES 9
Alumni

Could you share your application id, or a link to your code? 

4,996 Views
Message 2 of 10
Report

I found a place in the code that was still using the sandbox ID. I changed it to the application ID and that fixed the issue. It looks like it working now, as in, I was able to chage $1 to a card.

4,991 Views
Message 3 of 10
Report

where was the old application ID that you found?

 

I am having the same issue.

 

Thanks!

4,768 Views
Message 4 of 10
Report

Card nonce not found in this `sandbox` application environment . in my sandbox application id and transaction not charge how i can fix it?

4,377 Views
Message 5 of 10
Report
Admin

Hi @alok, sorry for the delay. I checked in with our API Specialist team and they confirmed the following.

 

This will happen if you're using mismatched production and sandbox access token and application ids. To fix, you should make sure that:

  1. Your `sqpaymentform.js` is using your sandbox application id (if you want to use sandbox).
  2. Wherever you're creating the `Transactions API` and calling the `Charge` endpoint, you need to make sure you're using your sandbox access token.

Also remember when you want to change to production, you also need to change in both places as well.

 

The doc includes where to set the application id for the `sqpaymentform.js`: https://docs.connect.squareup.com/payments/sqpaymentform/sqpaymentform-setup#step-5-set-your-applica...

 

If you have any other questions let us know!

️ Helen
Seller Community Manager

Did you find help in the Seller Community? Mark a Best Answer to help others.
4,365 Views
Message 6 of 10
Report

I have error like Card nonce not found in production mode. How to fix it?

 

955 Views
Message 7 of 10
Report
Square Community Moderator

Hi @BharathiPriyaK - Thanks for reaching out!

Sorry to hear that you're experiencing some difficulty.


Looks like what you're experiencing may be able to be solved using the troubleshooting steps provided by @Helen above.

If this does not resolve your issue our API engineers may have more troubleshooting steps, just reach out to our support to be put in touch with them. 

Ria
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
926 Views
Message 8 of 10
Report
Square Community Moderator

Hi @BharathiPriyaK - Thanks for reaching out!

Sorry to hear that you're experiencing some difficulty.


Looks like what you're experiencing may be able to be solved using the troubleshooting steps provided by @Helen above.

If this does not resolve your issue our API engineers may have more troubleshooting steps, just reach out to our support to be put in touch with them. 

Ria
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
926 Views
Message 9 of 10
Report
Square Community Moderator

Hi @BharathiPriyaK - Thanks for reaching out!

Sorry to hear that you're experiencing some difficulty.


Looks like what you're experiencing may be able to be solved using the troubleshooting steps provided by @Helen above.

If this does not resolve your issue our API engineers may have more troubleshooting steps, just reach out to our support to be put in touch with them. 

Ria
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
926 Views
Message 10 of 10
Report