Skip to content

Add DisplayAudience config to tailor payment UI for merchant-facing devices - #136

Merged
peter-paystack merged 2 commits into
mainfrom
feature/Add-Display-Audience
Oct 7, 2026
Merged

peter-paystack merged 2 commits into
mainfrom
feature/Add-Display-Audience

Conversation

@peter-paystack

Copy link
Copy Markdown
Collaborator

Introduce a public DisplayAudience type (.customerFacing default,
.merchantFacing) set via PaystackBuilder.setDisplayAudience(_:) and
carried on PaystackConfig. PaystackUI injects it into the SwiftUI
environment from both chargeUIButton and presentChargeUI.

  • Add AudienceGatedElement / AudienceCopy with a .visible(for:)
    modifier and DisplayAudience.text(_:) so views gate elements and
    copy by audience, with unknown audiences falling back to customer-facing
  • Zap: show the "Open Zap" button when customer-facing and the QR code
    when merchant-facing, with matching instruction copy; replaces the
    ZapViewModel.showsOpenZapButton static flag
  • Document the new option in the README
  • Add builder and visibility tests

…evices

  Introduce a public `DisplayAudience` type (`.customerFacing` default,
  `.merchantFacing`) set via `PaystackBuilder.setDisplayAudience(_:)` and
  carried on `PaystackConfig`. PaystackUI injects it into the SwiftUI
  environment from both `chargeUIButton` and `presentChargeUI`.

  - Add `AudienceGatedElement` / `AudienceCopy` with a `.visible(for:)`
    modifier and `DisplayAudience.text(_:)` so views gate elements and
    copy by audience, with unknown audiences falling back to customer-facing
  - Zap: show the "Open Zap" button when customer-facing and the QR code
    when merchant-facing, with matching instruction copy; replaces the
    `ZapViewModel.showsOpenZapButton` static flag
  - Document the new option in the README
  - Add builder and visibility tests
  Xcode 27 only supports deployment targets from iOS 15.0 upward. Update
  the Podfile platform, the post_install override and the Xcode project
  settings. Also normalise Info.plist indentation to tabs.
@peter-paystack peter-paystack self-assigned this Oct 1, 2026
@peter-paystack peter-paystack added the enhancement New feature or request label Oct 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

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

@zaheer-paystack zaheer-paystack left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me, just had one question

Comment thread Sources/PaystackUI/Charge/Zap/Views/ZapPaymentView.swift
@peter-paystack
peter-paystack marked this pull request as ready for review October 7, 2026 06:25
@peter-paystack
peter-paystack merged commit 3629a7f into main Oct 7, 2026
4 of 6 checks passed
@peter-paystack
peter-paystack deleted the feature/Add-Display-Audience branch October 7, 2026 17:41
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