Repository navigation
fix(ios): label the Apple Pay total with the merchant name - #34
Open
jkasprzyk17 wants to merge 1 commit into
Open
jkasprzyk17 wants to merge 1 commit into
jkasprzyk17 wants to merge 1 commit into
Conversation
PassKit shows the last summary item as the grand total ("Pay <label>").
A one-item cart sent that item as the total ("Pay Coffee"), and a cart
with several items and no merchantName read "Pay Total".
Always append a total item, labelled with merchantName, falling back to
CFBundleDisplayName, then CFBundleName, so the sheet never reads
"Pay Total" or "Pay <item>".
Document merchantName for both platforms and set it in every example.
Closes #19
This branch has not been deployed
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.
Summary
merchantName, also for a one-item cart. Before, a single item became the total ("Pay Coffee"), and a cart with several items and nomerchantNameread "Pay Total".merchantNameis missing or blank, the total uses the app's display name (CFBundleDisplayName, thenCFBundleName). No configuration produces "Pay Total" or "Pay " anymore.merchantNameJSDoc (it is not "primarily Google Pay"), document the total line, and setmerchantNamein every README/docs/example snippet. Examples that passed a "Total" item now pass a real line item.Test plan
cd package && bun run typecheck(pass)cd package && bun run lint(pass; changed files also pass--max-warnings 0)cd package && bun run test(7 suites, 89 tests pass)cd package && npx nitrogen(no diff)bun run docs:build(pass)cd example && npx expo prebuild && xcodebuildfor the iOS simulator (pass), then checked the Apple Pay sheet on an iPhone 17 Pro simulator (iOS 26.5):merchantName: button "Pay React Native Pay Demo, 19,99 US$"; summary "Custom Item 19,99", then the totalmerchantName: button "Pay example, 5,49 US$" (app display name); summary Coffee 4,99, Tax 0,50, then the total 5,49cd example && bunx expo run:android(not run: no Kotlin changes)Risk
merchantNamestays optional.Notes
pendingitem gets a.pendingtotal. On iOS, Apple Pay then hides the total amount and shows "Amount Pending" instead of "Pay " (checked on the simulator). Google Pay'sESTIMATEDstill shows the amount.Closes #19
Need help on this PR? Tag
@codesmith-botwith what you need.