Only add the PayPal-Request-Id header if the value is set

This commit is contained in:
brluk and dkatz
2016-12-14 21:10:32 +00:00
parent 97684cd6a4
commit 77c7589753

View File

@@ -82,7 +82,7 @@ class RestHandler implements IPayPalHandler
$httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config), false); $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()); $httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId());
} }
// Add any additional Headers that they may have provided // Add any additional Headers that they may have provided