Implementing secure payments and paywalls with Stripe
Product Catalogue
in the Stripe Dashboard.Stripe Webhook Secret
Developers -> Webhooks
in the Stripe Dashboard.https://yourwebsite.com/api/payments/stripe
..env
file as STRIPE_WEBHOOK_SECRET
..env
as STRIPE_SECRET_KEY
. Find this
under Developers -> API Keys.app/api/payments/stripe/route.ts
manages Stripe payments and subscriptions:
STRIPE_WEBHOOK_SECRET
.profiles
table:
purchase
column in profiles
.purchases
.purchases
table should already exist if you followed the Quick Setup guide and ran the Supabase migrations using the CLI:
supabase/migrations/20240000000007_purchases.sql
Make sure RLS is turned on. We don’t need to add any rules as we’ll be using the service key for to interact with this table.
session.metadata.type
(set in payment link).product.metadata.type
.purchases
table.profiles
table with the new purchase type.updateUserProfile
function in @/lib/hooks/userData
to handle
various purchase or subscription types based on metadata.toolConfig.ts
).PaymentModal
.