Skip to content

Conversation

@toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Jan 13, 2026

Summary

Query account ranges when card fund filtering is enabled

This PR adds support for querying card metadata when restrictive card funding filters are configured. When a merchant restricts allowed funding types (e.g., only credit cards, no prepaid), the SDK now queries the account ranges API to fetch card metadata, which includes funding type information needed to properly filter payment methods.

How it's achieved

  • Introduces needsRemoteQueryForFunding property to DefaultCardAccountRangeService that evaluates whether the configured CardFundingFilter rejects any funding types
  • When needsRemoteQueryForFunding returns true, the service queries the remote account ranges API to retrieve card metadata (including funding type)
  • This complements the existing needsRemoteQueryForCbc logic, expanding remote query triggers from just CBC eligibility to include funding filter requirements
  • The funding filter parameter threads through the card input component hierarchy (CardDetailsControllerCardNumberController) to ensure filtering is applied consistently

Motivation

https://docs.google.com/document/d/1eihnXys1Cx3WpSwb5xnj24ysi8_oak2aDR1Zr8eOgrI/edit?tab=t.0#heading=h.cz1xkpga7giy

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

debit_filter_test.mov

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

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.9 MiB │     4.9 MiB │ -15 B │    11 MiB │    11 MiB │ +516 B 
     arsc │     3.6 MiB │     3.6 MiB │   0 B │   3.6 MiB │   3.6 MiB │    0 B 
 manifest │     5.7 KiB │     5.7 KiB │   0 B │  30.2 KiB │  30.2 KiB │    0 B 
      res │ 1,005.4 KiB │ 1,005.4 KiB │   0 B │   1.7 MiB │   1.7 MiB │    0 B 
   native │   949.9 KiB │   949.9 KiB │   0 B │   2.5 MiB │   2.5 MiB │    0 B 
    asset │    26.2 KiB │    26.2 KiB │  +1 B │  46.7 KiB │  46.7 KiB │    0 B 
    other │   205.4 KiB │   205.4 KiB │  +9 B │ 405.7 KiB │ 405.7 KiB │    0 B 
──────────┼─────────────┼─────────────┼───────┼───────────┼───────────┼────────
    total │    10.6 MiB │    10.6 MiB │  -5 B │  19.2 MiB │  19.2 MiB │ +516 B 

         │         raw          │            unique            
         ├───────┬───────┬──────┼───────┬───────┬──────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff         
─────────┼───────┼───────┼──────┼───────┼───────┼──────────────
   files │     2 │     2 │    0 │       │       │              
 strings │ 58655 │ 58656 │   +1 │ 52178 │ 52179 │ +1 (+5 -4)   
   types │ 20672 │ 20671 │   -1 │ 17456 │ 17456 │  0 (+0 -0)   
 classes │ 14687 │ 14687 │    0 │ 14687 │ 14687 │  0 (+0 -0)   
 methods │ 78281 │ 78281 │    0 │ 73310 │ 73310 │  0 (+9 -9)   
  fields │ 51309 │ 51312 │   +3 │ 48972 │ 48976 │ +4 (+33 -29) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  325 │  325 │  0   
 entries │ 6948 │ 6948 │  0
APK
    compressed     │    uncompressed    │                                           
───────────┬───────┼───────────┬────────┤                                           
 size      │ diff  │ size      │ diff   │ path                                      
───────────┼───────┼───────────┼────────┼───────────────────────────────────────────
 811.7 KiB │ -68 B │   1.8 MiB │  +88 B │ ∆ classes2.dex                            
   4.1 MiB │ +53 B │   9.2 MiB │ +428 B │ ∆ classes.dex                             
  54.4 KiB │  +8 B │ 127.3 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
     270 B │  -2 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
   9.9 KiB │  -2 B │   9.7 KiB │   -2 B │ ∆ assets/dexopt/baseline.prof             
   1.2 KiB │  +2 B │     1 KiB │   +2 B │ ∆ assets/dexopt/baseline.profm            
  57.6 KiB │  +2 B │ 127.4 KiB │    0 B │ ∆ META-INF/CERT.SF                        
     241 B │  +1 B │     101 B │    0 B │ ∆ assets/sentry-debug-meta.properties     
   1.2 KiB │  +1 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA                       
───────────┼───────┼───────────┼────────┼───────────────────────────────────────────
     5 MiB │  -5 B │  11.3 MiB │ +516 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   52178 │ 52179 │ +1 (+5 -4) 
  
  + VLLLLLZLLLZLLLZLLZLLL
  + VLLLZLLLL
  + VLLZZZLLLLLLLLLLLZLLLLLLLLLZLZLZLLLLLZ
  + r8-map-id-3edbf4b76c3ee618b66279624ced4423e00a9095b15b65b8a9ee23fba5365ca2
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"3edbf4b76c3ee618b66279624ced4423e00a9095b15b65b8a9ee23fba5365ca2","r8-mode":"full","version":"8.13.17"}
  
  - VLLLLLZLLLZLLZLLZLLL
  - VLLZZZLLLLLLLLLLLZLLLLLLLLZLZLZLLLLLZ
  - r8-map-id-e880f914380ae60086f4b9261a957404010fe780a3b44577719fb0df5690910e
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"e880f914380ae60086f4b9261a957404010fe780a3b44577719fb0df5690910e","r8-mode":"full","version":"8.13.17"}
  

METHODS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   73310 │ 73310 │ 0 (+9 -9) 
  
  + mg.b0 <init>(y9, o1, boolean, boolean, boolean, List, List, c, String, String, l1, b, List, List, List, p, boolean, b3, h0, h4, h0, c, b, a, b, Map, boolean, y4, boolean, o, boolean, k1, String, y, n, f3, boolean)
  + mg.l0 <init>(b, r3, LinkedHashMap, w0, Map, boolean, String, c, o1, boolean, Function1, a, b, boolean, w, b0, boolean, Boolean, a, j1)
  + zb.u <init>(c, CoroutineContext, CoroutineContext, z, a, b, c, c, int)
  + mk.a1 <init>(b, LinkedHashMap, a, boolean, c, a, b, j1)
  + mk.c1 <init>(boolean, a, b)
  + mk.w0 <init>(b, LinkedHashMap, boolean, c, a, b)
  + mk.y0 <init>(j1, b, LinkedHashMap, boolean, c, a, b)
  + mk.y1 <init>(c1, c, CoroutineContext, CoroutineContext, String, t0, a, b)
  + mk.z0 <init>(b, LinkedHashMap, boolean, c, a, b, a)
  
  - mg.b0 <init>(y9, o1, boolean, boolean, boolean, List, List, c, String, String, l1, b, List, List, List, p, boolean, b3, h0, h4, h0, c, b, a, Map, boolean, y4, boolean, o, boolean, k1, String, y, n, f3, boolean)
  - mg.l0 <init>(b, r3, LinkedHashMap, w0, Map, boolean, String, c, o1, boolean, Function1, a, boolean, w, b0, boolean, Boolean, a, j1)
  - zb.u <init>(c, CoroutineContext, CoroutineContext, z, a, c, c, int)
  - mk.a1 <init>(b, LinkedHashMap, a, boolean, c, a, j1)
  - mk.c1 <init>(boolean, a)
  - mk.w0 <init>(b, LinkedHashMap, boolean, c, a)
  - mk.y0 <init>(j1, b, LinkedHashMap, boolean, c, a)
  - mk.y1 <init>(c1, c, CoroutineContext, CoroutineContext, String, t0, a)
  - mk.z0 <init>(b, LinkedHashMap, boolean, c, a, a)
  

FIELDS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   48972 │ 48976 │ +4 (+33 -29) 
  
  + mg.b0 I: b
  + mg.b0 J: Map
  + mg.b0 K: boolean
  + mg.b0 L: y4
  + mg.b0 M: boolean
  + mg.b0 N: o
  + mg.b0 O: boolean
  + mg.b0 P: k1
  + mg.b0 Q: String
  + mg.b0 R: y
  + mg.b0 S: n
  + mg.b0 T: f3
  + mg.b0 U: boolean
  + mg.b0 V: g0
  + mg.b0 W: a0
  + mg.l0 m: b
  + mg.l0 n: boolean
  + mg.l0 o: w
  + mg.l0 p: b0
  + mg.l0 q: boolean
  + mg.l0 r: Boolean
  + mg.l0 s: a
  + mg.l0 t: j1
  + zb.u f: b
  + zb.u g: c
  + zb.u h: b0
  + zb.u i: boolean
  + zb.u j: g1
  + zb.u k: a
  + zb.u l: i1
  + zb.u m: i1
  + zb.u n: l
  + zb.u o: w1
  
  - mg.b0 I: Map
  - mg.b0 J: boolean
  - mg.b0 K: y4
  - mg.b0 L: boolean
  - mg.b0 M: o
  - mg.b0 N: boolean
  - mg.b0 O: k1
  - mg.b0 P: String
  - mg.b0 Q: y
  - mg.b0 R: n
  - mg.b0 S: f3
  - mg.b0 T: boolean
  - mg.b0 U: g0
  - mg.b0 V: a0
  - mg.l0 m: boolean
  - mg.l0 n: w
  - mg.l0 o: b0
  - mg.l0 p: boolean
  - mg.l0 q: Boolean
  - mg.l0 r: a
  - mg.l0 s: j1
  - zb.u f: c
  - zb.u g: b0
  - zb.u h: g1
  - zb.u i: a
  - zb.u j: i1
  - zb.u k: i1
  - zb.u l: l
  - zb.u m: w1

@toluo-stripe toluo-stripe force-pushed the tolu/funding/query_range branch 2 times, most recently from d86c9c5 to 33c1988 Compare January 13, 2026 18:38
@toluo-stripe toluo-stripe force-pushed the tolu/funding/query_range branch from 33c1988 to 19fb7ff Compare January 13, 2026 19:18
@toluo-stripe toluo-stripe marked this pull request as ready for review January 13, 2026 19:41
@toluo-stripe toluo-stripe requested review from a team as code owners January 13, 2026 19:41
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