- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
[ABUSE] By: pandawagon / Board: troubleshooting (28524)
Link to post:
(Request not authorized error)
pandawagon
https://www.sellercommunity.com/t5/Troubleshooting/Request-not-authorized-error/m-p/243927#M28524
Everything works fine for the sandbox, but I am getting a "Request not authorized error" when I switch over to my production credentials. I set the application id and location id in my js code (please note that my real credentials are obscured by "xxx" below): const paymentForm = new SqPaymentForm({ // Initialize the payment form elements applicationId: "xxx", I used the production access token in my php code: $client = new SquareClient([ 'accessToken' => 'xxx', 'environment' => Environment::PRODUCTION ]); $body2->setLocationId('xxx'); How come the code works for the sandbox environment but doesn't work when I change the environment to production and update my credentials?
This message has 0 replies
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Everything works fine for the sandbox, but I am getting a "Request not authorized error" when I switch over to my production credentials.
I set the application id and location id in my js code (please note that my real credentials are obscured by "xxx" below):
const paymentForm = new SqPaymentForm({
// Initialize the payment form elements
applicationId: "xxx",
I used the production access token in my php code:
$client = new SquareClient([
'accessToken' => 'xxx',
'environment' => Environment::PRODUCTION
]);
$body2->setLocationId('xxx');
How come the code works for the sandbox environment but doesn't work when I change the environment to production and update my credentials?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Have you tried updating your JS link to switch to production:
Changing this:
<script type="text/javascript" src="https://js.squareupsandbox.com/v2/paymentform"> </script>
to this:
<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"> </script>
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.