client = $client; } public function requestToken(string $refreshToken, string $clientId, string $clientSecret) { try { $response = $this->client->request( 'POST', 'https://api.amazon.com/auth/o2/token', [ 'form_params' => [ 'grant_type' => 'refresh_token', 'refresh_token' => $refreshToken, 'client_id' => $clientId, 'client_secret' => $clientSecret, ], ] ); }catch (BadResponseException $badResponseException){ throw IssueTokenException::fromResponse($badResponseException->getResponse()); } return Token::fromResponse($response); } }