mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Execute WC validation only for buttons in checkout
This commit is contained in:
parent
57373e0b81
commit
80428f1eb1
1 changed files with 5 additions and 1 deletions
|
@ -248,7 +248,11 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
|
||||
$form_fields = $data['form'] ?? null;
|
||||
|
||||
if ( $this->early_validation_enabled && is_array( $form_fields ) ) {
|
||||
if ( $this->early_validation_enabled
|
||||
&& is_array( $form_fields )
|
||||
&& 'checkout' === $data['context']
|
||||
&& in_array( $payment_method, array( PayPalGateway::ID, CardButtonGateway::ID ), true )
|
||||
) {
|
||||
$this->validate_form( $form_fields );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue