diff --git a/lib/PayPal/Handler/RestHandler.php b/lib/PayPal/Handler/RestHandler.php index ec5298d..6bc55ae 100644 --- a/lib/PayPal/Handler/RestHandler.php +++ b/lib/PayPal/Handler/RestHandler.php @@ -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