Stripe webhook endpoint for processing payment events
https://api.vaniykempire.com/api/payments/webhookpayment_intent.succeededpayment_intent.payment_failedSTRIPE_WEBHOOK_SECRET environment variablestripePaymentIntentIdcompletedstripePaymentIntentIdfailedapplication/jsonevt_1MtwBwLkdIwHu7ix28a3tqPa)payment_intent.succeeded, payment_intent.payment_failed)true to acknowledge receipt of the webhookWebhook Error: <error message>| Issue | Solution |
|---|---|
| Signature verification fails | Ensure raw body parsing is enabled and webhook secret is correct |
| Purchase not found | Check that payment intent was created through your API |
| Webhooks not received | Verify webhook URL is correct in Stripe Dashboard |
| Duplicate events | Implement idempotency using event ID |
whsec_...express.raw({ type: 'application/json' })express.json() middlewaresrc/controllers/paymentController.js:64-130src/routes/paymentRoutes.js:7-11