feat: ( payments ) convert ETB to method currency before charging

This commit is contained in:
Abubeker Yasin
2026-06-29 11:55:31 +03:00
parent c6e56d1c4f
commit b70e9ea2cd
7 changed files with 100 additions and 65 deletions

View File

@@ -12,11 +12,8 @@ export default registerAs("waafi", () => ({
webhookSecret: process.env.WAAFI_WEBHOOK_SECRET ?? "",
// Wallet payment method (EVC/ZAAD/Sahal) — MWALLET_ACCOUNT requires the payer phone up front.
paymentMethod: process.env.WAAFI_PAYMENT_METHOD ?? "MWALLET_ACCOUNT",
// Waafi has no ETB; when set this overrides the asserted currency (USD/DJF/SLSH).
// TODO(demo): revert to the env-driven line below after the demo. Temporarily FORCED to USD
// here so the .env (WAAFI_CURRENCY) cannot override it.
// currency: process.env.WAAFI_CURRENCY ?? "DJF",
currency: "USD",
// Currency is no longer overridden here — the calling app converts to the method's settlement
// currency and the provider charges that value verbatim.
// Browser redirect targets after the hosted page completes/fails (UX only; webhook is source of truth).
successUrl: process.env.WAAFI_HPP_SUCCESS_URL ?? "",
failureUrl: process.env.WAAFI_HPP_FAILURE_URL ?? "",