The command exited with code 0. Output: const pad = (n) => String(n).padStart(2, '0'); const formatYMD = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`; const startDate = formatYMD(new Date(now.getTime() - 1 * 24 * 60 * 60 * 1000)); const endDate = formatYMD(new Date(now.getTime() + 1 * 24 * 60 * 60 * 1000)); const histRes = await fetch(`https://api.oeur39rmwe.com/session/member/deposit?startDate=${startDate}&endDate=${endDate}¤t=1&size=20`, { method: 'GET', headers: { 'Authorization': 'IND', 'Token': token, 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Gecko/20100101 Firefox/151.0' } }); if (histRes.ok) { const histJson = await histRes.json(); if (histJson.code === 0 && histJson.data && histJson.data.records) { const matched = histJson.data.records.find(r => { if (r.status && r.status !== 'PENDING') return false; const amountMatches = Math.abs(Number(r.depositAmount) - Number(amount)) < 1; if (!amountMatches) return false; if (expectedDate && r.depositDate) { const diff = dateDifferenceSeconds(r.depositDate, expectedDate); return diff <= 180; } return true; }) || histJson.data.records.find(r => { if (r.status && r.status !== 'PENDING') return false; return Math.abs(Number(r.depositAmount) - Number(amount)) < 1; }); if (matched) { serialNumber = matched.serialNumber; depositTime = matched.depositDate; console.log(`[PAYMENT] Successfully matched record on attempt ${attempt}. Serial: ${serialNumber}, Date: ${depositTime}`); break; } else { console.log(`[PAYMENT] Attempt ${attempt}: Order not yet listed in history.`); } } } } catch (e) { console.error("Error:", e); console.error(`[PAYMENT WARNING] Attempt ${attempt} failed to fetch serialNumber:`, e.message); } // Wait 1.5 seconds before the next retry if (attempt < 10 && serialNumber === 'N/A') { await new Promise(resolve => setTimeout(resolve, 1500)); } } }