private function getAccessToken($authCode, $redirectUri, $tokenUrl)
    {
        return (new Client())->post(
            $tokenUrl,
            [
                'json' => [
                    'grant_type' => 'authorization_code',
                    'code' => $authCode,
                    'client_id' => $this->config()->get('api.oauth2_client_id'),
                    'redirect_uri' => $redirectUri,
                ],
                'auth' => false,
                'verify' => !$this->config()->get('api.skip_ssl'),
            ]
        )->json();
    }
private function getAccessToken($authCode, $redirectUri, $tokenUrl)
    {
        return (new Client())->post(
            $tokenUrl,
            [
                'json' => [
                    'grant_type' => 'authorization_code',
                    'code' => $authCode,
                    'client_id' => $this->config()->get('api.oauth2_client_id'),
                    'redirect_uri' => $redirectUri,
                ],
                'auth' => false,
                'verify' => !$this->config()->get('api.skip_ssl'),
            ]
        )->json();
    }
private function getAccessToken ( $ authCode , $ redirectUri , $ tokenUrl ) { return ( new Client ( ) ) -> post ( $ tokenUrl , [ 'json' => [ 'grant_type' => 'authorization_code' , 'code' => $ authCode , 'client_id' => $ this -> config ( ) -> get ( 'api.oauth2_client_id' ) , 'redirect_uri' => $ redirectUri , ] , 'auth' => false , 'verify' => ! $ this -> config ( ) -> get ( 'api.skip_ssl' ) , ] ) -> json ( ) ; }
Exchange the authorization code for an access token.

@param string $authCode
@param string $redirectUri
@param string $tokenUrl

@return array
Exchange the authorization code for an access token .