We are based in the UK but our customers are located in many countries (including the US). As per your documentation, the Mobile Payments SDK is only available in the US. Our POS app supports a number of payment processors which are linked to our web platform (where our US customers would connect their Square accounts).
My question is regarding the Square Application ID that is bundled in the app. For testing purposes, I’ve created a Square account from the UK where I’m located. After the initial Sandbox testing, I’ve rebuilt our app with the production application ID (+ production access token) and have, understandably, encountered an error with authorisation: authorization_unsupported_country.
Can I just confirm if I use a VPN service to create an account ‘based’ in the US, then in the Square developer dashboard I’d create an app to get the application ID and the personal access token, as well as the application signature associated with the US account created, then the customers based in the US will be able to authorise it using their location ids (from their own accounts)?
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
Thanks.
To authorise a mobile app, I need an access token and location id in the Mobile Payments SDK.
Can I just use my Personal Access Token that I get from the Square Developer Console (in order for US sellers to be able to connect the account to).
Assuming the answer to the above is ‘no’, how can we generate access tokens that will be valid for the seller to connect an account?
You’ll have to use OAuth to generate access tokens that connect Square sellers to your application. Once they OAuth you’ll use that access toke for all the API calls.
The UI says that Payment Failed: Square encountered an unexpected error. Please try again or contact support if the problem continues.
It also shows a button saying: Cancel payment
Once I’ve tapped on the button, I can see the error message in the console:
Payment error: {"debugMessage":"Not authorized to take payments with location_id=XZ827P2AGA6VV","debugCode":"payment_invalid_parameters","details":[],"errorMessage":"Something went wrong. Please contact the developer of this application and provide them with this error code: payment_invalid_parameters","errorCode":2}
I’ve tried connecting with a few “Demo” locations but the error persists for all of them
I believe the amount your charging is causing the error. The amount of money charged should be in the smallest denomination of the currency. So if your charging $5.10 it would be 510.
I’ve since realised it and multiplied the amount by 100 but that does not seem to be the issue.
Even with hardcoding 100 as the amount, I get the same response:
paymentParameters {“amountMoney”: {“amount”: 100, “currencyCode”: “USD”}, “appFeeMoney”: {“amount”: 0, “currencyCode”: “USD”}, “idempotencyKey”: “JpzhD5BB3CmSyoru”, “note”: “NexKiosk Transaction with Square”}
LOG promptParameters {“additionalMethods”: [“ALL”], “mode”: 0}
LOG error: in catch: [Error: The PaymentParameters provided were invalid. Check the request details and try the payment again.]
LOG Payment error: {“debugMessage”:“Not authorized to take payments with location_id=F3M77EX26EECM”,“debugCode”:“payment_invalid_parameters”,“details”:,“errorMessage”:“Something went wrong. Please contact the developer of this application and provide them with this error code: payment_invalid_parameters”,“errorCode”:2}
Okay, now the issue is that the account isn’t authorized to take payments. It’s not fully setup as in the ID verification isn’t completed which enables it for payment processing.
That’s what I thought but I’m using a sandbox application id, sandbox access token and using the mockUI card so I’d assume I don’t need a full account authorization for taking sandbox payments.
Is that not that case or am I missing something?
Thanks for the help