Skip to content
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

Add support for Bacs Direct Debit payment method #3727

Merged
merged 17 commits into from
Jan 24, 2025
Merged

Add support for Bacs Direct Debit payment method #3727

merged 17 commits into from
Jan 24, 2025

Conversation

asumaran
Copy link
Contributor

@asumaran asumaran commented Jan 15, 2025

Closes #3751

Changes proposed in this Pull Request:

Enable checkout using Bacs Direct Debit between merchants and customers in the UK.

Testing instructions

Important

To enable Bacs Direct Debit as a payment method option, you must first activate it using the following feature flag:wp option update _wcstripe_feature_lpm_bacs 'yes'.

Important

(assuming you are receiving webhook events correctly) – After completing the checkout and receiving the initial webhook events from Stripe, to speed up order processing, you need to manually run the scheduled action. To do this, go to Tools > Scheduled Actions, search for the wc_stripe_deferred_webhook hook, and click "Run". After this, the order status should change to “Processing.”

Checkout using Bacs with a simple product

  • Switch to this branch: as-bacs.
  • Add a simple product to the cart.
  • Go to the Checkout page.
  • Enter a UK billing address.
  • Select “Bacs Direct Debit” from the list of payment methods.
  • Use the sort code “10-88-00” and account number “00012345”.
  • Check “I understand that Stripe will be collecting…”.
  • Click “Place Order”.
  • You should be redirected to the "Order received" page.
  • Verify the order status changes to "Processing" after some time.

Checkout using Bacs with a virtual product.

  • Follow the same steps as in the previous block, but this time add a virtual product to the cart instead of a simple product.

Verify that Bacs is not displayed as an option if the feature flag is set to no.

  • Run wp option update _wcstripe_feature_lpm_bacs 'no'
  • Add a simple product and go to the checkout page. Bacs should no longer be available as a payment option.
  • Go to the Stripe settings page. Bacs should no longer be available as a payment option.

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

@asumaran asumaran self-assigned this Jan 16, 2025
@asumaran asumaran force-pushed the as-bacs branch 3 times, most recently from 72040df to 200c3f5 Compare January 22, 2025 01:39
@asumaran asumaran marked this pull request as ready for review January 22, 2025 23:48
@asumaran asumaran requested review from a team and rafaelzaleski and removed request for a team January 22, 2025 23:49
@asumaran asumaran changed the title Enable BACS Payment Method Add support for Bacs Direct Debit payment method Jan 23, 2025
@asumaran
Copy link
Contributor Author

@rafaelzaleski Please hold off on reviewing this PR for now. I’m currently investigating an issue I just discovered.

@asumaran
Copy link
Contributor Author

False alarm. I thought the payment method was supposed to disappear when entering a billing address from an unsupported country. I could have sworn it worked that way while working on the spike. However, the payment method only disappears after entering the address and refreshing the page. I tested with another similar payment method (Cash App), and the behavior is the same, so it’s not a bug. Please review @rafaelzaleski

Copy link
Contributor

@rafaelzaleski rafaelzaleski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and tests well! I only left a minor request for changes related to i18n.

client/payment-methods-map.js Show resolved Hide resolved
@rafaelzaleski
Copy link
Contributor

@asumaran, there are also failing unit tests related to the changes in this branch.

@asumaran
Copy link
Contributor Author

@rafaelzaleski I'll take a look at those.

@asumaran asumaran merged commit 6b1fd26 into develop Jan 24, 2025
33 of 37 checks passed
@asumaran asumaran deleted the as-bacs branch January 24, 2025 19:39
@asumaran asumaran mentioned this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bacs: Process Payment with Non-saved Bank Details
2 participants