Removed Mandate on CorelationId from Future Payment

- Removed backward compatibility on headers.
- Only sends 'Paypal-Application-Correlation-Id' instead of 'PAYPAL-CLIENT-METADATA-ID'
This commit is contained in:
japatel
2014-11-19 12:16:41 -06:00
parent eb6eb47336
commit 919e5af2ba

View File

@@ -26,8 +26,11 @@ class FuturePayment extends Payment
if ($apiContext == null) {
$apiContext = new ApiContext(self::$credential);
}
if (($correlationId == null || trim($correlationId) == "")) {
throw new \InvalidArgumentException("correlationId cannot be null or empty");
$headers = array();
if ($correlationId != null) {
$headers = array(
'PAYPAL-CLIENT-METADATA-ID' => $correlationId
);
}
$payLoad = $this->toJSON();
$call = new PPRestCall($apiContext);
@@ -36,10 +39,7 @@ class FuturePayment extends Payment
"/v1/payments/payment",
"POST",
$payLoad,
array(
'Paypal-Application-Correlation-Id' => $correlationId,
'PAYPAL-CLIENT-METADATA-ID' => $correlationId
)
$headers
);
$this->fromJson($json);