vendure-ecommerce/storefront-remix-starter

Error during payment through stripe

demodes opened this issue · 5 comments

In checkout, upon successful payment by credit card with stripe, the navigation goes to "/checkout/confirmation/ZAK6VT93QBKR4S5Q, but fails with an error.
But the order in the admin dashboard is fine and the payment is settled. After a browser refresh, the checkout page shows correctly without error.

Link to the slack discussion with more details:
https://vendure-ecommerce.slack.com/archives/CKYMF0ZTJ/p1668072138853759

Screenshot from 2023-01-23 15-34-27
image

I've worked around the issue by implementing a retry system. Please give it a shot and report back!

If this works then it could be improved further by only attempting retries if the code of the active order matches the confirmation code. For now though I think this suffices.

@michaelbromley could you check why the Cloudflare build failed? I didn't do any major changes so my suspicion is that the deploy simply failed on their end.

@kyunal here:

23:07:30.406 | Done in 924ms.
23:07:32.032 | Building Remix app in production mode...
23:07:33.139 |  
23:07:33.141 | ✘ [ERROR] No matching export in "node_modules/@remix-run/react/dist/esm/index.js" for import "useRevalidator"
23:07:33.142 |  
23:07:33.142 | app/routes/checkout/confirmation.$orderCode.tsx:8:9:
23:07:33.142 | 8 │ import { useRevalidator } from '@remix-run/react';
23:07:33.142 | ╵          ~~~~~~~~~~~~~~
23:07:33.142

Thank you, unfortunately this is bad. I will have a look at this later today.

Should all be fixed now, it couldn't deploy because this version of remix didn't yet support this function. For some reason my local version of Remix differed which is why I didn't notice during development.

Be sure to run npm install before building 🙂

I tested it in production on chrome and firefox and everything is working smoothly. Great work. Thanks a lot :)