End-to-end payment with webhooks.
This use case works best with the following environment variables, which are injected into your sandbox at runtime:
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYPayments are the one part of an app you can't bluff. Stripe's docs are excellent, but wiring them into a real Next.js app means juggling Checkout sessions, redirect states, signature verification, and the detail nearly everyone skips until it bites: idempotency. Stripe retries webhooks, and if your handler isn't deduplicating events it will happily fulfill the same order twice. This blueprint wires the full path correctly the first time, as code in your own repository.
A complete Stripe checkout integration on Next.js. A product listing page with pricing cards, server-side creation of Checkout sessions for both one-time payments and subscriptions, and success and cancel pages that confirm the outcome. The webhook handler verifies Stripe's signature, processes checkout.session.completed and invoice.paid, and deduplicates by event ID so a retried webhook never runs twice. A customer portal link lets buyers manage their own subscriptions without emailing you.
You watch it happen in the task workspace: the agent scaffolds the app, builds the pricing page and session routes, wires the signed webhook handler, and runs a test event through it to confirm processing is idempotent. The code lands on a branch in your repository with a pull request ready.
The first version is a working baseline you steer with plain follow-up messages:
Each follow-up wakes the same repository and the agent continues on its own code.
Do I need a Stripe account? Yes, it runs on your own Stripe keys. Test-mode keys work end to end, so you can drive a full checkout before going live.
How are webhook retries handled? Every event is checked against its ID before processing, so Stripe's automatic retries are safe and never double-fulfill an order.
One-time or subscription? Both. Session creation covers each, and the customer portal link handles ongoing subscription management.