← ClaudeAtlas

setup-billinglisted

Implement Stripe billing end-to-end: products/prices from config, checkout session, webhook handler with signature verification and idempotency, and customer portal. Present plan then implement.
evgenii-studitskikh/Claude-Code-SaaS-Studio · ★ 1 · AI & Automation · score 80
Install: claude install-skill evgenii-studitskikh/Claude-Code-SaaS-Studio
Wire up the full Stripe billing integration based on the approved pricing spec: create Stripe products and prices programmatically from a config file, implement the checkout and portal flows, and build a webhook handler that is safe to deploy to production. Non-autonomous: implementation plan is presented and approved before any code is written. ## Phases 1. **Load pricing spec** — read `docs/specs/pricing.md`. If it is missing or incomplete, stop and direct to `/design-pricing`. Confirm the Stripe account mode (test vs. live) and that `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SECRET` are present in `.env.example`. 2. **Present implementation plan** — show the files that will be created: `lib/stripe/config.ts` (plan definitions), `lib/stripe/client.ts` (server-side Stripe instance), `app/api/stripe/checkout/route.ts` (checkout session endpoint), `app/api/stripe/portal/route.ts` (customer portal endpoint), `app/api/stripe/webhook/route.ts` (webhook handler), and any UI components for pricing and upgrade buttons. Get approval before writing. 3. **Implement config and client** — write `lib/stripe/config.ts` with plan definitions loaded from environment variables or a static config object (no hardcoded price IDs in business logic). Write `lib/stripe/client.ts` exporting a server-only Stripe instance. Show files before writing. 4. **Implement checkout and portal** — write the checkout session route handler (creating or retrieving the Stripe Customer, setting `success_url` and `canc