Configurable Headers for All Requests to PayPal

- Allows adding additional headers to every call to PayPal APIs.
- Refactored OAuthTokenCredential to share code for making Rest Calls
- SDK Config to add headers with http.headers.* syntax
- Fixes #193
This commit is contained in:
japatel
2014-12-17 15:36:41 -06:00
parent 515b747223
commit 20038e7525
8 changed files with 170 additions and 52 deletions

View File

@@ -62,6 +62,11 @@ function getApiContext($clientId, $clientSecret)
)
);
// Partner Attribution Id
// Use this header if you are a PayPal partner. Specify a unique BN Code to receive revenue attribution. To learn more or to request a BN Code, contact your Partner Manager or visit the PayPal Partner Portal .
$apiContext->addRequestHeader('PayPal-Partner-Attribution-Id', '123123123');
// #### SDK configuration
@@ -76,7 +81,8 @@ function getApiContext($clientId, $clientSecret)
'log.FileName' => '../PayPal.log',
'log.LogLevel' => 'FINE',
'validation.level' => 'log',
'cache.enabled' => 'true'
'cache.enabled' => 'true',
// 'http.headers.PayPal-Partner-Attribution-Id' => '123123123'
)
);