Add payments with Stripe
You want your app to accept payments (one-time purchases, subscriptions, or both) and you want to use Stripe as the payment provider.
This guide explains what to prepare before you ask Mara, and what happens after you do.
Before you start
- You need a Stripe account. If you do not have one, create it at stripe.com. It takes a few minutes.
- You need your Stripe publishable key and secret key. Find these in the Stripe dashboard under Developers → API keys.
- Have a clear description of what you want to charge for: one-time payment, subscription tiers, or metered billing. The clearer your brief to Mara, the less back-and-forth before Theo starts writing code.
Steps
-
Start a conversation with Mara in your project and describe the payment feature. For example:
“I want users to pay $12/month for a Pro plan. Free users get three submissions per day; Pro users get unlimited.”
Mara will ask follow-up questions to clarify the billing model, what happens when a subscription lapses, and how you want the checkout experience to look.
-
Provide your Stripe keys when prompted. Mara will ask for the keys so Kai can store them as environment variables. They are never written into your application’s source code.
When Mara needs a secret, she renders a dedicated secure input card in the chat. Type or paste your key into the password field and click Save. The value goes directly to the secrets vault and is immediately cleared from the UI. It never appears in the conversation log.
You can also add or rotate secrets at any time without involving Mara: open your project, go to Settings → Secrets, and manage them there directly.
-
Iris scopes the requirements. Mara routes the request to Iris, who maps out the checkout flow, the subscription states (free, active, past due, cancelled), and any UI changes needed.
-
Theo implements the integration. Theo wires up:
- Stripe Checkout or Stripe Elements for the payment form
- Webhook handling for subscription lifecycle events (
customer.subscription.updated,invoice.payment_failed, etc.) - A billing status field on the user record so the rest of your app can gate features by plan
-
Review the preview. Mara shows you the checkout flow in the live preview. Try a test purchase with a Stripe test card before going live. Use
4242 4242 4242 4242for a successful payment and4000 0000 0000 9995to simulate a decline. -
Switch to live keys when ready. Tell Mara you want to go live. Kai swaps the test keys for your live Stripe keys and redeploys. No code changes are needed.
Verify it worked
Make a test purchase using a Stripe test card in the preview environment. Check your Stripe dashboard under Test → Payments to confirm the charge appears. For subscriptions, verify that the user’s plan tier updates correctly in your app after the test checkout completes.
Notes
- Stripe webhook signatures are verified automatically by the integration Theo generates. You do not need to configure webhook signing secrets manually.
- Webhook endpoint registration in the Stripe dashboard may need to be done manually. Ask Mara if you are unsure.
- For EU businesses or apps with EU users, discuss VAT handling with Mara before implementation. Stripe Tax can be enabled, but it requires a brief to Iris first.
Related
- Agent roles: Theo handles third-party integrations; Kai manages secrets.
Thanks for the feedback.