mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Handle card smart button for free trial (1$ auth + void)
Disabling this funding source also disables DCC
This commit is contained in:
parent
a5191b04ff
commit
4a4f131325
13 changed files with 74 additions and 5 deletions
|
@ -55,6 +55,7 @@ trait ProcessPaymentTrait {
|
|||
}
|
||||
|
||||
$payment_method = filter_input( INPUT_POST, 'payment_method', FILTER_SANITIZE_STRING );
|
||||
$funding_source = filter_input( INPUT_POST, 'ppcp-funding-source', FILTER_SANITIZE_STRING );
|
||||
|
||||
/**
|
||||
* If customer has chosen a saved credit card payment.
|
||||
|
@ -135,7 +136,7 @@ trait ProcessPaymentTrait {
|
|||
}
|
||||
}
|
||||
|
||||
if ( PayPalGateway::ID === $payment_method && $this->is_free_trial_order( $wc_order ) ) {
|
||||
if ( PayPalGateway::ID === $payment_method && 'card' !== $funding_source && $this->is_free_trial_order( $wc_order ) ) {
|
||||
$user_id = (int) $wc_order->get_customer_id();
|
||||
$tokens = $this->payment_token_repository->all_for_user_id( $user_id );
|
||||
if ( ! array_filter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue