Skip to content

Refactor mobile money channel resolution and inject provider per tran…#121

Merged
Peter-John-paystack merged 1 commit into
mainfrom
feature/Refactor-mobile-money-channel-resolution
May 20, 2026
Merged

Refactor mobile money channel resolution and inject provider per tran…#121
Peter-John-paystack merged 1 commit into
mainfrom
feature/Refactor-mobile-money-channel-resolution

Conversation

@Peter-John-paystack
Copy link
Copy Markdown
Collaborator

…saction

Replaces the implicit MPesa-only assumption with an explicit SupportedChannel
model and a configurable provider allowlist on ChargeViewModel. The selected
MobileMoneyChannel is now threaded through ChargePaymentType, MPesaChargeView,
and MPesaChrageViewModel so the charge request uses the chosen provider's key
instead of always picking the first channelOption.

  • Adds Sources/PaystackUI/Charge/Models/SupportedChannel.swift with id, title, and image per channel (card + per-provider mobile money).
  • Renames verifyAccessCodeAndProceedWithCard -> verifyAccessCodeAndProceed and splits it into resolveSupportedChannels / nextState helpers; auto-routes single-channel cases and falls back to channel selection otherwise.
  • Drops the SupportedChannels enum / PaymentChannel wrapper in ChannelSelectionView in favour of iterating SupportedChannel directly.
  • Adds resolver coverage in ChargeViewModelTests (allowlist filtering, auto-route, channel selection, transactionDetails regression guard) and updates MPesaChrageViewModelTests to verify the injected provider key is forwarded to the repository.

…saction

  Replaces the implicit MPesa-only assumption with an explicit SupportedChannel
  model and a configurable provider allowlist on ChargeViewModel. The selected
  MobileMoneyChannel is now threaded through ChargePaymentType, MPesaChargeView,
  and MPesaChrageViewModel so the charge request uses the chosen provider's key
  instead of always picking the first channelOption.

  - Adds Sources/PaystackUI/Charge/Models/SupportedChannel.swift with id, title,
    and image per channel (card + per-provider mobile money).
  - Renames verifyAccessCodeAndProceedWithCard -> verifyAccessCodeAndProceed and
    splits it into resolveSupportedChannels / nextState helpers; auto-routes
    single-channel cases and falls back to channel selection otherwise.
  - Drops the SupportedChannels enum / PaymentChannel wrapper in
    ChannelSelectionView in favour of iterating SupportedChannel directly.
  - Adds resolver coverage in ChargeViewModelTests (allowlist filtering,
    auto-route, channel selection, transactionDetails regression guard) and
    updates MPesaChrageViewModelTests to verify the injected provider key is
    forwarded to the repository.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@Peter-John-paystack Peter-John-paystack marked this pull request as ready for review May 19, 2026 13:16
@Peter-John-paystack Peter-John-paystack merged commit f15aa92 into main May 20, 2026
4 of 6 checks passed
@Peter-John-paystack Peter-John-paystack deleted the feature/Refactor-mobile-money-channel-resolution branch May 20, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants