Key takeaways
- Use Aurora chat for both subscriptions and one-time payments.
- Never paste your Stripe Secret Key into chat. Store it in Project settings > Secrets.
- You do not need Supabase for a simple checkout. Connect Supabase when you want to store each user’s plan or to restrict pages to subscribers.
- Test in Stripe Test Mode before you accept live payments.
- Deploy again after you change a secret. The live site gets secret changes only on a deploy.
Requirements
Before you add Stripe, make sure that you have:- A Stripe account. Create your products and prices in the Stripe Dashboard, or tell Aurora the prices that you want.
- Two secrets in Project settings > Secrets:
STRIPE_SECRET_KEYandSTRIPE_PUBLISHABLE_KEY. Both are in the Stripe Dashboard under Developers > API keys. - For subscriptions that are tied to user accounts: a connected Supabase project with sign-in. See Supabase Integration.
For tests, use Stripe Test Mode. The standard test card is
4242 4242 4242 4242, with any future expiration date and any 3-digit CVC.Set up payments in chat
1
Store your Stripe keys
Open your project. Click the project name above the chat, then click Project settings. Open Secrets and add
STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY. Use the test keys first.2
Describe the payment flow
Example prompts:
- “Create a one-time checkout for my Digital Course at $29.”
- “Add a pricing page with monthly and annual Premium plans. Use Stripe Checkout.”
- “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 result
Aurora adds the Stripe packages, writes the server functions (usually in
app/server/stripe.ts), and adds the buttons to your pages. If the flow needs database tables, Aurora proposes the SQL in the chat and the project owner approves it.4
Test, then deploy
Complete a test checkout in the preview. Then deploy the project. Before you accept live payments, replace the test keys with live keys in Secrets and deploy again.
Webhooks
A simple checkout does not need webhooks. Use webhooks when your app must react to Stripe events, for example to record that a subscription started, changed, or ended.1
Ask Aurora for the webhook handler
Example prompt: “Add a Stripe webhook for checkout completed and for subscription created, updated, and deleted. Store each user’s active plan by Supabase user id.”Aurora writes the handler in your project. The handler checks the Stripe signature on every event. Ask Aurora for the URL path of the handler.
2
Deploy the project
Stripe must reach a public URL, so deploy the project first. The webhook URL is your live site address plus that path.
3
Create the webhook endpoint in Stripe
In the Stripe Dashboard, go to Developers > Webhooks, add an endpoint, and enter the webhook URL.
4
Select the events
Common events are:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failed
5
Store the signing secret
Copy the webhook signing secret from Stripe. Add it in Project settings > Secrets as
STRIPE_WEBHOOK_SECRET, then deploy again.6
Verify the result
Complete a test checkout. Confirm that Stripe shows a successful delivery and that your database has the correct user, plan, and status.
If you are not sure which events or tables you need, turn on Chat mode first. Ask Aurora to explain the subscription lifecycle and to draft the tables before it changes code.
Test your integration
- Use Stripe Test Mode for all setup and tests.
- Test a successful payment and a failed payment.
- If you use webhooks, confirm that the events arrive in the Stripe Dashboard and get a success response.
- Confirm that the app shows the correct state after a checkout or a subscription change.
Troubleshooting
Check the browser console and network requests
Check the browser console and network requests
In Chrome, right-click the page, choose Inspect, then open the Console and Network tabs. Look for the failed request. Copy the exact error into the chat and ask Aurora to find the cause.
Check webhook deliveries in Stripe
Check webhook deliveries in Stripe
In the Stripe Dashboard, go to Developers > Webhooks and open your endpoint. Review the recent deliveries and their response codes. After you fix a problem, resend the failed events from Stripe.
Webhook signature errors
Webhook signature errors
The signing secret does not match. Copy the signing secret of this endpoint from Stripe again, save it as
STRIPE_WEBHOOK_SECRET, and deploy again. Test mode and live mode have different secrets.Use Chat mode for complex problems
Use Chat mode for complex problems
Turn on Chat mode and describe the flow step by step: what you clicked, what you expected, and what happened. Include errors from the browser or from Stripe. When the cause is clear, turn Chat mode off and ask Aurora to make the fix.