From 6d755d44a81fcfaf20c75cedf2416853ac52bb20 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Tue, 15 Mar 2022 16:14:13 +0400 Subject: [PATCH] Check if payer's email and name are set before sending payer data --- modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php b/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php index c01070654..0b2cba3f6 100644 --- a/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php +++ b/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php @@ -226,7 +226,7 @@ class OrderEndpoint { 'application_context' => $this->application_context_repository ->current_context( $shipping_preference )->to_array(), ); - if ( $payer ) { + if ( ! empty( $payer->email_address() ) && ! empty( $payer->name() ) ) { $data['payer'] = $payer->to_array(); } if ( $payment_token ) {