Skip to content

Add Zap payment method to charge UI flow#127

Merged
Peter-John-paystack merged 3 commits into
mainfrom
feature/Zap-on-SDK-UI
Jun 24, 2026
Merged

Add Zap payment method to charge UI flow#127
Peter-John-paystack merged 3 commits into
mainfrom
feature/Zap-on-SDK-UI

Conversation

@Peter-John-paystack

Copy link
Copy Markdown
Collaborator

Introduce Zap as a new payment channel in the PaystackUI charge flow,
built on the Zap digital bank mandate support added to PaystackCore.

  • Add the Zap flow following the established Views/Viewmodels/Models/
    Repository layout: ZapView, ZapPaymentView, ZapSessionExpiredView,
    ZapViewModel, ZapRepository, and the ZapConfig/ZapDetails/ZapState
    models, plus a QRCodeImage component.
  • Wire Zap into ChargeViewModel: surface it as a SupportedChannel when
    the access code advertises a promoted Zap bank (code "00zap"), and
    route single-channel Zap transactions straight to the payment screen.
  • Extend ChargePaymentType, SupportedChannel, and VerifyAccessCode
    (email + supportedBanks) to carry Zap, and render it from ChargeView.
  • ZapViewModel initiates the mandate, displays the QR/payment URL,
    counts down the 5-minute mandate window to a session-expired state,
    and listens on Pusher for the terminal transaction update.
  • Add zapLogo/zapSingleLogo image assets.
  • Add ZapViewModelTests and MockZapRepository, and extend
    ChargeViewModel/ChargeRepository tests for the Zap channel.

  Introduce the Zap mandate API on the public `Paystack` surface:
  `initiateZapMandate(_:)` initiates a mandate and `listenForZapResponse(onChannel:)`
  subscribes for status updates (reusing the Pay-with-Transfer Pusher response shape).

  - ZapMandateService posts to `bank/digitalbankmandate/{id}/{transactionId}`,
    overriding `baseURL` to `https://standard.paystack.co`
  - Make `baseURL` an overridable PaystackService requirement (defaults to
    api.paystack.co) so services can target a non-default host
  - Add `postForm`/`setFormBody` for application/x-www-form-urlencoded bodies
    with percent-encoded fields
  - Add ZapMandateRequest/ZapMandateResponse and SupportedBank models
  - Decode `supported_banks` from the verify-access-code response

  Tests: Zap initiate/listen, form-body encoding, and supported-banks decoding.
  Introduce Zap as a new payment channel in the PaystackUI charge flow,
  built on the Zap digital bank mandate support added to PaystackCore.

  - Add the Zap flow following the established Views/Viewmodels/Models/
    Repository layout: ZapView, ZapPaymentView, ZapSessionExpiredView,
    ZapViewModel, ZapRepository, and the ZapConfig/ZapDetails/ZapState
    models, plus a QRCodeImage component.
  - Wire Zap into ChargeViewModel: surface it as a SupportedChannel when
    the access code advertises a promoted Zap bank (code "00zap"), and
    route single-channel Zap transactions straight to the payment screen.
  - Extend ChargePaymentType, SupportedChannel, and VerifyAccessCode
    (email + supportedBanks) to carry Zap, and render it from ChargeView.
  - ZapViewModel initiates the mandate, displays the QR/payment URL,
    counts down the 5-minute mandate window to a session-expired state,
    and listens on Pusher for the terminal transaction update.
  - Add zapLogo/zapSingleLogo image assets.
  - Add ZapViewModelTests and MockZapRepository, and extend
    ChargeViewModel/ChargeRepository tests for the Zap channel.
@Peter-John-paystack Peter-John-paystack self-assigned this Jun 23, 2026
@Peter-John-paystack Peter-John-paystack added the enhancement New feature or request label Jun 23, 2026
@Peter-John-paystack Peter-John-paystack marked this pull request as ready for review June 24, 2026 08:42
@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 merged commit 90a1b25 into main Jun 24, 2026
6 of 9 checks passed
@Peter-John-paystack Peter-John-paystack deleted the feature/Zap-on-SDK-UI branch June 24, 2026 12:22
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.

2 participants