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

refactor: Add Dynamic Payment Methods handling #4

Merged
merged 17 commits into from
Apr 17, 2024

Conversation

julianajlk
Copy link
Member

@julianajlk julianajlk commented Apr 9, 2024

REV-3830.
Accompanying backend PR: openedx-unsupported/ecommerce#4115
Original PR in openedx: openedx-unsupported#850
^ Last 4 commits in this PR are new after review of the original

Main changes:

  • Adding new error handling for Dynamic Payment Methods, where the Payment Intent status can get into unexpected state.
  • New error message in case the learner's location is in a buy now pay later (BNPL) supported country but their billing address is in a country that BNPL does not support.
  • Make postal code required for BNPL countries.
  • Add shipping address to the Payment Intent since it's required for Afterpay.
  • Add the PaymentMethodMessagingElement
  • Get country code from location cookie.
  • Refactor where we initialize Stripe to Checkout's parent to be able to redirect to receipt page (need to call Stripe to retrieve Payment Intent).
  • Refactor PaymentPage component to handle redirect from BNPL, and redirect to ecommerce's receipt page withdpm_enabled query param if it's a DPM payment.
  • Modify payment_selected analytics event on "Place Order" click

@julianajlk julianajlk force-pushed the julianajlk/REV-3830/stripe-dpm branch from 1cd08ae to bc56f26 Compare April 9, 2024 13:36
@julianajlk julianajlk force-pushed the julianajlk/REV-3830/stripe-dpm branch from bc56f26 to e1b548d Compare April 9, 2024 14:42
@julianajlk julianajlk merged commit 85e5f51 into master Apr 17, 2024
5 checks passed
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.

2 participants