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:
@@ -84,6 +84,11 @@ class RestHandler implements IPPHandler
|
||||
if ($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') {
|
||||
$httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId());
|
||||
}
|
||||
// Add any additional Headers that they may have provided
|
||||
$headers = $this->apiContext->getRequestHeaders();
|
||||
foreach ($headers as $key => $value) {
|
||||
$httpConfig->addHeader($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user