From de9ea73dcdc6ff37d08a2c8d35a6184ba133bff6 Mon Sep 17 00:00:00 2001 From: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Date: Tue, 20 May 2025 15:45:20 +0530 Subject: [PATCH 1/2] Update firebase.json --- firebase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase.json b/firebase.json index ecc3d3c..6920866 100644 --- a/firebase.json +++ b/firebase.json @@ -7,7 +7,7 @@ { "source": "functions", "codebase": "default", - "timeoutSeconds": 300, + "timeoutSeconds": 360, "ignore": [ "node_modules", ".git", -- 2.43.0 From 95492d304fc8faadf993758ac30816f85ac55121 Mon Sep 17 00:00:00 2001 From: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Date: Tue, 20 May 2025 16:08:33 +0530 Subject: [PATCH 2/2] Update webhook.ts --- functions/src/payments/phonepe/webhook.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/src/payments/phonepe/webhook.ts b/functions/src/payments/phonepe/webhook.ts index 1694817..90a0a43 100644 --- a/functions/src/payments/phonepe/webhook.ts +++ b/functions/src/payments/phonepe/webhook.ts @@ -105,7 +105,15 @@ export const phonePeWebhook = onRequest({ logger.info(`Updated order status via webhook for orderId: ${payload.orderId} to ${payload.state}`); } - if (payload.state === 'COMPLETED') { + logger.info(`Checking payment state`, { + state: payload.state, + stateType: typeof payload.state, + stateLength: payload.state ? payload.state.length : 0, + stateUpperCase: payload.state ? payload.state.toUpperCase() : null, + stateComparison: payload.state === 'COMPLETED' + }); + + if (payload.state && payload.state.trim().toUpperCase() === 'COMPLETED') { try { logger.info(`Starting payment update process for merchantOrderId: ${payload.merchantOrderId}`); -- 2.43.0