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

Split PE - Set the order's payment method ID to the processing payment method #2951

Merged

Conversation

james-allan
Copy link
Contributor

Fixes #2949

Changes proposed in this Pull Request:

This PR makes sure we set the order's payment method ID to the UPE payment method used to process the payment. Prior to our changes in add/deferred-intent this code use to set to stripe all the time (code link). In #2883, I changed it to set the orders payment ID to the retrievable payment method ID (ie SEPA for bancontact, iDEAL, Sofort). That PR was about subscription support so I suspect I was under the impression thats how it should work for orders, however that's not true.

Testing instructions

  1. Enter Stripe credentials capable of processing iDEAL and Bancontact payments
  2. In the Stripe advanced plugin settings, enable UPE.
  3. Enable Bancontact, SEPA, Sofort (optional) and iDEAL payment methods.
  4. Complete a purchase using Bancontact, iDEAL or Sofort.
  5. View the order in WooCommerce > Orders.
    • On add/deferred-intent note the order's payment method is set to SEPA.
    • On this branch it should be set to the payment method you chose on checkout.
Before After
Screenshot 2024-02-27 at 3 24 59 pm Screenshot 2024-02-27 at 3 26 34 pm

I've tested subscription purchases and this still correctly sets the subscription's payment method SEPA and the parent order to Bancontact.

Order Subscription
Screenshot 2024-02-27 at 3 45 32 pm
Order Payment Method is iDEAL
Screenshot 2024-02-27 at 3 41 54 pm
Subscription Payment Method is SEPA debit

  • 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

@james-allan james-allan requested review from a team and a-danae and removed request for a team February 27, 2024 05:49
Copy link
Contributor

@a-danae a-danae left a comment

Choose a reason for hiding this comment

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

Great catch here, @james-allan ! Thanks for this update.

✅ I was able to replicate the error in add/deferred-intent. SEPA was set as the used payment method for the order when other APMs were used, like Bancontact or iDEAL.
✅ In this branch, the APM that was used is correctly displayed for the order.

@james-allan james-allan merged commit 81a6849 into add/deferred-intent Feb 27, 2024
32 checks passed
@james-allan james-allan deleted the issue/fix-bancontact-orders-set-to-sepa branch February 27, 2024 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants