mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
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:
commit
998867595f
2 changed files with 3 additions and 2 deletions
|
@ -137,7 +137,7 @@ const bootstrap = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFreeTrial = PayPalCommerceGateway.is_free_trial_cart;
|
const isFreeTrial = PayPalCommerceGateway.is_free_trial_cart;
|
||||||
if (isFreeTrial && data.fundingSource !== 'card') {
|
if (isFreeTrial && data.fundingSource !== 'card' && ! PayPalCommerceGateway.subscription_plan_id) {
|
||||||
freeTrialHandler.handle();
|
freeTrialHandler.handle();
|
||||||
return actions.reject();
|
return actions.reject();
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,7 @@ document.addEventListener(
|
||||||
if (!typeof (PayPalCommerceGateway)) {
|
if (!typeof (PayPalCommerceGateway)) {
|
||||||
console.error('PayPal button could not be configured.');
|
console.error('PayPal button could not be configured.');
|
||||||
return;
|
return;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -498,7 +498,7 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
||||||
$wc_order->save();
|
$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();
|
$user_id = (int) $wc_order->get_customer_id();
|
||||||
$tokens = $this->payment_token_repository->all_for_user_id( $user_id );
|
$tokens = $this->payment_token_repository->all_for_user_id( $user_id );
|
||||||
if ( ! array_filter(
|
if ( ! array_filter(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue