PRODUCTION GUIDE / CHECKOUT-SESSION-COMPLETED-NEXTJS
Handle checkout.session.completed safely in Next.js
A success-page redirect is not fulfillment. The webhook is the durable payment signal.
Verify payment state
For delayed methods, checkout.session.completed may not mean funds are final. Handle async success and failure events where relevant.
Trust server objects
Retrieve canonical IDs and metadata from Stripe server-side. Never grant access from URL parameters alone.
Make fulfillment repeatable
Use the event ID and order ID as unique keys so a retry returns success without creating a second entitlement.
Need the tested implementation?
The Hookproof kit includes the typed router, persistent idempotency adapters, fixtures, and deployment runbook.
GET THE $29 KIT