@@ -273,13 +273,7 @@ public function setClientSecret($clientSecret)
273273 public  function  getAccessToken ($ code'' )
274274 {
275275 if  (!empty ($ code
276-  $ uri$ this buildUrl ('accessToken ' , [
277-  'grant_type '  => self ::OAUTH2_GRANT_TYPE ,
278-  self ::OAUTH2_RESPONSE_TYPE  => $ code
279-  'redirect_uri '  => $ this getRedirectUrl (),
280-  'client_id '  => $ this getClientId (),
281-  'client_secret '  => $ this getClientSecret (),
282-  ]);
276+  $ uri$ this buildUrl ('accessToken ' , []);
283277 $ guzzlenew  GuzzleClient ([
284278 'base_uri '  => $ this getOAuthApiRoot (),
285279 'headers '  => [
@@ -288,7 +282,13 @@ public function getAccessToken($code = '')
288282 ],
289283 ]);
290284 try  {
291-  $ response$ guzzleget ($ uri
285+  $ response$ guzzlepost ($ uri'form_params '  => [
286+  'grant_type '  => self ::OAUTH2_GRANT_TYPE ,
287+  self ::OAUTH2_RESPONSE_TYPE  => $ code
288+  'redirect_uri '  => $ this getRedirectUrl (),
289+  'client_id '  => $ this getClientId (),
290+  'client_secret '  => $ this getClientSecret (),
291+  ]]);
292292 } catch  (RequestException $ exception
293293 throw  Exception::fromRequestException ($ exception
294294 }
0 commit comments