File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 66 getPaymentMethodsConstants ,
77 PAYMENT_METHOD_AFTERPAY ,
88 PAYMENT_METHOD_AFTERPAY_CLEARPAY ,
9+ PAYMENT_METHOD_BACS ,
910 PAYMENT_METHOD_CLEARPAY ,
1011 PAYMENT_METHOD_GIROPAY ,
1112 PAYMENT_METHOD_LINK ,
@@ -102,6 +103,17 @@ Object.entries( paymentMethodsConfig )
102103 ! isRestrictedInAnyCountry ||
103104 upeConfig . countries . includes ( billingCountry ) ;
104105
106+ // Disable Bacs for subscriptions with free trial.
107+ const cartContainsSubscriptions = cartData . cart . cartItems . every (
108+ ( item ) => item . type === 'subscription'
109+ ) ;
110+ if (
111+ upeName === PAYMENT_METHOD_BACS &&
112+ cartContainsSubscriptions &&
113+ cartData . cartTotals . total_price === '0'
114+ ) {
115+ return false ;
116+ }
105117 return isAvailableInTheCountry && ! ! api . getStripe ( ) ;
106118 } ,
107119 // see .wc-block-checkout__payment-method styles in blocks/style.scss
You can’t perform that action at this time.
0 commit comments