Summary
The down-payment route fetches a floating USD/NGN rate directly and converts JavaScript numbers inside the payment request, bypassing the repository-backed quote lifecycle and its expiry/audit policies.
Repository evidence
app/api/payments/down-payment/route.ts calls api.exchangerate-api.com directly and returns a number rate.
- The repository already contains
lib/fx/quote-service.ts for explicit quote snapshots and consumption.
Scope
- Require a locked quote ID for cross-currency down payments.
- Use exact minor-unit arithmetic and atomically consume the quote when initializing Paystack.
- Record rate source, timestamp, spread, input/output amounts, and consumer.
Acceptance criteria
Tests
Non-goals
- Changing the supported currency pair or FX provider roster.
Summary
The down-payment route fetches a floating USD/NGN rate directly and converts JavaScript numbers inside the payment request, bypassing the repository-backed quote lifecycle and its expiry/audit policies.
Repository evidence
app/api/payments/down-payment/route.tscallsapi.exchangerate-api.comdirectly and returns anumberrate.lib/fx/quote-service.tsfor explicit quote snapshots and consumption.Scope
Acceptance criteria
Tests
Non-goals