I have a React app built in Vite and I deployed snipcart earlier today but was getting CORS errors when returning the /pay endpoint (I’m integrated with Stripe, hosted on Netlify). Everything on the Stripe end is returning 200s - I’ve got about fifteen ‘Incomplete’ stripe transactions in my dashboard there so the integration seems fine from their side. My domain is set correctly in snipcart and all the data attributes seem correct in my code.
I’m getting this in my production app (which I’ve now reverted) and in a staging deploy (URL below - which I have added as an allowable domain in the dashboard on live and test versions).
The error in the console:
[Error] Origin https://deploy-preview-2--clinquant-kheer-6f2dad.netlify.app is not allowed by Access-Control-Allow-Origin. Status code: 500
[Error] Fetch API cannot load https://app.snipcart.com/api/cart/f06833e1-4405-46f2-843c-717ea3de4425/pay due to access control checks.
[Error] Failed to load resource: Origin is not allowed by Access-Control-Allow-Origin. Status code: 500 (pay, line 0)
[Error] A ‘system’ error occured in Snipcart.Failed to get response from host