public function getRefreshToken($config, $authorizationCode = null, $params = array())
{
static $allowedParams = array('grant_type' => 'authorization_code', 'code' => 1, 'redirect_uri' => 'urn:ietf:wg:oauth:2.0:oob', 'response_type' => 'token');
$params = is_array($params) ? $params : array();
if ($authorizationCode) {
//Override the authorizationCode if value is explicitly set
$params['code'] = $authorizationCode;
}
$payload = http_build_query(array_merge($allowedParams, array_intersect_key($params, $allowedParams)));
$response = $this->getToken($config, $this->clientId, $this->clientSecret, $payload);
if ($response != null && isset($response["refresh_token"])) {
return $response['refresh_token'];
}
return null;
}