Use restCall object for functions that makes requests (#841)

* Use restCall object for functions that makes requests
This commit is contained in:
Anton Rusakov
2017-05-11 17:46:16 +01:00
committed by Jay
parent d56305fe63
commit 8d157c3233
3 changed files with 14 additions and 14 deletions

View File

@@ -219,9 +219,10 @@ class OpenIdTokeninfo extends PayPalResourceModel
* (optional) grant_type is the Token grant type. Defaults to refresh_token
* (optional) scope is an array that either the same or a subset of the scope passed to the authorization request
* @param APIContext $apiContext Optional API Context
* @param PayPalRestCall $restCall
* @return OpenIdTokeninfo
*/
public function createFromRefreshToken($params, $apiContext = null)
public function createFromRefreshToken($params, $apiContext = null, $restCall = null)
{
static $allowedParams = array('grant_type' => 1, 'refresh_token' => 1, 'scope' => 1);
$apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
@@ -244,7 +245,8 @@ class OpenIdTokeninfo extends PayPalResourceModel
'Content-Type' => 'application/x-www-form-urlencoded',
'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret)
),
$apiContext
$apiContext,
$restCall
);
$this->fromJson($json);