Builds Stripe payment flows matched to the project stack.
Choose the approach
| Need | Use |
|---|---|
| Fastest, hosted | Stripe Checkout (checkout.sessions.create) |
| Embedded, custom UI | Payment Element + PaymentIntent/SetupIntent |
| Recurring | subscription mode |
Checkout Session essentials
- mode: subscription
- line_items: price + quantity
- customer OR customer_email (reuse existing customer to avoid dupes)
- success_url / cancel_url
- allow_promotion_codes: true
- subscription_data metadata: user_id
- automatic_tax enabled (if using Stripe Tax)
Critical rules
- Reuse customer: check for existing
stripe_customer_id; for plan changes usesubscriptions.update(proration), never a 2nd subscription - Pass
user_idin metadata for webhook provisioning - Server-side price validation (whitelist price IDs)
Verify
stripe_implementation_planner (MCP) for architecture; test with test cards; confirm via webhook-implementation.