-
Notifications
You must be signed in to change notification settings - Fork 207
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
Payment details not updated between failed attempts #2472
Comments
This issue has been marked as |
After investigating this further, this isn't a problem with the Checkout Block, but there may be an issue with the Stripe backend processing. The This payment data object (with the same So this is how stripe behaves, it's nothing to do with the Checkout Block. It would be nice to return a consistent error message though, so the next step would be to look at the stripe plugin and it's APIs and maybe fix it there. I will try to move this issue there, and if not possible, open a new one |
Hi, |
This issue has gone 180 days (6 months) without any activity. |
Describe the bug
If we get a certain type of payment error on checkout, the stripe payment data (including the stripe key) does not get refreshed on subsequent attempts, and stripe fails with a generic error.
For each checkout store API call, we send a payload with a
payment_data
field. This has the details of the stripe payment made (assuming stripe). Thispayment_data
comes from a callback/observer that stripe registers, which executes on thePAYMENT_PROCESSING
event. One of the props of thispayment_data
object is astripe_key
which should be different for each payment attempt. As thepayment_data
is not being refreshed between payment attempts, stripe will error as we are trying to essentially create a payment that already exists.To reproduce
This can be seen by:
4000 0000 0000 9979
(this is a stripe test card that should return aCard has been declined message
).Card has been declined
message in the payment options area. This is expected. You will also see a generic error at the top of the page, ignore this.payment_data[].stripe_source
is the same on both requests.Expected behavior
I would expect the stripe payment data to have refreshed before sending it as the payload to the Store API /checkout endpoint, and to see the same "Card has been declined" error message each time.
To Fix
Note this is only visible after we merge the data store branch, as there is an error on trunk that prevents payment notices from showing.
The solution is to make sure the
PAYMENT_PROCESSING
event is emitted every time we click the place order button, before the call to the store api. We also want to make sure thepaymentData
is updated in the payments store.The text was updated successfully, but these errors were encountered: