The following changes were made by the replace_file_content tool to: /root/aadharbot/index.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -4029,6 +4029,9 @@ loadMsg = await ctx.reply(`⏳ Generating secure payment QR for ₹${amount}... Please wait.`, { parse_mode: 'HTML' }); } + let requestUrl = null; + let gatewayHost = null; + try { // Step 0: Get the current balance BEFORE transaction to detect increase let oldBalance = 0; @@ -4080,9 +4080,11 @@ throw new Error(errorMsg); } - const requestUrl = submitJson.data.result.requestUrl; + requestUrl = submitJson.data.result.requestUrl; console.log(`[PAYMENT] Processing checkout URL: ${requestUrl}`); + const qrResult = await gateways.generateQR(requestUrl, amount); + gatewayHost = qrResult.gatewayHost; const { qrBuffer, orderId, @@ -4099,9 +4099,8 @@ isPlayBridge, isBifrostPay, tenantId, - gatewayHost, gatewayApiUrl - } = await gateways.generateQR(requestUrl, amount); + } = qrResult; // Fetch serial number and exact time from deposit history with retries let serialNumber = 'N/A'; [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.