mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Validate required fields only
This commit is contained in:
parent
1e6aa37216
commit
5bb46c0637
1 changed files with 13 additions and 2 deletions
|
@ -155,9 +155,20 @@ class PayUponInvoiceHelper {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$address = $order->get_address();
|
$address = $order->get_address();
|
||||||
|
$required_fields = array(
|
||||||
|
'first_name',
|
||||||
|
'last_name',
|
||||||
|
'email',
|
||||||
|
'phone',
|
||||||
|
'address_1',
|
||||||
|
'city',
|
||||||
|
'postcode',
|
||||||
|
'country',
|
||||||
|
);
|
||||||
|
|
||||||
foreach ( $address as $key => $value ) {
|
foreach ( $address as $key => $value ) {
|
||||||
if ( $value === '' ) {
|
if ( in_array( $key, $required_fields, true ) && $value === '' ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue