From 2991444d1bfa8152ed4fe22d40acc2290eb64d5e Mon Sep 17 00:00:00 2001 From: Surya Bumantara Date: Thu, 10 Oct 2024 01:53:18 +0700 Subject: [PATCH] fix bug midtrans webhook --- src/utils/webhook/midtrans.webhook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/webhook/midtrans.webhook.ts b/src/utils/webhook/midtrans.webhook.ts index a28c42f..c005b35 100644 --- a/src/utils/webhook/midtrans.webhook.ts +++ b/src/utils/webhook/midtrans.webhook.ts @@ -36,7 +36,7 @@ router.post('/status', async (req, res) => { console.log(payload) if ( payload.status_code === '200' && - payload.fraud_status === 'accept' && + (!payload.fraud_status || payload.fraud_status === 'accept') && (payload.transaction_status === 'settlement' || payload.transaction_status === 'capture') ) { const order_category = payload.order_id.split('-')[0]