mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Ensure is pui payment method before custom checkout validation
This commit is contained in:
parent
58a53af41e
commit
98e356da17
1 changed files with 5 additions and 0 deletions
|
@ -317,6 +317,11 @@ class PayUponInvoice {
|
|||
add_action(
|
||||
'woocommerce_after_checkout_validation',
|
||||
function( array $fields, WP_Error $errors ) {
|
||||
$payment_method = filter_input( INPUT_POST, 'payment_method', FILTER_SANITIZE_STRING );
|
||||
if ( PayUponInvoiceGateway::ID !== $payment_method ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'DE' !== $fields['billing_country'] ) {
|
||||
$errors->add( 'validation', __( 'Billing country not available.', 'woocommerce-paypal-payments' ) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue