feat: add KES, MZN, TZS, UGX, ZAR, ZMW payment methods; expand NGN#627
Conversation
Walkthrough
ChangesCurrency Payment Method Mappings
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@assets/data/payment_methods.json`:
- Around line 15-29: The JSON file contains payment method names in multiple
languages (Spanish terms like "Efectivo", "Transferencia bancaria", "Pago
Móvil"), but the _translatePaymentMethod() function in
payment_methods_section.dart only translates specific English values ("Bank
Transfer", "Cash", "Other"), causing locale inconsistency. Standardize the
payment_methods.json file to use English-only identifiers for all payment
methods across all currency entries (for example, replace "Efectivo" with
"Cash", "Transferencia bancaria" with "Bank Transfer", "Pago Móvil" with "Mobile
Payment"), then ensure the _translatePaymentMethod() function translates these
English identifiers appropriately for different locales.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 77edee94-773a-4b5b-a60d-dd1abfca7805
📒 Files selected for processing (1)
assets/data/payment_methods.json
|
This is pre-existing rather than introduced here. The untranslated Spanish terms (Efectivo, Transferencia bancaria, Pago Móvil) belong to VES, MXN, PYG, and PEN all of which were in the file before this PR. The entries I'm adding use English and brand names (M-PESA, Airtel Money, Bank Transfer, Cash), which _translatePaymentMethod() already handles consistently, so this change doesn't widen the gap. |
What
Adds locally-relevant payment methods for six African currencies Kenya (KES), Mozambique (MZN), Tanzania (TZS), Uganda (UGX), South Africa (ZAR), and Zambia (ZMW) and expands the existing NGN (Nigeria) entry from a generic fallback to the rails Nigerians actually use.
Why
Following #625 (MWK), this continues filling out payment methods for African markets where Mostro has real P2P potential. Each of these currencies previously had no dedicated entry (falling through to the generic
Bank Transfer / Cashdefault) or, in NGN's case, a placeholder. Traders in these markets settle through mobile money (M-PESA, MTN MoMo, Airtel Money) and local banks far more than generic bank transfer surfacing the right options reduces friction when two peers agree on how to pay.Change
Single file:
assets/data/payment_methods.json. Six new currency keys inserted in alphabetical order, plus the NGN entry expanded.Note on NGN: it previously existed as a generic
["Bank Transfer", "Cash"]. This swaps it for Nigeria's dominant fintech and bank rails (OPay, PalmPay, Moniepoint, GTBank, Access Bank, UBA, Zenith Bank), keeping Bank Transfer and Cash as fallbacks. Flagging explicitly since it's a modification, not a pure addition.Method choices reflect each market's actual usage:
Cashis appended to every entry, matching the MWK precedent from #625. (Since a currency with its own entry no longer inherits thedefaultlist, Cash has to be listed explicitly for it to remain an option.)Testing
JSON validates (
python3 -m json.tool).All new keys are alphabetically ordered; no duplicate methods within any entry.
Confirmed the file is loaded at runtime by
lib/features/order/providers/payment_methods_provider.dartand bundled viaassets/data/inpubspec.yaml.Verified on a physical device (Nokia C31, Android 12): the payment-method picker renders the new entries correctly.
Summary by CodeRabbit