Whenever we are calling the charge API we are getting the error "Card nonce not found in this `sandbox` application environment. Please ensure an application ID belonging to the same environment is used to generate the nonce.".
Can anyone tell me what should I used as card nonce in the sandbox account.
I used the following code:
public function charge()
{
$transcation = Square::charge([
'amount' => 500,
'card_nonce' => '62229[Redacted]0',
'location_id' => 'CBASEO-z9geAh6VET0JNph6vi6xxxx,
'currency' => 'USD'
]);
return response()->json(compact('transcation'));
}
 
		
		
		
		
		
	
			Hello @nimapatel, welcome to the Seller Community!
This can happen if you're using mismatched production and sandbox access token and application ids. To fix it, you should make sure that:
Also remember when you want to change to production, you also need to change in both places as well.
This doc includes where to set the application id for the `sqpaymentform.js`:
Square Community