Stop auto-generating PayPal-Request-Id

- Allow manual setting of PayPal-Request-Id
This commit is contained in:
brluk and dkatz
2016-12-13 20:47:37 +00:00
parent 37569ce82c
commit a2c75921cb
2 changed files with 27 additions and 7 deletions

View File

@@ -85,13 +85,19 @@ class ApiContext
*/
public function getRequestId()
{
if ($this->requestId == null) {
$this->requestId = $this->generateRequestId();
}
return $this->requestId;
}
/**
* Sets the request ID
*
* @param string $requestId the PayPal-Request-Id value to use
*/
public function setRequestId($requestId)
{
$this->requestId = $requestId;
}
/**
* Resets the requestId that can be used to set the PayPal-request-id
* header used for idempotency. In cases where you need to make multiple create calls