Here is what I receive after sending request to obtain token method with code recived from Oauth page.
“Square\Models\Error”:{“category”:“V1_ERROR”,“code”:“Unknown”}}
My Oauth link is below:
https://connect.squareupsandbox.com/oauth2/authorize?client_id=[id]&scope=MERCHANT_PROFILE_READ,PAYMENTS_READ,SETTLEMENTS_READ,BANK_ACCOUNTS_READ,BANK_ACCOUNTS_READ&session=false&redirect_uri=[uri]
Code responsible for obtaining token (PHP):
$body = new ObtainTokenRequest($this->applicationId, 'authorization_code');
$body->setScopes([
'MERCHANT_PROFILE_READ',
'PAYMENTS_READ',
'BANK_ACCOUNTS_READ',
'SETTLEMENTS_READ',
'BANK_ACCOUNTS_READ',
]);
$body->setClientSecret($this->applicationSecret);
$body->setRedirectUri($this->redirectUrl);
$body->setCode($code);
$apiResponse = $client->getOAuthApi()->obtainToken($body);
What can be wrong?
Also, I issued some problems with Log In, and receive the message that Square is blocked in Ukraine, maybe that is the reason of such behavior.
The owner of this website (developer.squareup.com) has banned the country or region your IP address is in (UA) from accessing this website.
Need urgent help!