sallminrexha
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
May-21-2019
01:25 AM
Hi all,
I have an issue where after sending post request to PayPal connect I get the error of unsupported_grant_type.
My code:
$client = new \GuzzleHttp\Client();
$clientId = "MY_CLIENT_ID";
$clientSecret = "MY_CLIENT_SECRET";
$authorizationString = base64_encode($clientId . ':' . $clientSecret);
$res = $client->request('POST', 'https://api.sandbox.paypal.com/v1/oauth2/token', ['headers' => [
'Authorization' => 'Basic ' . $authorizationString,
],
'form_params' => [
'grant_type ' => 'authorization_code',
'code ' => $data['code']
]
]);
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
sallminrexha
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May-21-2019
05:33 AM
I managed to fix this one only by marking grant_type with double braces "grant_type" nothing else
2 REPLIES 2
anemr1r1
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May-21-2019
01:27 AM
sallminrexha
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May-21-2019
05:33 AM
I managed to fix this one only by marking grant_type with double braces "grant_type" nothing else
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content