forked from LiveCarta/PayPal-PHP-SDK
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:
@@ -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'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ acct1.ClientSecret = EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRb
|
||||
[Http]
|
||||
http.ConnectionTimeOut = 30
|
||||
http.Retry = 1
|
||||
|
||||
; Adding HTTP Headers to each request sent to PayPal APIs
|
||||
;http.headers.PayPal-Partner-Attribution-Id = 123123123
|
||||
|
||||
;http.Proxy=http://[username:password]@hostname[:port]
|
||||
|
||||
;Service Configuration
|
||||
|
||||
Reference in New Issue
Block a user