| 101 | if (k === "unionpay") return "UnionPay"; |
| 102 | return k.charAt(0).toUpperCase() + k.slice(1); |
| 103 | } |
| 104 | |
| 105 | async function fetchFromBincheck(bin: string): Promise<Partial<{ scheme: string; bank: string; country: string }>> { |
| 106 | const axios = (await import("axios")).default; |
| 107 | const cheerio = await import("cheerio"); |
| 108 | const bin6 = bin.slice(0, 6); |
| 109 | const url = `https://bincheck.io/details/${bin6}`; |
| 110 | try { |
| 111 | const resp = await axios.get(url, { timeout: 8000 }); |
| 112 | const $ = cheerio.load(resp.data); |
| 113 | const og = $('meta[property="og:description"]').attr('content') || ""; |