forked from LiveCarta/PayPal-PHP-SDK
Only add the PayPal-Request-Id header if the value is set
This commit is contained in:
@@ -82,7 +82,7 @@ class RestHandler implements IPayPalHandler
|
||||
$httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config), false);
|
||||
}
|
||||
|
||||
if ($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') {
|
||||
if (($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') && !is_null($this->apiContext->getRequestId())) {
|
||||
$httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId());
|
||||
}
|
||||
// Add any additional Headers that they may have provided
|
||||
|
||||
Reference in New Issue
Block a user