chore: fix tap tap
This commit is contained in:
+13
-4
@@ -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/",
|
||||||
|
|||||||
Reference in New Issue
Block a user