From d853f5fa21361277d1008e83c89e304471ee50f8 Mon Sep 17 00:00:00 2001 From: Altay Date: Sat, 16 Dec 2023 11:58:19 +0300 Subject: [PATCH] chore: only fulfill paid orders --- app/api/webhooks/stripe/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/webhooks/stripe/route.ts b/app/api/webhooks/stripe/route.ts index 9a240b1..c9a0b6b 100644 --- a/app/api/webhooks/stripe/route.ts +++ b/app/api/webhooks/stripe/route.ts @@ -39,7 +39,10 @@ export async function POST(req: NextRequest) { }, ); - await fulfillOrder(session); + if (session.payment_status === 'paid') { + await fulfillOrder(session); + } + break; }