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