Skip to content

Stripe Payments

The DevStarter Saas Template comes with Stripe already integrated.

connect stripe by adding the stripe keys to backend and frontend projects.

Backend

STRIPE_WEBHOOK_SECRET_LIVE=STRIPE_WEBHOOK_SECRET_LIVE
STRIPE_SECRET_KEY=STRIPE_SECRET_KEY
STRIPE_PUBLISHABLE_KEY=STRIPE_PUBLISHABLE_KEY

Frontend

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=""

now the Backend server listens for stripe webhooks at http://localhost:8000/api/payments/webhook route. add this as a webhook to your stripe account and to sync all the products with stripe and the database you can run the following command

Terminal window
python manage.py init_plans

this would seed the products in your database and you can see the products on /pricing page in frontend.

the Ideal way to setup stripe products is to create a product and then add multiple prices for that which account for annual/monthly subscriptions and same can be done across currencies. this can then be used to change the view on Frontend in <PricingTable/> component in frontend.