Skip to content

feat: expand payment channel coverage to additional markets and currencies #20

Description

@isaacknjama

Problem

The registry currently covers three markets — Kenya (KES), Malawi (MWK), and South Africa (ZAR) — each added market-by-market with its own mobile money, bank, and cash channels (src/channels/ke, src/channels/mw, src/channels/za). CurrencyCode and CountryCode in core.ts are typed as open Uppercase<string>, so nothing in the type system or registry stops a market from being added, but every additional currency still requires hand-authoring channel schemas from scratch. Consumers outside these three markets currently have no built-in channels at all.

Goal

Extend the built-in registry so it is not limited to KES, MWK, and ZAR — add payment channel schemas for the remaining currencies/markets the package is meant to serve, following the existing per-country structure and reusable composition helpers (src/channels/shared.ts, e.g. createCashPaymentChannel).

Proposed approach

  • Identify the target list of markets/currencies to add (e.g. additional African markets, or a specific set requested by consuming applications — needs confirmation/prioritization).
  • For each new market, add a src/channels/<country>/ directory following the existing pattern: one file per network/channel variant, plus a shared cash channel via createCashPaymentChannel.
  • Reuse src/channels/shared.ts composition helpers where field shapes overlap (phone fields, bank account fields, masking/normalization kinds) instead of duplicating definitions per country.
  • Add any new NormalizationKind values required for market-specific phone/account formats (mirroring E164KenyaPhone / E164MalawiPhone).
  • Register each new schema's stable ID using the existing <network>_<variant?>_<country>_<currency> convention.
  • Update README.md's market inventory/examples and src/index.ts exports as new channels are added.

Acceptance criteria

  • Agreed list of new markets/currencies to add is documented on this issue.
  • Each new market has at least one channel schema (mobile money, bank, or card as applicable) plus a cash channel.
  • New schemas pass existing validation/normalization test coverage patterns (see test/).
  • README.md and any generated registry docs reflect the added currencies.
  • No breaking changes to existing KE/MW/ZA channel IDs or schema versions.

Out of scope

  • Introducing a canonical ISO 4217 currency enum/constant list (tracked separately if needed).
  • Provider integrations, compliance, or settlement logic — this package only defines declarative schemas.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions