rphlmr/supa-stripe-stack

Hangs at "completing your checkout"

Closed this issue · 3 comments

Most of the functionality here worked pretty well right out of the box, which I can't say for some of the other solutions I experimented with, so kudos for that. I followed the instructions and got it running pretty seamlessly on localhost, with one exception: it hangs at the "Completing your checkout" screen.

I did a little debugging and determined that the API request is successful, and getSubscription is working correctly. However, it returns a null value because no subscription has been created in the backend database.

When I look at the logs in the Stripe web interface, I can see that my localhost webhook is listening and has returned some POST responses with status code 200, so it's apparently not a webhook problem.

Rather, I think it's that the action function in routes/api/webhook.ts is failing to trigger.

Thanks for your words 🤗.

Can you confirm that it fails on the demo too ?
https://remix-supa-stripe-stack.fly.dev

The problem proved to be that I'm an idiot and don't know what I'm doing with this stuff. :) I was running the Stripe webhook listener, then hitting CTRL-C so I could run npm run dev in the same Powershell window. (The Stripe dashboard showed my local webhook as listening, but CTRL-C had actually canceled the listener.) The app worked as expected when I ran the webhook listener and the dev server concurrently in two separate Powershell windows.

[putting-on-clown-makeup.gif]

It does make me wonder if the app needs some error handling for this scenario, though. You could have a situation where a transaction is processed through Stripe, but for some reason the response isn't received, so no subscription gets created. You might need a handler to reverse the transaction if the checkout process times out without creating a subscription.

Thank you for your hard work on this great app!

I submitted a pull request with a minor update to the README in case anyone else is as dumb as me. :)