Skip to content

A self-hosted UPI & COD payment gateway with zero per-transaction platform fees, universal JavaScript checkout integration, dynamic QR payments, WhatsApp OTP authentication, and automated payment verification.

JavaScript

fix(common): honor the local Gmail observer callback port

generaltony0074b43362fede8
diff --git a/packages/common/src/runtime-config.js b/packages/common/src/runtime-config.js
index e0f37f8..9c1da80 100644
--- a/packages/common/src/runtime-config.js
+++ b/packages/common/src/runtime-config.js
@@ -239,7 +239,11 @@ export function resolvePairingUrl(options = {}) {
export function resolveGmailRedirectUri(branding = {}) {
if (process.env.GMAIL_REDIRECT_URI) return process.env.GMAIL_REDIRECT_URI;
try {
- return `${resolveRuntimeUrls(branding || {}).gmailUrl}/oauth/callback`;
+ const urls = resolveRuntimeUrls(branding || {});
+ const gmailUrl = urls.isProduction
+ ? urls.gmailUrl
+ : `http://localhost:${process.env.GMAIL_OBSERVER_PORT || 6003}`;
+ return `${gmailUrl}/oauth/callback`;
} catch {
return `http://localhost:${process.env.GMAIL_OBSERVER_PORT || 6003}/oauth/callback`;
}