0
votes

Can someone help me to understand how make Payment Form works for merchants? I am working on ECommerce site where merchants can sell their products. To use Square as payment provider I used OAuth to retrieve access token (which works fine). To take payment I use Payment Form (to get card nonce). On Payment Form init I need to send ApplicationID & LocationId. I'am able to get last one but not the first one param.

If I try to use my own ApplicationID I get the error on Transactions/Charge

{
"errors":[{
  "category":"INVALID_REQUEST_ERROR",
  "code":"NOT_FOUND",
  "detail":"Card nonce not found in this `sandbox` application environment. Please ensure an application ID belonging to the same environment is used for the SqPaymentForm."
 }]
}
2

2 Answers

0
votes

This error happens when you use a combination of sandbox application Ids and production application Ids. I'm guessing that you are using your correct application id, and attempting to charge with your sandbox access token.

If you want to take a sandbox payment with the payment form, use your sandbox application id, it should look like sandbox-sq0idp-XXXXXXXXXXXXXXXXXXX

0
votes

Each merchant must use their own credentials to load locations. You must send the merchant locationId selected and their access_token to do the charge in its account. Carlos