Skip to content

Add structured Card fields to PaymentMethodPreview#12014

Merged
cttsai-stripe merged 1 commit intomasterfrom
cttsai/add-card-fields-to-payment-method-preview
Nov 18, 2025
Merged

Add structured Card fields to PaymentMethodPreview#12014
cttsai-stripe merged 1 commit intomasterfrom
cttsai/add-card-fields-to-payment-method-preview

Conversation

@cttsai-stripe
Copy link
Contributor

Summary

MOBILESDK-4217
Adds structured Card field to ConfirmationToken.PaymentMethodPreview with detailed card information including brand, country, expiry, funding type, last4, and more.

Motivation

This enables merchants to provide soft warnings during payment input rather than hard errors after submission. A common use case is detecting credit vs debit cards early - merchants who only accept debit cards can now show a gentle "the card you entered might not be a debit card" message while the customer is still typing, rather than failing after they've completed the entire flow. This significantly reduces user dropoff at a common friction point. See the slack thread for more context.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

  • [Added] ConfirmationToken.PaymentMethodPreview now includes structured Card field with detailed card information (brand, country, expiry, funding, last4, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Committed-By-Agent: claude
@cttsai-stripe cttsai-stripe force-pushed the cttsai/add-card-fields-to-payment-method-preview branch from 2d666d8 to 99dc355 Compare November 18, 2025 00:55
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │           compressed           │         uncompressed         
          ├───────────┬───────────┬────────┼──────────┬──────────┬────────
 APK      │ old       │ new       │ diff   │ old      │ new      │ diff   
──────────┼───────────┼───────────┼────────┼──────────┼──────────┼────────
      dex │   4.6 MiB │   4.6 MiB │ +209 B │ 10.2 MiB │ 10.2 MiB │ +536 B 
     arsc │   2.7 MiB │   2.7 MiB │    0 B │  2.7 MiB │  2.7 MiB │    0 B 
 manifest │   5.5 KiB │   5.5 KiB │    0 B │ 29.2 KiB │ 29.2 KiB │    0 B 
      res │ 928.5 KiB │ 928.5 KiB │    0 B │  1.5 MiB │  1.5 MiB │    0 B 
   native │ 949.9 KiB │ 949.9 KiB │    0 B │  2.5 MiB │  2.5 MiB │    0 B 
    asset │  23.5 KiB │  23.5 KiB │    0 B │ 43.7 KiB │ 43.7 KiB │   -2 B 
    other │ 193.9 KiB │ 193.9 KiB │   +3 B │  366 KiB │  366 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼──────────┼──────────┼────────
    total │   9.4 MiB │   9.4 MiB │ +212 B │ 17.3 MiB │ 17.3 MiB │ +534 B 

         │         raw          │            unique            
         ├───────┬───────┬──────┼───────┬───────┬──────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff         
─────────┼───────┼───────┼──────┼───────┼───────┼──────────────
   files │     2 │     2 │    0 │       │       │              
 strings │ 50759 │ 50768 │   +9 │ 47934 │ 47934 │  0 (+1 -1)   
   types │ 18286 │ 18293 │   +7 │ 16937 │ 16937 │  0 (+0 -0)   
 classes │ 14295 │ 14295 │    0 │ 14295 │ 14295 │  0 (+0 -0)   
 methods │ 71447 │ 71451 │   +4 │ 69502 │ 69503 │ +1 (+23 -22) 
  fields │ 47637 │ 47642 │   +5 │ 46640 │ 46641 │ +1 (+4 -3)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6245 │ 6245 │  0
APK
     compressed     │     uncompressed     │                                       
───────────┬────────┼───────────┬──────────┤                                       
 size      │ diff   │ size      │ diff     │ path                                  
───────────┼────────┼───────────┼──────────┼───────────────────────────────────────
 288.9 KiB │ +558 B │ 695.5 KiB │ +1.1 KiB │ ∆ classes2.dex                        
   4.3 MiB │ -349 B │   9.5 MiB │   -604 B │ ∆ classes.dex                         
   7.4 KiB │   -4 B │   7.3 KiB │     -4 B │ ∆ assets/dexopt/baseline.prof         
  53.6 KiB │   +4 B │ 118.6 KiB │      0 B │ ∆ META-INF/CERT.SF                    
   1.1 KiB │   +2 B │     968 B │     +2 B │ ∆ assets/dexopt/baseline.profm        
     241 B │   +2 B │     101 B │      0 B │ ∆ assets/sentry-debug-meta.properties 
  50.4 KiB │   -1 B │ 118.5 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                
───────────┼────────┼───────────┼──────────┼───────────────────────────────────────
   4.7 MiB │ +212 B │  10.5 MiB │   +534 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   47934 │ 47934 │ 0 (+1 -1) 
  
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"e2c3fec","r8-mode":"full","version":"8.8.34"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"954a68b","r8-mode":"full","version":"8.8.34"}
  

METHODS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   69502 │ 69503 │ +1 (+23 -22) 
  
  + Q8.h L(JSONObject) → t2
  + Q8.h M(Q0) → P0
  + Q8.h N(Typeface, A, Context) → Typeface
  + Q8.h O(E, u, t, List) → h
  + Q8.h P(c, String, boolean) → boolean
  + Q8.h Q(ViewGroup, boolean)
  + Q8.h R(Map, String, boolean, l2, m) → X2
  + Q8.h S(String, Object[]) → String
  + T.D T(D, int) → int
  + T.D U()
  + T.D V(i, M0, v)
  + T.D X() → boolean
  + T.D Y() → C
  + T.D a0(C)
  + Z6.s <init>(l2, p2, t2, String, z2, String)
  + kotlin.ranges.a U(float, float) → float
  + kotlin.ranges.a V(double, double, double) → double
  + kotlin.ranges.a W(float, float, float) → float
  + kotlin.ranges.a X(int, int, int) → int
  + kotlin.ranges.a Y(long, long, long) → long
  + kotlin.ranges.a Z(Float, ClosedFloatingPointRange) → Comparable
  + kotlin.ranges.a a0(IntRange) → IntProgression
  + kotlin.ranges.a b0(int, int) → IntRange
  
  - Q8.h L(Q0) → P0
  - Q8.h M(Typeface, A, Context) → Typeface
  - Q8.h N(E, u, t, List) → h
  - Q8.h O(c, String, boolean) → boolean
  - Q8.h P(ViewGroup, boolean)
  - Q8.h Q(Map, String, boolean, l2, m) → X2
  - Q8.h R(String, Object[]) → String
  - T.D S(D, int) → int
  - T.D T()
  - T.D U(i, M0, v)
  - T.D V() → boolean
  - T.D X() → C
  - T.D Y(C)
  - Z6.s <init>(l2, p2, String, z2, String)
  - kotlin.ranges.a S(float, float) → float
  - kotlin.ranges.a U(double, double, double) → double
  - kotlin.ranges.a V(float, float, float) → float
  - kotlin.ranges.a W(int, int, int) → int
  - kotlin.ranges.a X(long, long, long) → long
  - kotlin.ranges.a Y(Float, ClosedFloatingPointRange) → Comparable
  - kotlin.ranges.a Z(IntRange) → IntProgression
  - kotlin.ranges.a a0(int, int) → IntRange
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   46640 │ 46641 │ +1 (+4 -3) 
  
  + Z6.s m: t2
  + Z6.s n: String
  + Z6.s o: z2
  + Z6.s p: String
  
  - Z6.s m: String
  - Z6.s n: z2
  - Z6.s o: String

@cttsai-stripe cttsai-stripe marked this pull request as ready for review November 18, 2025 18:35
@cttsai-stripe cttsai-stripe requested review from a team as code owners November 18, 2025 18:35
@cttsai-stripe cttsai-stripe merged commit 4277774 into master Nov 18, 2025
22 checks passed
@cttsai-stripe cttsai-stripe deleted the cttsai/add-card-fields-to-payment-method-preview branch November 18, 2025 20:00
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.

2 participants