From 8ba75230be27126d10199ca69fab79c9d1a97c3a Mon Sep 17 00:00:00 2001 From: Kirill Braslavsky Date: Mon, 5 Apr 2021 16:30:33 +0300 Subject: [PATCH] better check if request id is empty --- modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php b/modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php index fc66833c2..fac80d94e 100644 --- a/modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php +++ b/modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php @@ -223,7 +223,8 @@ class OrderEndpoint { 'body' => wp_json_encode( $data ), ); - $paypal_request_id = $paypal_request_id ?: $this->generate_request_id(); + $paypal_request_id = '' === $paypal_request_id ? $this->generate_request_id() : $paypal_request_id; + $args['headers']['PayPal-Request-Id'] = $paypal_request_id; if ( $this->bn_code ) { $args['headers']['PayPal-Partner-Attribution-Id'] = $this->bn_code;