forked from LiveCarta/PayPal-PHP-SDK
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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user