Fix LemFi EUR to NGN rate integration
CI and Deploy / Build site (push) Successful in 21s
CI and Deploy / Build and push image (push) Successful in 40s
CI and Deploy / Deploy to Kubernetes (push) Successful in 12s

This commit is contained in:
Jesse Egbosionu
2026-10-24 23:36:39 +02:00
parent 9ec94a305b
commit 80741aa0f7
4 changed files with 96 additions and 33 deletions
+11 -32
View File
@@ -1,4 +1,4 @@
import { log } from "console";
import { fetchLemfiRate } from "../../../utils/lemfi.js";
const COMMON_HEADERS = {
'accept': '*/*',
@@ -194,40 +194,19 @@ export default async (req, res) => {
});
const lemfiCall = new Promise((resolve, reject) => {
fetch("https://lemfi.com/api/lemonade/v2/exchange", {
headers: {
accept: "application/json",
"accept-language": "en-GB,en;q=0.9,nl-NL;q=0.8,nl;q=0.7,en-US;q=0.6",
"content-type": "application/json",
priority: "u=1, i",
"sec-ch-ua": '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"macOS"',
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
referrer: "https://lemfi.com/",
referrerPolicy: "origin",
body: '{"from":"EUR","to":"NGN"}',
method: "POST",
mode: "cors",
credentials: "include"
}).then((response) => resolve(response.json()))
.catch((error) => reject(error));
}).then((result) => {
return {
rate: 0,
provider: "Lemfi(referal code - OBIN6518)",
const lemfiHref = "https://lemfi.com/en-gb/international-money-transfer";
const lemfiProvider = "LemFi (referral code - OBIN6518)";
const lemfiCall = fetchLemfiRate()
.then((rate) => ({
rate: rate.toFixed(2),
provider: lemfiProvider,
bestRate: false,
href: "https://lemfi.com",
href: lemfiHref,
logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMYTBiPB_joupdSSoBL1fA0wySDPcMpY92XQ&s"
};
})
}))
.catch((error) => {
console.error("Error calling Lemfi:", error);
return createDefaultErrorResponse("Lemfi(referal code - OBIN6518)", "https://lemfi.com");
console.error("Error calling LemFi:", error);
return createDefaultErrorResponse(lemfiProvider, lemfiHref);
});
const afriexCall = new Promise((resolve, reject) => {