Skip to content

Commit

Permalink
See #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Baelde committed Feb 5, 2017
1 parent 8740467 commit d8c0ab0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/MollieConnectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,40 @@ public function getAccessToken($code)
return $this->parseAccessToken($response->getBody());
}

/**
* Get the access token with a refresh token.
*
* @param string $code
*
* @return array
*/
public function getRefreshTokenResponse($code)
{
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
'headers' => ['Accept' => 'application/json'],
'form_params' => $this->getRefreshTokenFields($code),
]);
return json_decode($response->getBody(), true);
}
/**
* Get the refresh tokenfields with a refresh token.
*
* @param string $code
*
* @return array
*/
protected function getRefreshTokenFields($code)
{

return [
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'code' => $code,
'grant_type' => 'refresh_token',
'refresh_token' => $code,
];
}

/**
* Get the POST fields for the token request.
*
Expand Down

0 comments on commit d8c0ab0

Please sign in to comment.