Merge pull request #1979 from woocommerce/PCP-2084-free-trial-subscription-products-using-pay-pal-vaulting-when-pay-pal-subscriptions-configured-as-subscriptions-mode

Free trial subscription products using PayPal Vaulting when PayPal Subscriptions configured as Subscriptions Mode (2084)
This commit is contained in:
Emili Castells 2024-02-01 11:41:15 +01:00 committed by GitHub
commit 998867595f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -498,7 +498,7 @@ class PayPalGateway extends \WC_Payment_Gateway {
$wc_order->save();
}
if ( 'card' !== $funding_source && $this->is_free_trial_order( $wc_order ) ) {
if ( 'card' !== $funding_source && $this->is_free_trial_order( $wc_order ) && ! $this->subscription_helper->paypal_subscription_id() ) {
$user_id = (int) $wc_order->get_customer_id();
$tokens = $this->payment_token_repository->all_for_user_id( $user_id );
if ( ! array_filter(