Key takeaways
- Use Aurora chat for both subscriptions and one-time payments.
- Never paste your Stripe Secret Key into chat. Store it in Settings > Secrets or Supabase Edge Function secrets.
- Connect Supabase before asking Aurora to build payment flows that need secure backend logic.
- Tie subscriptions and entitlements to the authenticated user’s Supabase
id. - Test in Stripe Test Mode before accepting live payments.
- Debug with the browser console, Supabase Edge Function logs, and Stripe Dashboard logs.
Requirements
Before integrating Stripe, make sure you have:- An Aurora project connected to Supabase. See Supabase Integration.
- A Stripe account with products and prices configured, or a clear price you want Aurora to create in code.
- For one-time sales: a working product, cart, or checkout entry point.
- For subscriptions: Supabase Auth, login flows, and the pricing tiers or Stripe Price IDs you want to use.
- A Stripe Secret Key stored securely as a backend-only secret, usually named
STRIPE_SECRET_KEY.
4242 4242 4242 4242, with any future expiration date and any 3-digit CVC.Stripe payment setup: chat-driven flow
Once Supabase is connected and your Stripe key is stored securely, tell Aurora what you need in chat. Aurora can scaffold the backend functions, database schema, and UI changes.Prepare your project
- Supabase is connected.
- Auth is enabled if payments should be linked to user accounts.
- Your Stripe Secret Key is stored in Settings > Secrets or in Supabase Edge Function secrets.
- You have product names, amounts, billing intervals, or Stripe Price IDs ready.
Describe the payment flow
- “Create a one-time checkout for my Digital Course at $29.”
- “Add monthly and annual Premium subscription plans tied to each user’s Supabase id.”
- “Add a customer billing portal button so subscribers can manage their plan.”
- “Restrict the Pro dashboard to users with an active subscription.”
Review the generated changes
Apply and deploy
id so access control can be enforced securely with RLS and server-side checks.Securely store Stripe keys
To integrate Stripe securely:Find your Stripe Secret Key
Store the key outside chat
Use a clear secret name
STRIPE_SECRET_KEY. If you are configuring webhooks, also store the signing secret as STRIPE_WEBHOOK_SECRET.Advanced integration: webhooks and Supabase
For subscriptions, entitlements, role-based access, invoices, and payment failure handling, use Supabase Edge Functions with Stripe webhooks. Webhooks let Stripe notify your backend when a checkout succeeds, a payment fails, or a subscription changes.Ask Aurora to create webhook handling
Retrieve the Edge Function endpoint URL
Create a Stripe webhook endpoint
Select relevant webhook events
checkout.session.completedpayment_intent.succeededpayment_intent.payment_failedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
Store the webhook signing secret
STRIPE_WEBHOOK_SECRET.Verify entitlement updates
Testing your integration
- Use Stripe Test Mode for all setup and QA.
- Use test card
4242 4242 4242 4242, any future expiration date, and any 3-digit CVC. - Test both successful and failed payment paths.
- Confirm webhook events arrive in Stripe Dashboard logs.
- Confirm Supabase Edge Function logs show successful signature verification and database updates.
- Confirm the app UI reflects the payment state after checkout or subscription changes.
Debugging and troubleshooting
Check browser console and network logs
Check browser console and network logs
Open Developer Tools
Look for failed requests
Share exact errors with Aurora
Review Supabase Edge Function logs
Review Supabase Edge Function logs
Open Supabase Dashboard
Open Edge Function logs
Check secrets and permissions
STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are present and that your function can update the required tables.Verify webhook events in Stripe
Verify webhook events in Stripe
Open Stripe Dashboard
Inspect delivery attempts
Retry failed events
Use Chat mode for complex issues
Use Chat mode for complex issues
Switch to Chat mode
Explain the flow step by step
Implement after the plan is clear