Implements and reviews Stripe in Vite/React plus Vercel serverless handlers: Checkout, webhooks, raw body, idempotency, and secrets. Use when adding payments, billing, webhooks, or when the user mentions Stripe, checkout, or subscription flows in this project.
@stripe/stripe-js, React components).STRIPE_SECRET_KEY): server only — Vercel env, never VITE_.Stripe-Signature.api/stripe-webhook.ts verifies signatures with the raw request body.bodyParser: false for the webhook route (see comment in that file and vercel.json if configured). Parsing JSON before verification breaks signature validation.stripe.webhooks.constructEvent(rawBody, sig, webhookSecret).event.id if storing processed events.event.type and event.id, not full card numbers or PII.@stripe/react-stripe-js): Elements, PaymentElement, confirm; no secret keys.