The command exited with code 0. Output: 662- } 663- }); 664- 665- if (!orderRes.ok) throw new Error(`BifrostPay API returned HTTP ${orderRes.status}`); 666- const orderJson = await orderRes.json(); 667- 668- if (orderJson.code !== 200 || !orderJson.data || !orderJson.data.deepLink) { 669- throw new Error(orderJson.msg || "Failed to retrieve deepLink from BifrostPay"); 670- } 671- 672- const upiUrl = orderJson.data.deepLink; 673- console.log(`[GATEWAY] BifrostPay detected. Order ID: ${orderId}, UPI: ${upiUrl}`); 674- 675- const QRCode = require('qrcode'); 676: qrBuffer = await QRCode.toBuffer(upiUrl, { type: 'png', width: 400 }); 677- 678- const match = orderId.match(/^PI(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/); 679- if (match) { 680- const [_, yyyy, mm, dd, hh, min, ss] = match; 681- expectedDate = `${yyyy}-${mm}-${dd} ${hh}:${min}:${ss}`; 682- } else { 683- expectedDate = formatDateIST(new Date()); 684- } 685- } else if (isXmdhPay) { 686- console.log(`[GATEWAY] XmdhPay detected (${gatewayHost}). Fetching checkout page...`); 687- orderId = parsedUrl.searchParams.get('orderNo') || parsedUrl.searchParams.get('orderId') || parsedUrl.searchParams.get('param'); 688- 689- const htmlRes = await fetch(requestUrl, { 690- method: 'GET', 691- headers: { 692- 'Origin': `https://${gatewayHost}`, 693- 'Referer': `https://${gatewayHost}/`, 694- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' 695- } 696- }); 697- 698- if (!htmlRes.ok) throw new Error(`XmdhPay checkout page returned HTTP ${htmlRes.status}`); 699- const html = await htmlRes.text(); 700- 701- if (!orderId) { 702- const orderMatch = html.match(/class=["']no["']>([^<]+) m[1]); -- 799: qrBuffer = await QRCode.toBuffer(upiUrl, { type: 'png', width: 400 }); 800- expectedDate = formatDateIST(new Date()); 801- console.log(`[GATEWAY] Fallback resolved UPI from HTML: ${upiUrl}`); 802- htmlHandled = true; 803- } 804- } 805- } catch (checkErr) { 806- console.warn(`[GATEWAY] Fallback HTML pre-check note:`, checkErr.message); 807- } 808- 809- if (!htmlHandled) { 810- if (gatewayHost.startsWith('pay.') && (gatewayHost.includes('xspay') || gatewayHost.includes('55ace') || gatewayHost.includes('vip') || gatewayHost.includes('cc'))) { 811- gatewayApiUrl = `https://${gatewayHost.replace('pay.', 'payapi.')}`; 812- } else if (gatewayHost.startsWith('cashier.')) { 813- gatewayApiUrl = `https://${gatewayHost.replace('cashier.', 'api.')}`; 814- } 815- 816- const payRes = await fetch(`${gatewayApiUrl}/payment?orderId=${orderId}&deviceType=1`, { 817- method: 'GET', 818- headers: { 819- 'Refdomain': 'ind.55ace.com', 820- 'Origin': `https://${gatewayHost}`, 821- 'Referer': `https://${gatewayHost}/`, 822- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' 823- } 824- }); 825- 826- if (!payRes.ok) throw new Error(`Pay API returned HTTP ${payRes.status}`); 827- const payJson = await payRes.json(); 828- 829- if (payJson.code !== 0 || !payJson.imgData) { -- 834: qrBuffer = Buffer.from(base64Data, 'base64'); 835- 836- const match = orderId.match(/^UM(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/); 837- if (match) { 838- const [_, yy, mm, dd, hh, min, ss] = match; 839- expectedDate = `20${yy}-${mm}-${dd} ${hh}:${min}:${ss}`; 840- } 841- } 842- } 843- 844- return { 845- qrBuffer, 846- orderId, 847- nonce, 848- expectedDate, 849- isGoldgo, 850- isRynpp, 851- isKivoPay, 852- isIndiaPay, 853- isEwalletPay, 854- isBluePay, 855- isUpiPayments, 856- isPayflow, 857- isDirectUpi, 858- isHoneycomb, 859- isPlayBridge, 860- isSsbasePay, 861- isCashwaysPay, 862- isBifrostPay, 863- isXmdhPay, 864- isCoinPay,