Fix Next.js App Router Stripe webhook race condition (orders missing metadata)
Hey guys, we have a Next.js 15 app deployed on Vercel with a PostgreSQL database. When customers checkout via Stripe Checkout, our webhook handler ('checkout.session.completed') intermittently fails to write the fulfillment row because the database query times out or runs before the user session is committed. About 5% of paid orders end up in a 'pending' state and we currently have to fix them manually by cross-referencing Stripe dashboard receipts. Need someone who has actually worked with Stripe webhooks + Prisma/pg poolers to: 1. Implement idempotent event processing (storing stripe event IDs in an events table). 2. Fix the database race condition so orders always mark as paid immediately. 3. Add proper error logging so we can see failed events in Sentry or server logs. Should be a 2-4 hour job for someone who knows their way around Next.js route handlers. Please link a GitHub commit or repo where you've handled payments — no generic cover letters.
Free to apply, forever. Propose your rate and let your verified proofs speak for you.