-
Notifications
You must be signed in to change notification settings - Fork 210
Add support for Bacs to handle Pre-Orders #4024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/** | ||
* Hides the Bacs payment method for subscriptions with free trials. | ||
* | ||
* This function removes the "stripe_bacs_debit" payment gateway from the available payment methods | ||
* if the cart contains a subscription with a free trial and the total cart amount is zero. | ||
* | ||
* @return void | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been included in #3987.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
The code changes look good and test as expected ✅
I left a few nit comments, but they were not blockers.
Test Instructions
- 🟢 Test Pre-Orders that charge Upfront.
- Checkout with
Bacs
without issues.
- Checkout with
- 🟢 Test Pre-Orders that charge Upon release.
Bacs
is not available as a payment option in the checkout form.
includes/payment-methods/class-wc-stripe-upe-payment-method-bacs-debit.php
Outdated
Show resolved
Hide resolved
includes/payment-methods/class-wc-stripe-upe-payment-method-bacs-debit.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left a few nit comments, but they were not blockers.
Part of #3803
Changes proposed in this Pull Request:
Added support for pre-orders by initializing the
maybe_init_pre_orders
method in the constructor.Introduced the
hide_bacs_for_pre_orders_charge_upon_release
method to remove the Bacs payment option for pre-orders that are charged upon release. This prevents customers from selecting Bacs for pre-orders that are not charged upfront, as Bacs does not support delayed charges. The limitation is similar to the one affecting subscriptions with free trials.Testing instructions
Important
First, make sure that the business in your Stripe account is located in the UK (link) and that your default currency is GBP (link). Otherwise you won't be able to see Bacs as a payment option.
Important
Update the store country to the UK and set the currency to GBP in the WooCommerce settings.
Important
Also, make sure the Bacs feature is enabled. You can use the following to do that:
wp option update _wcstripe_feature_lpm_bacs 'yes'
. Also, you can enable Bacs using the dev tools extension.Test Pre-Orders that charge upon release
Test Pre-Orders that charge upon release
Changelog entry
Changelog Entry Comment
Comment
Post merge