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.