Repository navigation
feat: report how an Apple Wallet add finished - #133
Conversation
A pass waiting on verification, a cancel, and a decline Wallet already explained now come back as a result instead of one rejection.
|
@JakubKorytko for a look when you have a minute. Requesting a review from the fork returns a permissions error, so this comment is the ping. |
JakubKorytko
left a comment
There was a problem hiding this comment.
a few things on the result shape and status values + conflicts
The outcome comes back on the resolved value, including a decline Wallet already explained, instead of a second callback.
|
@JakubKorytko merged current |
|
@JakubKorytko merged current |
|
@Brunonascdev main again :/ |
|
@JakubKorytko merged current |
|
@JakubKorytko merged current |
|
@Brunonascdev thanks! One last thing: since the return type changes and a decline/cancel no longer rejects, could you set the version in package.json to 0.3.0-0? The publish workflow bumps patch, so it ships as 0.3.0 and ^0.2 users don't pick up the breaking change automatically. Same approach as the UAPP change. |
|
@JakubKorytko set the version to |
Details
addCardToAppleWalletused to treat every finish the same. A successful add, a cancel after the issuer step, and a Wallet decline all collapsed, and a decline rejected with "Could not add card" even when Wallet had already shown its own message.didFinishAddingnow resolves a dictionary instead of rejecting those cases. The promise resolvesIOSAddCardResult:statusissuccess,canceled, orerroractivationState(requireActivation,active, and the otherCardStatusvalues) when PassKit reports a known state. An unknown state is left out, so the add still resolvessuccessPKAddPaymentPassError.userCancelled) resolvescancelederrorand includeserrorDomainanderrorCodestatususesOperationResultraw values, including a newdeclined = -1case, andgetTokenizationStatusmaps them. Try again is unchanged: a response that still has a nonce calls the issuer callback again.This is a breaking change. Callers read
result.statusinstead of aTokenizationStatus. A decline resolves{ status: 'error', errorDomain, errorCode }instead of rejecting. A cancel after the issuer step resolves{ status: 'canceled' }instead of rejecting. An error thrown by the issuer callback still rejects.The existing bridge already forwards that dictionary, so
RNWallet.mmand the Android stubs are unchanged.Related Issues
No existing issue. The end states showed up while adding a card from an app that is on TestFlight.
Manual Tests
This repo has no automated tests. Typecheck and lint pass. The example app builds for the iOS simulator with the new architecture.
{ status: 'success', activationState: 'requireActivation' }.{ status: 'canceled' }.{ status: 'error', errorDomain, errorCode }, and there is no second error.Linked PRs
Merged current
main, which includes #91, #96, #132, and #134. The issuer-error path still closes the sheet.