Check if payer's email and name are set before sending payer data

This commit is contained in:
Narek Zakarian 2022-03-15 16:14:13 +04:00
parent 3afb73d34c
commit 6d755d44a8

View file

@ -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 ) {