STRIPE_SECRET_KEY
and NEXT_PUBLIC_STRIPE_PB_KEY
in your .env.local
file.
You’re ready to proceed with webhooks for now.
/api/webhook/stripe
. If your app are (or are going to be) hosted on myapp.com
domain, then you can enter https://app.myapp.com/api/webhook/stripe
at “Endpoint URL” input.
We need to listen to the following events to make things works properly:
checkout.session.completed
customer.subscription.updated
customer.subscription.deleted
customer.session.expired
(optional, you may need this if you want to send an email for an abandoned checkout flow)checkout.session.async_payment_succeeded
customer.session.async_payment_failed
/apps/web/app/api/webhook/stripe/route.ts
file
price_
and add it to your Pro plan in your packages/utils/src/constants/pricing.ts
file.
Repeat this process to all your plans and you’ll be ready to go.
STRIPE_WEBHOOK_SECRET
in your .env.local
file.
Follow the instructions at Stripe Documentation to guarantee that your integration is working properly.