- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hi,
My code is working fine using legacy sandbox details. But I am getting below error when I am using my sandbox details.
I am using PHP.
- category: "AUTHENTICATION_ERROR"
- code: "UNAUTHORIZED"
- detail: "This request could not be authorized."
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
@ArtWork - Hmmm, interesting. Sometimes you'll get this error if you're not fulling activated.
I'm curious - have you completely set up your Square account to accept cards? From your Online Dashboard, check the bell icon in the top right corner to see if you have a message to finish setting up.
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Hi Justin,
Thanks for your response.
Currently, I am using a development account for the square. so I don't have all the data to activate this account.
once development will complete I will replace my sandbox credentials with client production details.
Could you assist me with what should I do for using my current sandbox account?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Ah, gotcha @ArtWork
I ran this by our API team, and they think you may be using the wrong request url. When using the new sandbox, you have to change the url from "squareup.com" to "squareupsandbox.com". Let me know if this helps or if you run into any issues. I'll keep the API Team on standby!
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Hi Justin,
Thanks. According to your suggestion, I have changed the URL for the configuration file as well js file.
Like :
protected $host = 'https://connect.squareupsandbox.com'; and https://js.squareupsandbox.com/v2/paymentform
Now I am able to submit the form but still getting an exception error :
Exception when calling TransactionApi->charge:
object(stdClass)#6 (1) { ["errors"]=> array(1) { [0]=> object(stdClass)#7 (3) { ["category"]=> string(20) "AUTHENTICATION_ERROR" ["code"]=> string(12) "UNAUTHORIZED" ["detail"]=> string(37) "This request could not be authorized." } } }
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Hey! I'm going to reply for Justin here:
So basically unauthorized errors means you're passing an invalid access token. Since you're trying to use sandbox, you need to make sure you’re passing in the sandbox access token.
When you go to https://squareup.com/dashboard/apps/my-apps, click on “Manage app”, make sure the bottom left corner says “Sandbox Settings” (and if not, click the toggle switch to go from “Production Settings” to “Sandbox Settings”), and then copy the “Sandbox access token”. You will need to pass this access token along with the Charge request.
Let me know if this helps!!
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report