-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix ECE exception when payment fails #10048
base: develop
Are you sure you want to change the base?
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: -66 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
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! Tests as expected. JS error is gone. Just left a minor comment for you @cesarcosta99
*/ | ||
abortPayment: ( payment, message ) => { | ||
payment.paymentFailed( { reason: 'fail' } ); | ||
abortPayment: async ( message ) => { |
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.
Why was the async
keyword added here? I don’t see any asynchronous operations being performed inside this method.
Fixes #9990.
Changes proposed in this Pull Request
This PR removes the
payment.paymentFailed
call when aborting the ECE payment. I went with this approach because it looks like we're mistakenly calling that function.The error message ("Ensure you are either submitting a payment or calling paymentFailed() once per confirm event") indicates an integration error. I confirmed we're calling that function just once, and I've simulated errors before and after confirming the intent, and in all cases the exception was generated.
According to the documentation, we're only supposed to call this before calling
stripe.confirmPayment
, but we don't use that API, we process payments through intents in the backend. That makes me conclude we have an integration error because we're using different APIs, and the only solution is to remove that call, which has no effect.Testing instructions
Setup
npm run build:client
.Regression test: Ensure ECE still works as expected
Test: Ensure ECE fails gracefully
Test: Ensure tokenized ECE works as expected
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge