How do I take payments with Stripe?
Send customers to Stripe Checkout from your server, and give them access only when Stripe's webhook confirms the payment.
Stripe handles card forms, subscriptions and receipts, so card numbers never touch your server. A typical setup:
- Build in a sandbox first: a practice copy of your account with test card numbers, where no real money moves.
- Keys: the publishable key may appear in your web page; the secret key stays on your server.
- Checkout: your server creates a Checkout session and redirects the customer to Stripe's payment page.
- Webhooks: Stripe sends your server events such as a completed checkout or a canceled subscription. Verify each event's signature with the webhook signing secret, and handle each event exactly once, because Stripe can retry and events can arrive out of order.
- Source of truth: update a customer's plan from these events, not from the success page, which anyone could open without paying.
Subscriptions add more cases: trials, upgrades partway through a billing period, failed payments and cancellations. Test each one in the sandbox, then switch to live keys.
AI-written billing code often trusts the redirect, ignores failed payments or processes duplicate events twice, so review it closely.
Vumbli's SaaS & Payments with Stripe track covers Checkout and webhooks, subscription states, idempotent handling, proration, usage billing and failed payments, and ends with you fixing an AI-written billing webhook.
Start with these missions
- Pricing models that fit your product (SaaS & Payments with Stripe)
- Plan entitlements in code (SaaS & Payments with Stripe)
- A subscription state machine (SaaS & Payments with Stripe)
Tracks that teach it
More questions, answered by building