Skip to main content
Aurora can help you add Stripe payments through chat. Connect Supabase, store your Stripe Secret Key securely, then describe the payment flow you want: one-time checkout, subscriptions, pricing tiers, customer portals, or role-based access. Aurora can generate the checkout or portal Edge Functions, database tables with Row Level Security (RLS), and UI buttons needed for the flow. Webhooks are optional for simple flows and recommended for more advanced subscription or entitlement logic.

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.
Do not expose Stripe secret keys in frontend code or variables prefixed with VITE_. Secret keys should only be available to server-side code or Supabase Edge Functions.
When testing payments, use Stripe Test Mode. The standard test card is 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.
1

Prepare your project

Confirm that:
  • 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.
2

Describe the payment flow

Example prompts:
  • “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.”
3

Review the generated changes

Aurora may propose Edge Functions, database tables, RLS policies, UI components, and environment variables. Review the generated code and any SQL before applying it.
4

Apply and deploy

Apply the changes, deploy the app, and test the full checkout flow in Stripe Test Mode before switching to live keys.
Subscriptions should always be linked to the authenticated user’s Supabase id so access control can be enforced securely with RLS and server-side checks.

Securely store Stripe keys

To integrate Stripe securely:
1

Find your Stripe Secret Key

In the Stripe Dashboard, go to Developers > API keys and copy the Secret Key for the correct mode: test or live.
2

Store the key outside chat

Add the key to Aurora Settings > Secrets or to Supabase > Edge Functions > Secrets, depending on where the generated backend code will run.
3

Use a clear secret name

Use a name such as STRIPE_SECRET_KEY. If you are configuring webhooks, also store the signing secret as STRIPE_WEBHOOK_SECRET.
Never paste a Stripe Secret Key directly into Aurora chat. Treat it like a production password: exposing it could allow unauthorized access to your Stripe account.

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.
1

Ask Aurora to create webhook handling

In Chat mode, plan the tables and events first. Then ask Aurora to implement the Edge Function, database updates, and RLS policies.Example prompt: “Set up Stripe webhooks in Supabase for subscription created, updated, deleted, and checkout completed events. Store each user’s active plan by Supabase user id.”
2

Retrieve the Edge Function endpoint URL

After the function is created and deployed, copy its endpoint URL from Supabase.
3

Create a Stripe webhook endpoint

In Stripe Dashboard, go to Developers > Webhooks > Create an event destination and enter the Supabase Edge Function endpoint URL.
4

Select relevant webhook events

Common events include:
  • checkout.session.completed
  • payment_intent.succeeded
  • payment_intent.payment_failed
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_succeeded
  • invoice.payment_failed
5

Store the webhook signing secret

Copy the webhook signing secret from Stripe and store it securely in Supabase Edge Function secrets, commonly as STRIPE_WEBHOOK_SECRET.
6

Verify entitlement updates

Complete a test checkout and confirm your database updates the correct user, plan, and subscription status.
If you are unsure which events or tables you need, use Aurora’s Chat mode first. Ask it to explain the subscription lifecycle and draft the schema before implementing changes.

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

1

Open Developer Tools

In Chrome, right-click the page, choose Inspect, then open the Console and Network tabs.
2

Look for failed requests

Check checkout session creation, portal session creation, and post-checkout redirects.
3

Share exact errors with Aurora

Copy error messages into Chat mode and ask Aurora to trace the likely cause before making more changes.
1

Open Supabase Dashboard

Go to your Supabase project dashboard.
2

Open Edge Function logs

Navigate to Edge Functions > Logs and inspect the function handling checkout or webhooks.
3

Check secrets and permissions

Verify that STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are present and that your function can update the required tables.
1

Open Stripe Dashboard

Go to Developers > Webhooks.
2

Inspect delivery attempts

Open the webhook endpoint and review recent event deliveries, response codes, and payloads.
3

Retry failed events

After fixing the issue, retry failed webhook deliveries from Stripe to confirm the handler works.
1

Switch to Chat mode

Use Chat mode when you want Aurora to reason about the problem before editing code.
2

Explain the flow step by step

Include what you clicked, which event you expected, what happened instead, and any logs from Stripe or Supabase.
3

Implement after the plan is clear

Once the diagnosis makes sense, ask Aurora to implement the fix.