⌨️ Codingadvancedstripepaymentssubscriptionssaas

Integrate Stripe Payments

Build a complete Stripe integration with checkout, webhooks, subscriptions, and customer portal.

The Prompt

prompt.txt
Implement Stripe payment integration with the following requirements. Include:
1. Checkout session creation (one-time or subscription)
2. Success and cancel redirect handling
3. Webhook handler with signature verification
4. Events to handle: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed
5. Customer portal link generation
6. Idempotency keys on all API calls

Framework: [NEXTJS APP ROUTER / EXPRESS]
Payment type: [ONE-TIME / SUBSCRIPTION / BOTH]
Database: Store subscription status in [PRISMA/POSTGRES]

Include the required environment variables and Stripe dashboard configuration steps.

Example Output

Built a complete Next.js Stripe integration: a /api/checkout route that creates Stripe sessions with metadata for user tracking, a /api/webhooks/stripe route with signature verification using the raw request body, and handlers for all 4 lifecycle events that update the subscriptions table.

FAQ

Which AI model is best for Integrate Stripe Payments?

Claude Sonnet 4 — careful about webhook security and idempotency details.

How do I use the Integrate Stripe Payments prompt?

Copy the prompt, replace the [BRACKETED] placeholders with your specific information, and paste into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.). Built a complete Next.js Stripe integration: a /api/checkout route that creates Stripe sessions with metadata for user tracking, a /api/webhooks/stripe route with signature verification using the raw request body, and handlers for all 4 lifecycle events that update the subscriptions table.