Setting up your stripe products
prisma/seed.ts
seed file synchronizes Stripe products and prices with a local database.
You should make chnages to the app/modules/stripe/plans.ts
file this is where you can set plan details, like name and prices for different currencies.
When you first run npx prisma migrate dev --name init
the seed.ts
file will run and populate your local database with users and roles.
Plus it will contact stripe and create products and prices for you.
The seed.ts
file is designed to keep your local or production database in sync with Stripe, with Stripe acting as the source of truth.
Here’s how the seed file works:
updateOrCreateProducts
function:
createNewProducts
function:
PRICING_PLANS
that don’t exist in Stripe