Hello,
I have a custom developed ecommerce platform and have successfully integrated Square based on the following tutorial:
It’s being used in combination with the Square PHP SDK.
It works perfectly in Sandbox mode, but when I move over to production, I get the following error:
[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"The `Authorization` http header of your request was incorrect or expired. The header value is expected to be of the format \"Bearer TOKEN\" (without quotation marks), where TOKEN is a valid access token (e.g. \"Bearer ABC123def456GHI789jkl0\"). For more information, see https:\/\/developer.squareup.com\/docs\/build-basics\/using-rest-api#__set-the-headers__ ."}]
I made sure all the credentials are correct and that square.js is loading the production one and not the sandbox one.
To test it further, I setup my production site to run the sandbox square.js and credentials, and that worked correctly, so this eliminates any development vs. production disparities.
I see that there are similar topics here on the forum, but none of them matched my exact experience. Furthermore, they weren’t using the newer and recently released square.js approach.
I’d appreciate any help.