mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Ensure email exist otherwise do not return payer object
This commit is contained in:
parent
99413d3652
commit
0947031c3f
2 changed files with 44 additions and 12 deletions
|
@ -340,9 +340,12 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
$payer = $this->payer_factory->from_paypal_response( json_decode( wp_json_encode( $data['payer'] ) ) );
|
||||
}
|
||||
|
||||
if(!$payer && isset($data['form'])) {
|
||||
parse_str($data['form'], $output);
|
||||
return $this->payer_factory->from_checkout_form($output);
|
||||
if ( ! $payer && isset( $data['form'] ) ) {
|
||||
parse_str( $data['form'], $form_fields );
|
||||
|
||||
if ( isset( $form_fields['billing_email'] ) && '' !== $form_fields['billing_email'] ) {
|
||||
return $this->payer_factory->from_checkout_form( $form_fields );
|
||||
}
|
||||
}
|
||||
|
||||
return $payer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue