While developing, visit http://127.0.0.1:3000
instead of localhost
so that it works properly, we use the IP because that way the Stripe hooks can find it.
The app needs to listen to Stripe webhooks to keep subscriptions in sync. To develop locally you need:
- A Stripe account
- Add your
STRIPE_HOOKS
environment variable - Download the Stripe cli tool
stripe login
stripe listen --forward-to localhost:3000/api/stripe/webhooks
- If you want to manually trigger a mock event
stripe trigger payment_intent.succeeded <- event name
- Go to your Stripe developer dashboard and add the url to your endpoint