Sandbox payment in CAD currency

I’m trying to test sandbox payments in CAD and getting this error:

[{:code=>"BAD_REQUEST", :detail=>"This application is not allowed to accept currency CAD.", :category=>"INVALID_REQUEST_ERROR"}]

I’m using the sandbox test account for Canada.

The weird thing for me is that my CreateOrder request is passing. While it has the same :currency => "CAD" in its payload. But CreatePayment returns the above error

How can I fix that? Is there some currency/country setting in the application (besides the test account country) that I’m missing?

:wave: What’s the application Id that you are getting the error with?

:wave:t3: it’s sandbox-sq0idb-5P7DNs8QyQLf0Dh4HVmOrg

I took a look at the request and the account and everything look good. The one thing I can’t confirm is the access token. Did you use the access token for your Canada account? You get this token by clicking the three dots next to “Open.” Once you click on view details select your app name and you will see the access token. :slightly_smiling_face:
Screen Shot 2021-06-11 at 8.31.59 AM

i cannot see it. It says

This authorization was created via the API. You can still renew or revoke this authorization programatically.

but I’m pretty sure there should be no problem with it because our accounts authorization, payments and everything works in production and there is no special logic for the new CAD account feature now. So I can’t imagine why access tokens might not work for CAD. And again, like I said before, the CreateOrder request is passing. And they go one after another in our logic, using the same credentials for sure

btw there is a mistake. It’s programMatically

I’ve just confirmed. Both CreateOrder and CreatePayment requests use the same access token. They both use :currency => "CAD". Here is the created order id: SCrjAx2XCzqeaL4MmPE1S0NDJ7OZY. All the currencies in the OrderCreate response are CAD.

They go in the same transaction, so after CreateOrder I do CreatePayment request, using the just the same seller_client object (i.e. seller_client.create_order(payload1), then seller_client.create_payment(payload2)) which contains all the authentication data, and it returns the mentioned error

{:code=>“BAD_REQUEST”, :detail=>“This application is not allowed to accept currency CAD.”, :category=>“INVALID_REQUEST_ERROR”}

then I decided to try to actually replace the access_token with the wrong one just before the CreatePayment request and i got a different error

{:code=>“UNAUTHORIZED”, :detail=>“The Authorization http header of your request was incorrect or expired. The header value is expected to be of the for
mat “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 .”, :category=>“AUTHENTICATION_ERROR”}

so, i’m pretty sure there is no problem with the token