Add DisplayAudience config to tailor payment UI for merchant-facing devices - #136
Draft
peter-paystack wants to merge 2 commits into
Draft
peter-paystack wants to merge 2 commits into
peter-paystack wants to merge 2 commits into
Conversation
…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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Introduce a public
DisplayAudiencetype (.customerFacingdefault,.merchantFacing) set viaPaystackBuilder.setDisplayAudience(_:)andcarried on
PaystackConfig. PaystackUI injects it into the SwiftUIenvironment from both
chargeUIButtonandpresentChargeUI.AudienceGatedElement/AudienceCopywith a.visible(for:)modifier and
DisplayAudience.text(_:)so views gate elements andcopy by audience, with unknown audiences falling back to customer-facing
when merchant-facing, with matching instruction copy; replaces the
ZapViewModel.showsOpenZapButtonstatic flag