feat(GRO-608): Add Stripe webhook handler for payment events
- Add POST /api/webhooks/stripe endpoint for Stripe event processing - Handle payment_intent.succeeded: mark invoice as paid, set paymentMethod=card - Handle payment_intent.payment_failed: record failure reason on invoice - Handle charge.refunded: mark invoice as void - Handle charge.dispute.created: log dispute - Idempotency: skip if stripePaymentIntentId already recorded - Add stripe_payment_intent_id, stripe_refund_id, payment_failure_reason columns - Requires STRIPE_WEBHOOK_SECRET env var for signature verification Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE "invoices" ADD COLUMN "stripe_payment_intent_id" text;
|
||||
ALTER TABLE "invoices" ADD COLUMN "stripe_refund_id" text;
|
||||
ALTER TABLE "invoices" ADD COLUMN "payment_failure_reason" text;
|
||||
ALTER TABLE "invoices" ADD CONSTRAINT "idx_invoices_stripe_payment_intent_id" UNIQUE("stripe_payment_intent_id");
|
||||
Reference in New Issue
Block a user