mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-01 22:53:26 +00:00
The only currency rule anywhere was CBE_BILL's, spelled out twice — once inside initiateCbeBill and again in the freight API before it calls the payment service. Two copies of one provider's rule, and no check at all for the other seven. initiate-payment.dto accepted any 3-to-8 character string as a currency. Both copies now read PROVIDER_CURRENCIES, and the check sits once in initiate() before any provider opens a session, so it covers all of them. The DTO gets the whitelist it never had. Amount precision follows the same rule. eBirr and D-Money formatted at a fixed 2dp regardless of currency; D-Money would have sent "71088.00" for a DJF order, and DJF has no centimes to send. Both now format at the currency's own precision. CAC Bank already did this and documents it. Waafi is deliberately left alone: its toAmount() truncates rather than rounds, the comment says that is intentional, and changing it would alter an existing money path for a reason unrelated to DJF. Same for the amountMinor major/minor unit disagreement in cbe-birr and card — real, pre-existing, and unreachable from DJF since both are ETB rails.