The command exited with code 0. Output: 1001- const uploadJson = await uploadRes.json(); 1002- console.log(`[GATEWAY] Zippay Upload UTR Response:`, JSON.stringify(uploadJson)); 1003- if (uploadJson.code !== 200) { 1004- throw new Error(uploadJson.msg || "Failed to submit UTR to Zippay"); 1005- } 1006- return uploadJson; 1007- } else if (isEwalletPay) { 1008- console.log(`[GATEWAY] Uploading ewallet-pay UTR: ${utr} for order: ${orderId}`); 1009: const uploadRes = await fetch(`${gatewayApiUrl}/v2/uploadUtr?orderId=${orderId}&utr=${utr}`, { 1010- method: 'GET', 1011- headers: { 1012- 'Origin': `https://${gatewayHost}`, 1013- 'Referer': `https://${gatewayHost}/`, 1014- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0' 1015- } 1016- }); 1017- 1018- if (!uploadRes.ok) throw new Error(`Upload UTR API returned HTTP ${uploadRes.status}`); 1019- const uploadJson = await uploadRes.json(); 1020- console.log(`[GATEWAY] ewallet-pay Upload UTR Response:`, JSON.stringify(uploadJson)); 1021- if (uploadJson.code !== 0 || uploadJson.msg !== "success") { 1022- throw new Error(uploadJson.msg || "Failed to submit UTR to ewallet-pay"); 1023- } 1024- return uploadJson; 1025- } else if (isBluePay) { 1026- console.log(`[GATEWAY] Uploading blue-pay UTR via POST: ${utr} for order: ${orderId}`); 1027- let uploadJson = { code: 0, msg: "success" }; 1028- try { 1029- const originHost = gatewayHost.includes('pay.') ? gatewayHost.replace('pay.', 'cashiernew.') : gatewayHost; 1030: const uploadRes = await fetch(`${gatewayApiUrl}/uploadUtr?orderId=${orderId}&utr=${utr}`, { 1031- method: 'POST', 1032- headers: { 1033- 'Content-Type': 'application/json; charset=UTF-8', 1034- 'Origin': `https://${originHost}`, 1035- 'Referer': `https://${originHost}/`, 1036- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0' 1037- }, 1038- body: JSON.stringify({ 1039- orderId: orderId, 1040- utr: utr 1041- }) 1042- }); 1043- if (uploadRes.ok) { 1044- uploadJson = await uploadRes.json(); 1045- console.log(`[GATEWAY] blue-pay UTR upload response:`, JSON.stringify(uploadJson)); 1046- } else { 1047- console.warn(`[GATEWAY] blue-pay UTR upload returned HTTP ${uploadRes.status}`); 1048- } 1049- } catch (e) { 1050- console.error(`[GATEWAY] blue-pay UTR submission failed, continuing:`, e.message); 1051- } 1052- return uploadJson; 1053- } else if (isUpiPayments) { 1054- console.log(`[GATEWAY] Uploading upi-payments.com UTR via POST: ${utr} for order: ${orderId}`); 1055- const uploadRes = await fetch(`${gatewayApiUrl}/trade/cashier/submit/utr?userIdentify=null&utr=${utr}&orderId=${orderId}`, { 1056- method: 'POST', 1057- headers: { 1058- 'Content-Type': 'application/json; charset=UTF-8', 1059- 'Origin': `https://${gatewayHost}`, 1060- 'Referer': `https://${gatewayHost}/?orderId=${orderId}`, 1061- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0' 1062- } 1063- }); 1064- 1065- if (!uploadRes.ok) throw new Error(`Upload UTR API returned HTTP ${uploadRes.status}`); 1066- const uploadJson = await uploadRes.json(); 1067- console.log(`[GATEWAY] upi-payments.com Upload UTR Response:`, JSON.stringify(uploadJson)); 1068- if (!uploadJson.success) throw new Error(uploadJson.message || "Failed to submit UTR to upi-payments.com"); 1069- return uploadJson; 1070- } else if (isPayflow) { 1071- console.log(`[GATEWAY] Uploading Payflow UTR: ${utr} for order: ${orderId}`); 1072- let uploadJson = { code: 0, msg: "success" }; 1073- try { 1074- const uploadRes = await fetch(`https://${gatewayHost}/prod-checkout-api/build/buildSubmit`, { 1075- method: 'POST', 1076- headers: { 1077- 'Content-Type': 'application/json', 1078- 'Origin': `https://${gatewayHost}`, 1079- 'Referer': `https://${gatewayHost}/`, 1080- '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' 1081- }, 1082- body: JSON.stringify({ 1083- paymentNo: String(utr), 1084- orderNo: orderId 1085- }) 1086- }); 1087- if (uploadRes.ok) { 1088- uploadJson = await uploadRes.json(); 1089- console.log(`[GATEWAY] Payflow Upload UTR Response:`, JSON.stringify(uploadJson)); 1090- } else { 1091- console.warn(`[GATEWAY] Payflow Upload UTR returned HTTP ${uploadRes.status}`); 1092- } 1093- } catch (e) { 1094- console.error(`[GATEWAY] Payflow UTR submission failed:`, e.message); 1095- } 1096- return uploadJson; 1097- } else if (isBifrostPay) { 1098- console.log(`[GATEWAY] Uploading BifrostPay UTR: ${utr} for order: ${orderId}`); 1099- let uploadJson = { code: 0, msg: "success" }; 1100- try { 1101- const uploadRes = await fetch(`https://${gatewayHost}/cashier/order/${orderId}/utr`, { 1102- method: 'POST', 1103- headers: { 1104- 'Content-Type': 'application/json', 1105- 'Origin': `https://${gatewayHost}`, 1106- 'Referer': `https://${gatewayHost}/cashier/v3/${orderId}`, 1107- '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' 1108- }, 1109- body: JSON.stringify({ 1110- utr: String(utr).trim() 1111- }) 1112- }); 1113- if (uploadRes.ok) { 1114- uploadJson = await uploadRes.json(); 1115- console.log(`[GATEWAY] BifrostPay Upload UTR Response:`, JSON.stringify(uploadJson)); 1116- } else { 1117- console.warn(`[GATEWAY] BifrostPay Upload UTR returned HTTP ${uploadRes.status}`); 1118- } 1119- } catch (e) { 1120- console.error(`[GATEWAY] BifrostPay UTR submission failed:`, e.message); 1121- } 1122- return uploadJson; 1123- } else { 1124- // Standard GET request 1125- console.log(`[GATEWAY] Uploading UTR: ${utr} for order: ${orderId} to standard gateway: ${gatewayApiUrl}`); 1126: const uploadRes = await fetch(`${gatewayApiUrl}/uploadUtr?orderId=${orderId}&utr=${utr}`, { 1127- method: 'GET', 1128- headers: { 1129- 'Refdomain': 'ind.55ace.com', 1130- 'Origin': `https://${gatewayHost}`, 1131- 'Referer': `https://${gatewayHost}/`, 1132- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0' 1133- } 1134- }); 1135- 1136- if (!uploadRes.ok) throw new Error(`Upload UTR API returned HTTP ${uploadRes.status}`); 1137- const uploadJson = await uploadRes.json(); 1138- console.log(`[GATEWAY] Standard Upload UTR Response:`, JSON.stringify(uploadJson)); 1139- if (uploadJson.code !== 0) throw new Error(uploadJson.msg || "Failed to submit UTR"); 1140- return uploadJson; 1141- } 1142-} 1143- 1144-module.exports = { 1145- generateQR, 1146: uploadUtr 1147-};