fix(apple-pay): forward card expiry in webview onComplete result - #107
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
higuptabolt
enabled auto-merge (squash)
July 14, 2026 06:24
saravana-bolt
approved these changes
Jul 14, 2026
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.
Description
In webview mode,
ApplePayResult.expirationwas alwaysundefined.ApplePayWebViewmapped the Apple Pay result from the Bolt-hostedadd-card-from-apple-walletiframe'saddCardFromApplePaySuccessmessage. That message'stokenis aTokenizeApplePayResult, whose expiry field is namedexpiry— but the handler readtokenResult?.expiration, which doesn't exist on that payload, so the value silently resolved toundefined.This has been the case since WebView mode shipped (#42) and was carried forward through #63 and #101. Any merchant reading
result.expirationin webview mode has receivedundefined.Changes:
ApplePayWebView.tsx: readtokenResult?.expiry(the actual iframe field) instead oftokenResult?.expiration. The publicApplePayResult.expirationoutput field is unchanged — this only fixes the source field it's populated from.ApplePayandGoogleWalletmappings, which already readtokenResult.expiry.ApplePayWebView.test.tsx: the existing regression test mocked the iframe payload withexpiration, encoding the same wrong field name, so it passed against the bug. Corrected the mock toexpiry(matching the realTokenizeApplePayResultcontract); the assertedonCompleteoutput is unchanged.Testing
yarn lint,yarn typecheck,yarn testall pass (180/180).addCardFromApplePaySuccessmessage poststoken: TokenizeApplePayResultwhose expiry field isexpiry(noexpirationfield exists on it).Security Review
Important
A security review is required for every PR in this repository to comply with PCI requirements.
Security Impact Summary
No security impact. This corrects which field of an existing, already-handled token payload is read to populate the card expiry (MM/YY-style, non-secret) surfaced to the merchant's
onCompletecallback. No change to token handling, storage, transport, data exposure, or PAN/CVV processing.