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/5] 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/5] 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 From 4ce107c4aff6b1c0bd81fd813055ac370350b9e9 Mon Sep 17 00:00:00 2001 From: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Date: Tue, 20 May 2025 16:16:18 +0530 Subject: [PATCH 3/5] Update index.ts --- functions/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/src/index.ts b/functions/src/index.ts index 19fa4e0..8bc48e9 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -6,3 +6,6 @@ export { processNotificationOnCreate } from './notifications'; export * from './payments'; export { getPlaceDetails, getPlacesAutocomplete } from './places'; export { registerClient } from './clientRegistration'; +import { setGlobalOptions } from "firebase-functions/v2"; + +setGlobalOptions({ timeoutSeconds: 300 }); \ No newline at end of file -- 2.43.0 From 66a65aed386efe885680bf7a0269196b6fee0743 Mon Sep 17 00:00:00 2001 From: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Date: Tue, 20 May 2025 16:16:21 +0530 Subject: [PATCH 4/5] Update firebase.json --- firebase.json | 1 - 1 file changed, 1 deletion(-) diff --git a/firebase.json b/firebase.json index 6920866..dfc4226 100644 --- a/firebase.json +++ b/firebase.json @@ -7,7 +7,6 @@ { "source": "functions", "codebase": "default", - "timeoutSeconds": 360, "ignore": [ "node_modules", ".git", -- 2.43.0 From 5d138e5937160633fd5702f18445f10367ec595e Mon Sep 17 00:00:00 2001 From: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Date: Tue, 20 May 2025 16:21:38 +0530 Subject: [PATCH 5/5] Update index.ts --- functions/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/index.ts b/functions/src/index.ts index 8bc48e9..57a12f6 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -8,4 +8,4 @@ export { getPlaceDetails, getPlacesAutocomplete } from './places'; export { registerClient } from './clientRegistration'; import { setGlobalOptions } from "firebase-functions/v2"; -setGlobalOptions({ timeoutSeconds: 300 }); \ No newline at end of file +setGlobalOptions({ timeoutSeconds: 400 }); \ No newline at end of file -- 2.43.0