chore: fix tap tap

This commit is contained in:
Jesse Egbosionu
2024-12-21 19:54:07 +01:00
parent 53ea2721d6
commit bd6d3119ae
+14 -5
View File
@@ -40,14 +40,23 @@ export default async (req, res) => {
)
.then((response) => response.json())
.then((result) => {
const fxRate = result.availableCountries[1].corridors.find(
(corridors) => {
return corridors.countryDisplayName == "Nigeria"
}
const nlRates = result.availableCountries.find((availableCountry) => {
return availableCountry.isoCountryCode == "NL"
}
);
let fxRate = 0
if (nlRates) {
for (let corrridor of nlRates.corridors) {
if (corrridor["isoCountryCode"] === "NG") {
fxRate = corrridor["fxRate"]
break
};
}
}
return {
rate: fxRate["fxRate"],
rate: fxRate,
provider: "TapTap",
bestRate: false,
href: "https://www.taptapsend.com/",