Description
Description
When the ECE is rendered on a product page, and the customer clicks on the ECE button(s), the POST /cart/add-item
call could fail for various reasons:
- server-side validation errors
- limited stock
- others
Really, it's up to any plugin to make that call fail.
The problem is that we cannot wait for the POST /cart/add-item
to resolve because if the call takes more than 1s, the payment sheet is not displayed at all.
So we display the payment sheet, while the POST /cart/add-item
call runs in the background.
But we also cannot create a temporary cart all the times, because items might be out of stock.
We implemented a workaround ( #10599 ) so that a generic error message appears to the customer.
We attempt to unmount the ECE button and the Stripe Elements it depends on, so that the payment sheet will hide, but not all browsers behave consistently.
In Safari + Apple Pay, the payment sheet remains despite the ECE button and the Stripe Elements container unmounting.
This means that a customer could be interacting with the payment sheet (which on mobile devices overtakes the whole screen) without knowing that an error happened in the background. And the error notice is hidden by the payment sheet.
The goal of this spike is to identify a solution that can work on all browsers, and that would provide a better user experience for our customers, so that they're aware of the error happening in the background and they don't proceed with the payment.
Discussion: p1742402301419669-slack-C9976E5MJ
Latest response:
At this time we don't have a way to add a custom error message nor do we have plans to implement that for the payment sheet. I've put in a request with the team but don't have an update or timeline at this time