Skip to content

Conversation

@toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Dec 9, 2025

Summary

Filter by funding type in Google Pay

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 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.9 MiB │     4.9 MiB │  -91 B │    11 MiB │    11 MiB │ -764 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,004.4 KiB │ 1,004.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.3 KiB │    26.2 KiB │  -46 B │  46.8 KiB │  46.7 KiB │  -46 B 
    other │   205.3 KiB │   205.3 KiB │   -3 B │ 405.7 KiB │ 405.7 KiB │    0 B 
──────────┼─────────────┼─────────────┼────────┼───────────┼───────────┼────────
    total │    10.6 MiB │    10.6 MiB │ -140 B │  19.1 MiB │  19.1 MiB │ -810 B 

         │         raw          │              unique               
         ├───────┬───────┬──────┼───────┬───────┬───────────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff              
─────────┼───────┼───────┼──────┼───────┼───────┼───────────────────
   files │     2 │     2 │    0 │       │       │                   
 strings │ 58598 │ 58521 │  -77 │ 52043 │ 52050 │  +7 (+58 -51)     
   types │ 20728 │ 20670 │  -58 │ 17460 │ 17465 │  +5 (+46 -41)     
 classes │ 14683 │ 14687 │   +4 │ 14683 │ 14687 │  +4 (+8 -4)       
 methods │ 78367 │ 78311 │  -56 │ 73328 │ 73335 │  +7 (+1788 -1781) 
  fields │ 51368 │ 51361 │   -7 │ 49019 │ 49043 │ +24 (+1064 -1040) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  325 │  325 │  0   
 entries │ 6941 │ 6941 │  0
APK
      compressed      │     uncompressed      │                                           
───────────┬──────────┼───────────┬───────────┤                                           
 size      │ diff     │ size      │ diff      │ path                                      
───────────┼──────────┼───────────┼───────────┼───────────────────────────────────────────
 809.6 KiB │   -7 KiB │   1.8 MiB │ -11.2 KiB │ ∆ classes2.dex                            
   4.1 MiB │ +6.9 KiB │   9.2 MiB │ +10.4 KiB │ ∆ classes.dex                             
   9.9 KiB │    -38 B │   9.8 KiB │     -38 B │ ∆ assets/dexopt/baseline.prof             
   1.2 KiB │     -8 B │     1 KiB │      -8 B │ ∆ assets/dexopt/baseline.profm            
  54.4 KiB │     -3 B │ 127.3 KiB │       0 B │ ∆ META-INF/MANIFEST.MF                    
   1.2 KiB │     +2 B │   1.2 KiB │       0 B │ ∆ META-INF/CERT.RSA                       
     271 B │     -1 B │     120 B │       0 B │ ∆ META-INF/version-control-info.textproto 
  57.6 KiB │     -1 B │ 127.4 KiB │       0 B │ ∆ META-INF/CERT.SF                        
───────────┼──────────┼───────────┼───────────┼───────────────────────────────────────────
     5 MiB │   -140 B │  11.2 MiB │    -810 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   52043 │ 52050 │ +7 (+58 -51) 
  
  + LLLZLZLLLLZLLZLLI
  + Leh/s0;
  + Lhf/s0;
  + Ljf/b;
  + Lkh/o0;
  + Ln1/i;
  + Lt7/v;
  + Lub/q0;
  + Lub/r0;
  + VLLJLLLLLZ
  + VLLLLFLLLLI
  + VLLLLLLZLLLL
  + VLLLZILLLL
  + VLLLZZLLLL
  + VLLLZZLLLLLL
  + VLLZZZLLLLLLLLLLLZLLLLLLLLLZLZLZLLLLLZ
  + VZLLZLLLLLI
  + [Leh/e0;
  + [Lhf/m0;
  + [Ljg/c;
  + [Lkh/c0;
  + [Lmk/p2;
  + [Lmk/x3;
  + [Lub/c0;
  + [Lub/d0;
  + [Lub/j0;
  + [Lub/n;
  + [Lub/q;
  + [Lub/r;
  + [Lub/x;
  + [Lvj/o;
  + [Lzb/b;
  + [Lzc/a;
  + allowPrepaidCards
  + r8-map-id-40ce93e474ff1e7c51b520211cd5ae721c6ba488207b81e2896d399a77ff0e96
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"40ce93e474ff1e7c51b520211cd5ae721c6ba488207b81e2896d399a77ff0e96","r8-mode":"full","version":"8.13.17"}
  + [Lhl/e;
  + [Lhl/k;
  + [Lhl/x;
  + [Lmk/b5;
  + [Lmk/c2;
  + [Lmk/c3;
  + [Lmk/f2;
  + [Lmk/f3;
  + [Lmk/f4;
  + [Lmk/h2;
  + [Lmk/i4;
  + [Lmk/l2;
  + [Lmk/l3;
  + [Lmk/o4;
  + [Lmk/p3;
  + [Lmk/t3;
  + [Lmk/v4;
  + [Lmk/w1;
  + [Lmk/x2;
  + [Lmk/z1;
  + [Lmk/z2;
  + [Lmk/z4;
  
  - LLLZLZLLLLZLLZI
  - Ljg/h;
  - Lt5/g0;
  - Lzc/b;
  - VLLJLLLLZ
  - VLLLLFLLI
  - VLLLLLLZLLL
  - VLLLZILL
  - VLLLZZLLLLL
  - VLLZZZLLLLLLLLLLLZLLLLLLLLZLZLZLLLLLZ
  - VZLLZLLLI
  - [Leh/d0;
  - [Lhf/l0;
  - [Ljg/g;
  - [Lkh/b0;
  - [Lmk/q2;
  - [Lub/e;
  - [Lub/f0;
  - [Lub/p;
  - [Lub/v;
  - [Lub/w;
  - [Lub/y;
  - [Lvj/n;
  - [Lzb/a;
  - [Lzc/b;
  - r8-map-id-ba6fbc21dfcbe6d73a3c0671b20e13315714e967b834769866121addd96bf7a6
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"ba6fbc21dfcbe6d73a3c0671b20e13315714e967b834769866121addd96bf7a6","r8-mode":"full","version":"8.13.17"}
  - Lmk/c5;
  - [Lhl/f;
  - [Lhl/m;
  - [Lhl/y;
  - [Lmk/a2;
  - [Lmk/a3;
  - [Lmk/a5;
  - [Lmk/c5;
  - [Lmk/d2;
  - [Lmk/d3;
  - [Lmk/g2;
  - [Lmk/g3;
  - [Lmk/g4;
  - [Lmk/i2;
  - [Lmk/j4;
  - [Lmk/m2;
  - [Lmk/m3;
  - [Lmk/p4;
  - [Lmk/r3;
  - [Lmk/u3;
  - [Lmk/w4;
  - [Lmk/x1;
  - [Lmk/y2;
  - [Lmk/z3;
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   17460 │ 17465 │ +5 (+46 -41) 
  
  + Leh/s0;
  + Lhf/s0;
  + Ljf/b;
  + Lkh/o0;
  + Ln1/i;
  + Lt7/v;
  + Lub/q0;
  + Lub/r0;
  + [Leh/e0;
  + [Lhf/m0;
  + [Ljg/c;
  + [Lkh/c0;
  + [Lmk/p2;
  + [Lmk/x3;
  + [Lub/c0;
  + [Lub/d0;
  + [Lub/j0;
  + [Lub/n;
  + [Lub/q;
  + [Lub/r;
  + [Lub/x;
  + [Lvj/o;
  + [Lzb/b;
  + [Lzc/a;
  + [Lhl/e;
  + [Lhl/k;
  + [Lhl/x;
  + [Lmk/b5;
  + [Lmk/c2;
  + [Lmk/c3;
  + [Lmk/f2;
  + [Lmk/f3;
  + [Lmk/f4;
  + [Lmk/h2;
  + [Lmk/i4;
  + [Lmk/l2;
  + [Lmk/l3;
  + [Lmk/o4;
  + [Lmk/p3;
  + [Lmk/t3;
  + [Lmk/v4;
  + [Lmk/w1;
  + [Lmk/x2;
  + [Lmk/z1;
  + [Lmk/z2;
  + [Lmk/z4;
  
  - Ljg/h;
  - Lt5/g0;
  - Lzc/b;
  - [Leh/d0;
  - [Lhf/l0;
  - [Ljg/g;
  - [Lkh/b0;
  - [Lmk/q2;
  - [Lub/e;
  - [Lub/f0;
  - [Lub/p;
  - [Lub/v;
  - [Lub/w;
  - [Lub/y;
  - [Lvj/n;
  - [Lzb/a;
  - [Lzc/b;
  - Lmk/c5;
  - [Lhl/f;
  - [Lhl/m;
  - [Lhl/y;
  - [Lmk/a2;
  - [Lmk/a3;
  - [Lmk/a5;
  - [Lmk/c5;
  - [Lmk/d2;
  - [Lmk/d3;
  - [Lmk/g2;
  - [Lmk/g3;
  - [Lmk/g4;
  - [Lmk/i2;
  - [Lmk/j4;
  - [Lmk/m2;
  - [Lmk/m3;
  - [Lmk/p4;
  - [Lmk/r3;
  - [Lmk/u3;
  - [Lmk/w4;
  - [Lmk/x1;
  - [Lmk/y2;
  - [Lmk/z3;
  

METHODS:

   old   │ new   │ diff             
  ───────┼───────┼──────────────────
   73328 │ 73335 │ +7 (+1788 -1781) 
  
  + a0.s <init>(boolean, r, long, float, float, long, long, i)
  + a4.b0 c(View) → boolean
  + a4.j D(WindowInsetsController, c0)
  + a4.j v(WindowInsetsController, c0)
  + a6.a b(Object, int, int, g) → b0
  + a6.c0 b(Object, int, int, g) → b0
  + a6.c <init>(Resources, b0)
  + a6.d transform(Context, b0, int, int) → b0
  + a6.e b(Object, int, int, g) → b0
  + a6.f0 e(MediaMetadataRetriever, Object)
  + a6.g0 b(Object, int, int, g) → b0
  + a6.l <init>(StripeEditText)
  + a6.l l()
  + a6.l m(JSONObject) → a
  + a6.l n(b) → LinkedHashMap
  + a6.l o(Object) → ECPublicKey
  + a6.l p(String, l)
  + a6.s transform(Context, b0, int, int) → b0
  + a6.w <init>(y)
  + a6.w J(b0, g) → b0
  + a9.b <init>(y, View)
  + aa.q f(v) → p
  + aa.q g(w) → Typeface
  + af.p0 <init>(p0, h, i0, h)
  + af.s0 f(v) → p
  + af.s0 g() → IntentFilter
  + af.s0 h(int) → int[]
  + ah.b <init>(j0, d0)
  + ah.b <init>(b, n)
  + ah.b a(l, k, e0, Parcelable) → i
  + ai.d0 F(o) → long
  + ai.d0 I()
  + ai.d0 O(d, o)
  + ai.d0 Q(boolean, Function0, o, int)
  + a
...✂

@toluo-stripe toluo-stripe force-pushed the tolu/funding/gpay branch 3 times, most recently from 280c8d8 to 7ed8343 Compare December 10, 2025 23:19
Comment on lines +699 to +700
cardFundingFilter = DefaultCardFundingFilter,
cardBrandFilter = DefaultCardBrandFilter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not used to present Google, but only to determine the ready state, hence the default filter implementations are fine here. Plus, this state is fetched async before we get the elements session. Using the merchant defined filters will require use to wait for elements session to load so we can use the feature flag, and would make latency worse.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth a code comment, as this feels relevant long term.

Comment on lines 705 to 711
private suspend fun isGooglePaySupportedOnDevice(): Boolean {
return googlePayRepositoryFactory(GooglePayEnvironment.Production).isReady().first()
return googlePayRepositoryFactory(
environment = GooglePayEnvironment.Production,
cardBrandFilter = DefaultCardBrandFilter,
cardFundingFilter = DefaultCardFundingFilter
).isReady().first()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

@toluo-stripe toluo-stripe changed the title Tolu/funding/gpay Filter by funding type in Google Pay Dec 11, 2025
Comment on lines +699 to +700
cardFundingFilter = DefaultCardFundingFilter,
cardBrandFilter = DefaultCardBrandFilter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth a code comment, as this feels relevant long term.

"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]
"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"],
"allowCreditCards": true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is my only FUD with this PR.

Can you manually test to make sure no unexpected behavior changes happen as a result of us sending true here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yh, I'm able to get it working for the Google Pay Button, but the Google Pay Sheet isn't adhering to this setting (even after hardcoding it). It always shows both credit and debit cards. I'm confirming with @samer-stripe to see if it's something we can only test in a Prod Google Pay environment.

Credit Cards Disabled (Google Pay Button)
debit_card

Credit Cards Enabled (Google Pay Button)
credit_card

Google Pay Sheet

1000000568 1000000567

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