Skip to content

Report event when card input requires more than 16 digits #10897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samer-stripe
Copy link
Collaborator

@samer-stripe samer-stripe commented Jun 2, 2025

Summary

Report event when card input requires more than 16 digits and the user leaves the field without entering the remaining digits.

Motivation

Track if users have valid 16 digit cards but the card validation logic expects 16.

Testing

  • Added tests
  • Modified tests
  • Manually verified

@samer-stripe samer-stripe changed the title Report event when card requires more than 16 digits Report event when card input requires more than 16 digits Jun 2, 2025
Copy link
Contributor

github-actions bot commented Jun 2, 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.3 MiB │   4.3 MiB │ +6.1 KiB │   9.6 MiB │   9.6 MiB │ +16.3 KiB 
     arsc │   2.5 MiB │   2.5 MiB │      0 B │   2.5 MiB │   2.5 MiB │       0 B 
 manifest │   5.6 KiB │   5.6 KiB │      0 B │  28.7 KiB │  28.7 KiB │       0 B 
      res │ 912.3 KiB │ 912.3 KiB │      0 B │   1.4 MiB │   1.4 MiB │       0 B 
   native │   3.5 MiB │   3.5 MiB │      0 B │   8.5 MiB │   8.5 MiB │       0 B 
    asset │   1.6 MiB │   1.6 MiB │    +38 B │   1.6 MiB │   1.6 MiB │     +38 B 
    other │ 197.2 KiB │ 197.2 KiB │    +17 B │ 372.4 KiB │ 372.4 KiB │       0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼───────────
    total │    13 MiB │    13 MiB │ +6.2 KiB │    24 MiB │    24 MiB │ +16.3 KiB 

         │         raw          │              unique               
         ├───────┬───────┬──────┼───────┬───────┬───────────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff              
─────────┼───────┼───────┼──────┼───────┼───────┼───────────────────
   files │     2 │     2 │    0 │       │       │                   
 strings │ 46408 │ 46716 │ +308 │ 45704 │ 45694 │ -10 (+53 -63)     
   types │ 16320 │ 16557 │ +237 │ 16031 │ 16045 │ +14 (+48 -34)     
 classes │ 13536 │ 13550 │  +14 │ 13536 │ 13550 │ +14 (+19 -5)      
 methods │ 66648 │ 66881 │ +233 │ 66180 │ 66211 │ +31 (+2407 -2376) 
  fields │ 44279 │ 44389 │ +110 │ 44136 │ 44156 │ +20 (+1131 -1111) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6310 │ 6310 │  0
APK
      compressed      │     uncompressed      │                                
──────────┬───────────┼───────────┬───────────┤                                
 size     │ diff      │ size      │ diff      │ path                           
──────────┼───────────┼───────────┼───────────┼────────────────────────────────
 66.1 KiB │ +16.6 KiB │ 146.8 KiB │ +30.3 KiB │ ∆ classes2.dex                 
  4.3 MiB │ -10.5 KiB │   9.5 MiB │   -14 KiB │ ∆ classes.dex                  
  8.4 KiB │     +53 B │   8.2 KiB │     +53 B │ ∆ assets/dexopt/baseline.prof  
    1 KiB │     -15 B │     925 B │     -15 B │ ∆ assets/dexopt/baseline.profm 
 54.5 KiB │     +13 B │ 120.9 KiB │       0 B │ ∆ META-INF/CERT.SF             
   51 KiB │      +4 B │ 120.9 KiB │       0 B │ ∆ META-INF/MANIFEST.MF         
──────────┼───────────┼───────────┼───────────┼────────────────────────────────
  4.5 MiB │  +6.2 KiB │   9.8 MiB │ +16.3 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   45704 │ 45694 │ -10 (+53 -63) 
  
  + CardMetadataExpectedExtraDigitsButUserEntered16ThenSwitchedFields
  + LD6/h;
  + LM7/E;
  + LM7/F;
  + LO8/x;
  + LY6/D;
  + LY6/E;
  + Li9/Z1;
  + Li9/a2;
  + Li9/b2;
  + Ll9/h;
  + Ll9/i;
  + Ll9/j;
  + Ls5/s1;
  + Lt5/o;
  + Lt9/t;
  + Lta/H;
  + Lu6/s;
  + Lx5/d;
  + Lx8/g;
  + [LD6/h;
  + [LM7/f;
  + [LM7/r;
  + [LY6/E;
  + [LY6/u;
  + [LY6/x;
  + [Li9/B0;
  + [Li9/F0;
  + [Li9/H0;
  + [Li9/H1;
  + [Li9/L0;
  + [Li9/O1;
  + [Li9/P0;
  + [Li9/U1;
  + [Li9/X0;
  + [Li9/Z1;
  + [Li9/b2;
  + [Li9/f1;
  + [Li9/m1;
  + [Li9/q1;
  + [Li9/u1;
  + [Li9/y1;
  + [Li9/z1;
  + [Ls5/f1;
  + [Lt9/l;
  + [Lu6/r;
  + [Lu7/I;
  + [Lu7/t;
  + card_metadata.expected_extra_digits_but_user_entered_16_then_switched_fields
  + onAnalyticsEvent
  + onAnalyticsEvent(Lcom/stripe/android/core/networking/AnalyticsEvent;)V
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"b506509","r8-mode":"full","version":"8.8.34"}
  + [Lta/s;
  
  - A1
  - B1
  - C1
  - D1
  - E1
  - F1
  - G1
  - H1
  - I1
  - J1
  - K1
  - L1
  - LX5/L;
  - LX6/i;
  - Ls0/g;
  - Ls0/h;
  - Lu7/X;
  - M1
  - N1
  - O1
  - P1
  - Q1
  - R1
  - S1
  - [LD6/g;
  - [LM7/e;
  - [LM7/q;
  - [LY6/C;
  - [LY6/r;
  - [LY6/s;
  - [Li9/B1;
  - [Li9/C0;
  - [Li9/E0;
  - [Li9/I0;
  - [Li9/L1;
  - [Li9/M0;
  - [Li9/R1;
  - [Li9/U0;
  - [Li9/W0;
  - [Li9/W1;
  - [Li9/Y1;
  - [Li9/j1;
  - [Li9/n1;
  - [Li9/o1;
  - [Li9/s0;
  - [Li9/v1;
  - [Li9/w1;
  - [Ls5/c1;
  - [Lt9/k;
  - [Lu6/o;
  - [Lu7/J;
  - [Lu7/u;
  - q1
  - r1
  - s1
  - t1
  - u1
  - w1
  - x1
  - y1
  - z1
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"ef82290","r8-mode":"full","version":"8.8.34"}
  - [Lta/r;
  

TYPES:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   16031 │ 16045 │ +14 (+48 -34) 
  
  + LD6/h;
  + LM7/E;
  + LM7/F;
  + LO8/x;
  + LY6/D;
  + LY6/E;
  + Li9/Z1;
  + Li9/a2;
  + Li9/b2;
  + Ll9/h;
  + Ll9/i;
  + Ll9/j;
  + Ls5/s1;
  + Lt5/o;
  + Lt9/t;
  + Lta/H;
  + Lu6/s;
  + Lx5/d;
  + Lx8/g;
  + [LD6/h;
  + [LM7/f;
  + [LM7/r;
  + [LY6/E;
  + [LY6/u;
  + [LY6/x;
  + [Li9/B0;
  + [Li9/F0;
  + [Li9/H0;
  + [Li9/H1;
  + [Li9/L0;
  + [Li9/O1;
  + [Li9/P0;
  + [Li9/U1;
  + [Li9/X0;
  + [Li9/Z1;
  + [Li9/b2;
  + [Li9/f1;
  + [Li9/m1;
  + [Li9/q1;
  + [Li9/u1;
  + [Li9/y1;
  + [Li9/z1;
  + [Ls5/f1;
  + [Lt9/l;
  + [Lu6/r;
  + [Lu7/I;
  + [Lu7/t;
  + [Lta/s;
  
  - LX5/L;
  - LX6/i;
  - Ls0/g;
  - Ls0/h;
  - Lu7/X;
  - [LD6/g;
  - [LM7/e;
  - [LM7/q;
  - [LY6/C;
  - [LY6/r;
  - [LY6/s;
  - [Li9/B1;
  - [Li9/C0;
  - [Li9/E0;
  - [Li9/I0;
  - [Li9/L1;
  - [Li9/M0;
  - [Li9/R1;
  - [Li9/U0;
  - [Li9/W0;
  - [Li9/W1;
  - [Li9/Y1;
  - [Li9/j1;
  - [Li9/n1;
  - [Li9/o1;
  - [Li9/s0;
  - [Li9/v1;
  - [Li9/w1;
  - [Ls5/c1;
  - [Lt9/k;
  - [Lu6/o;
  - [Lu7/J;
  - [Lu7/u;
  - [Lta/r;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   66180 │ 66211 │ +31 (+2407 -2376) 
  
  + B3.e b(a, float) → float
  + B6.E <init>(a, O, a, F, E, e, H, b, f0, boolean, i, M)
  + B6.e0 <init>(r, u0, t, e, P, Function1, Function0, Function0, Function0, Function2, Function0, Function1, Function0, Function1, Function0, Function0, Function0, int)
  + B6.p0 b(r, u0, t, e, P, Function1, Function0, Function0, Function0, Function2, Function0, Function1, Function0, Function1, Function0, Function0, Function0, p, int)
  + D0.c A(String, p, int)
  + D0.c B(Y, t3, a2, a, p, int, int)
  + D0.c C(a, Function0, Function0, Function0, p, int)
  + D0.c D(b, Function0, p, int)
  + D0.c E(C, boolean, a1, j0, Function1, Function1, Function0, Function1, Function1, Function1, Function1, Function0, p, int)
  + D0.c F(String, String, float, boolean, v, m, a, a, p, int)
  + D0.c G(C, boolean, Function1, Function1, Function0, Function1, Function1, Function1, Function1, Function0, p, int)
  + D0.c H(String, List, Object, Function1, p, int)
  + D0.c I(p, boolean, String, Function0, p, int, int)
  + D0.c J(I, boolean) → o
  + D0.c K(F0, P0, p, int)
  + D0.c L(String, List, Q, Function1, p, int)
  + D0.c M(P0, p, int)
  + D0.c N(String, String, Function1, p, int)
  + D0.c O(boolean, Function0, p, int, int)
  + D0.c P(String, Function1, Function1, p, int)
  + D0.c Q(p, b, Function0, Function0, p, int)
  + D0.c R(p, n, p, int)
  + D0.c S(C, a1, j0, Function1, Function1, Function0, Functio
...✂

@samer-stripe
Copy link
Collaborator Author

Going to add tests but wanted to review the approach first. On iOS, we added this event as a general analytics event rather than a specific PS and CS event so I followed suit here. Though with our general analytics events, we've secluded them within the core libraries rather than send them up to PaymentSheet and CustomerSheet. There are a few options here:

  • Allow for general analytics events to be sent up to PS and CS. Can be confusing with other UI events that have specific PS and CS events
  • Seclude this event within CardNumberController. Need to add a new repo type OR add a new method to CardAccountRangeRepository to handle analytics.
  • Specifically have a reporter for this event (similar to CardNumberCompleted and CardBrandDisallowed), expose PaymentAnalyticsEvent to the library group, and report in EventReporter in PaymentSheet .

@samer-stripe samer-stripe force-pushed the samer/analytics-event-more-than-16-digits branch 2 times, most recently from 80b7823 to 61a3f05 Compare June 2, 2025 16:03
@jaynewstrom-stripe
Copy link
Collaborator

Seems fine to me.

@samer-stripe samer-stripe force-pushed the samer/analytics-event-more-than-16-digits branch from 61a3f05 to 4d4fcfc Compare June 3, 2025 03:58
@samer-stripe samer-stripe marked this pull request as ready for review June 3, 2025 03:58
@samer-stripe samer-stripe requested review from a team as code owners June 3, 2025 03:58
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