mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Get payment method value from filter instead of request
This commit is contained in:
parent
17fd6886ff
commit
748fe6dfcf
1 changed files with 4 additions and 3 deletions
|
@ -105,9 +105,8 @@ class CardFieldsModule implements ModuleInterface {
|
||||||
|
|
||||||
add_filter(
|
add_filter(
|
||||||
'ppcp_create_order_request_body_data',
|
'ppcp_create_order_request_body_data',
|
||||||
function( array $data ) use ( $c ): array {
|
function( array $data, string $payment_method ) use ( $c ): array {
|
||||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||||
$payment_method = wc_clean( wp_unslash( $_POST['payment_method'] ?? '' ) );
|
|
||||||
if ( $payment_method !== CreditCardGateway::ID ) {
|
if ( $payment_method !== CreditCardGateway::ID ) {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +133,9 @@ class CardFieldsModule implements ModuleInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
},
|
||||||
|
10,
|
||||||
|
2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue