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((response) => response.json())
.then((result) => { .then((result) => {
const fxRate = result.availableCountries[1].corridors.find( const nlRates = result.availableCountries.find((availableCountry) => {
(corridors) => { return availableCountry.isoCountryCode == "NL"
return corridors.countryDisplayName == "Nigeria" }
}
); );
let fxRate = 0
if (nlRates) {
for (let corrridor of nlRates.corridors) {
if (corrridor["isoCountryCode"] === "NG") {
fxRate = corrridor["fxRate"]
break
};
}
}
return { return {
rate: fxRate["fxRate"], rate: fxRate,
provider: "TapTap", provider: "TapTap",
bestRate: false, bestRate: false,
href: "https://www.taptapsend.com/", href: "https://www.taptapsend.com/",