better check if request id is empty

This commit is contained in:
Kirill Braslavsky 2021-04-05 16:30:33 +03:00
parent 8392f955ef
commit 8ba75230be

View file

@ -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;