diff --git a/lib/PayPal/Auth/OAuthTokenCredential.php b/lib/PayPal/Auth/OAuthTokenCredential.php index d142aa0..91e4a02 100644 --- a/lib/PayPal/Auth/OAuthTokenCredential.php +++ b/lib/PayPal/Auth/OAuthTokenCredential.php @@ -47,6 +47,11 @@ class OAuthTokenCredential extends PayPalResourceModel */ private $clientSecret; + /** + * Target subject + */ + private $targetSubject; + /** * Generated Access Token * @@ -81,11 +86,12 @@ class OAuthTokenCredential extends PayPalResourceModel * @param string $clientId client id obtained from the developer portal * @param string $clientSecret client secret obtained from the developer portal */ - public function __construct($clientId, $clientSecret) + public function __construct($clientId, $clientSecret, $targetSubject = null) { $this->clientId = $clientId; $this->clientSecret = $clientSecret; $this->cipher = new Cipher($this->clientSecret); + $this->targetSubject = $targetSubject; } /** @@ -267,6 +273,9 @@ class OAuthTokenCredential extends PayPalResourceModel $params['grant_type'] = 'refresh_token'; $params['refresh_token'] = $refreshToken; } + if ($this->targetSubject != null) { + $params['target_subject'] = $this->targetSubject; + } $payload = http_build_query($params); $response = $this->getToken($config, $this->clientId, $this->clientSecret, $payload);