Merge branch 'master' of github.com:inpsyde/woocommerce-paypal-commerce-gateway

This commit is contained in:
David Remer 2020-08-18 12:36:07 +03:00
commit a72922c2a8
2 changed files with 227 additions and 1 deletions

View file

@ -72,7 +72,9 @@ class CheckoutPayPalAddressPreset
];
$payerMap = [
'billing_email' => 'emailAddress',
'billing_phone' => 'phone',
];
$payerPhoneMap = [
'billing_phone' => 'nationalNumber',
];
if(array_key_exists($fieldId, $addressMap) && $shipping) {
@ -87,6 +89,10 @@ class CheckoutPayPalAddressPreset
return $payer->{$payerMap[$fieldId]}() ?: null;
}
if(array_key_exists($fieldId, $payerPhoneMap) && $payer && $payer->phone() && $payer->phone()->phone()) {
return $payer->phone()->phone()->{$payerPhoneMap[$fieldId]}() ?: null;
}
return null;
}