Skip to content

fix: surface card network on Apple Pay and Google Pay results#67

Merged
arstiefel merged 1 commit intomainfrom
surface-card-network
Apr 28, 2026
Merged

fix: surface card network on Apple Pay and Google Pay results#67
arstiefel merged 1 commit intomainfrom
surface-card-network

Conversation

@arstiefel
Copy link
Copy Markdown
Collaborator

Description

The @boltpay/tokenizer /token/applepay and /token/googlepay responses include a network field (e.g. visa, mastercard), but the SDK was dropping it on the floor when constructing ApplePayResult / GooglePayResult. This change wires it through so merchants can read result.network from the wallet onComplete callback.

Testing

  • TypeScript typecheck (npx tsc --noEmit) passes.
  • Affected paths: native-mode Apple Pay (src/payments/ApplePay.tsx) and Google Pay (src/payments/GoogleWallet.tsx) tokenization callbacks. WebView mode is unaffected (it never went through the tokenizer-response shape).
  • Manual verification recommended in the example app: trigger a successful Apple Pay and Google Pay flow and confirm result.network is populated on onComplete.

Security Review

Important

A security review is required for every PR in this repository to comply with PCI requirements.

  • I have considered and reviewed security implications of this PR and included the summary below.

Security Impact Summary

No security-sensitive changes. The network value (card brand, e.g. visa) is non-PCI metadata already returned by the Bolt tokenizer service and is purely additive on the SDK's public result types. No changes to authentication, authorization, token handling, payment flows, or data transmission.

@arstiefel arstiefel requested review from a team as code owners April 28, 2026 16:14
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io Bot commented Apr 28, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@arstiefel arstiefel force-pushed the surface-card-network branch from 4d261c2 to 865d869 Compare April 28, 2026 16:16
@arstiefel arstiefel merged commit f56d502 into main Apr 28, 2026
9 checks passed
@arstiefel arstiefel deleted the surface-card-network branch April 28, 2026 16:26
Comment thread src/payments/types.ts
Comment on lines 126 to +172
@@ -168,6 +169,7 @@ export interface GooglePayResult {
token: string;
bin?: string;
last4?: string;
network?: string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

 export interface TokenizeApplePayResult {
   token: string;
   expiry: string;
   last4: string;
   bin: string;
   network: CardType;
 }
 
 export interface TokenizeGooglePayResult {
   token: string;
   expiry: string;
   last4: string;
   bin: string;
   network: CardType;
 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these will be available all the time, they won't be undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants