Skip to content

[Prototype] Migrate cardscan module with GPCR API #11345

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

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

Conversation

cttsai-stripe
Copy link
Contributor

Summary

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Aug 13, 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.7 MiB │   4.7 MiB │ +2.5 KiB │  10.5 MiB │  10.5 MiB │ +5.5 KiB 
     arsc │   2.6 MiB │   2.6 MiB │      0 B │   2.6 MiB │   2.6 MiB │      0 B 
 manifest │   5.8 KiB │   5.8 KiB │      0 B │  30.1 KiB │  30.1 KiB │      0 B 
      res │ 918.6 KiB │ 918.6 KiB │      0 B │   1.5 MiB │   1.5 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 │   -285 B │   1.6 MiB │   1.6 MiB │   -285 B 
    other │ 198.1 KiB │ 198.1 KiB │     -2 B │ 374.1 KiB │ 374.1 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  13.5 MiB │  13.5 MiB │ +2.3 KiB │    25 MiB │    25 MiB │ +5.3 KiB 

         │         raw          │              unique               
         ├───────┬───────┬──────┼───────┬───────┬───────────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff              
─────────┼───────┼───────┼──────┼───────┼───────┼───────────────────
   files │     2 │     2 │    0 │       │       │                   
 strings │ 53031 │ 53125 │  +94 │ 49510 │ 49522 │ +12 (+62 -50)     
   types │ 18867 │ 18934 │  +67 │ 17219 │ 17227 │  +8 (+54 -46)     
 classes │ 14539 │ 14544 │   +5 │ 14539 │ 14544 │  +5 (+16 -11)     
 methods │ 73988 │ 74062 │  +74 │ 71246 │ 71267 │ +21 (+2117 -2096) 
  fields │ 48171 │ 48212 │  +41 │ 47246 │ 47259 │ +13 (+1398 -1385) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6344 │ 6344 │  0
APK
      compressed      │     uncompressed     │                                           
───────────┬──────────┼───────────┬──────────┤                                           
 size      │ diff     │ size      │ diff     │ path                                      
───────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
 469.1 KiB │ +3.7 KiB │   1.1 MiB │ +7.8 KiB │ ∆ classes2.dex                            
   4.3 MiB │ -1.2 KiB │   9.4 MiB │ -2.3 KiB │ ∆ classes.dex                             
   8.9 KiB │   -288 B │   8.8 KiB │   -288 B │ ∆ assets/dexopt/baseline.prof             
  51.4 KiB │     -8 B │ 121.7 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
  54.9 KiB │     +7 B │ 121.8 KiB │      0 B │ ∆ META-INF/CERT.SF                        
   1.1 KiB │     +3 B │     1 KiB │     +3 B │ ∆ assets/dexopt/baseline.profm            
     271 B │     -1 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
───────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
   4.8 MiB │ +2.3 KiB │  10.7 MiB │ +5.3 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   49510 │ 49522 │ +12 (+62 -50) 
  
  + Failed to parse card data
  + LC9/B;
  + LC9/C;
  + LC9/D;
  + LH9/f;
  + LR3/x;
  + LR3/y;
  + LR3/z;
  + LS9/g;
  + Landroidx/lifecycle/h0_a;
  + Landroidx/lifecycle/x0;
  + Lcom/google/android/material/datepicker/A;
  + Li/V;
  + Li3/o;
  + Lq8/E;
  + RemoteException during getPaymentCardRecognitionIntent
  + [LC9/t;
  + [LC9/u;
  + [LC9/v;
  + [LR3/m;
  + [LR3/n;
  + [LR3/r;
  + [LR3/s;
  + [LR3/w;
  + [LR3/x;
  + [LR3/y;
  + [LV8/s;
  + [Lcom/google/android/material/datepicker/e;
  + [Lcom/google/android/material/datepicker/q;
  + [Ld8/u;
  + [Lf7/H;
  + [Lf7/M;
  + [Lf7/U;
  + [Lf7/g0;
  + [Lf7/x0;
  + [Li/F;
  + [Lj8/j;
  + [Ln9/l;
  + [Lq8/B;
  + [Lra/E;
  + [Lra/N;
  + [Lra/e0;
  + [Lra/g0;
  + [Lra/k;
  + [Lra/p0;
  + [Lra/y;
  + [Lta/d;
  + [Lta/g;
  + [Lw/W;
  + [Lx9/p;
  + [Lx9/s;
  + [Ly9/g;
  + [Ly9/l;
  + activityLauncher
  + com.google.android.gms.wallet.PaymentCardRecognitionResult
  + getIntentSender(...)
  + getPaymentCardRecognitionPendingIntent(...)
  + intentSenderRequest
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"96aadf2","r8-mode":"full","version":"8.8.34"}
  + Lio/sentry/android/core/internal/gestures/j;
  + Lio/sentry/transport/r;
  + [Lio/sentry/clientreport/d;
  
  - LO9/h;
  - La5/b;
  - Landroidx/lifecycle/g0_a;
  - Lcom/stripe/android/stripecardscan/cardscan/a;
  - Ld8/y;
  - Lra/s0;
  - Lta/j;
  - Lu2/i;
  - Lu2/j;
  - Lu8/G;
  - Lv9/i;
  - Missing stripecardscan dependency, please add it to your apps build.gradle
  - [LC9/p;
  - [LC9/q;
  - [LC9/r;
  - [LR3/p;
  - [LR3/t;
  - [LR3/u;
  - [LR3/v;
  - [LV8/q;
  - [Lcom/google/android/material/datepicker/d;
  - [Lcom/google/android/material/datepicker/p;
  - [Ld8/w;
  - [Lf7/F;
  - [Lf7/L;
  - [Lf7/T;
  - [Lf7/f0;
  - [Lf7/w0;
  - [Li/E;
  - [Lj8/h;
  - [Ln9/i;
  - [Lq8/A;
  - [Lra/F;
  - [Lra/O;
  - [Lra/f0;
  - [Lra/h0;
  - [Lra/l;
  - [Lra/q0;
  - [Lra/z;
  - [Lta/e;
  - [Lta/h;
  - [Lw/X;
  - [Lx9/n;
  - [Lx9/q;
  - [Ly9/e;
  - [Ly9/j;
  - androidx.test.InstrumentationRegistry
  - has_instrumentation
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"2661060","r8-mode":"full","version":"8.8.34"}
  - [Lio/sentry/clientreport/e;
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   17219 │ 17227 │ +8 (+54 -46) 
  
  + LC9/B;
  + LC9/C;
  + LC9/D;
  + LH9/f;
  + LR3/x;
  + LR3/y;
  + LR3/z;
  + LS9/g;
  + Landroidx/lifecycle/h0_a;
  + Landroidx/lifecycle/x0;
  + Lcom/google/android/material/datepicker/A;
  + Li/V;
  + Li3/o;
  + Lq8/E;
  + [LC9/t;
  + [LC9/u;
  + [LC9/v;
  + [LR3/m;
  + [LR3/n;
  + [LR3/r;
  + [LR3/s;
  + [LR3/w;
  + [LR3/x;
  + [LR3/y;
  + [LV8/s;
  + [Lcom/google/android/material/datepicker/e;
  + [Lcom/google/android/material/datepicker/q;
  + [Ld8/u;
  + [Lf7/H;
  + [Lf7/M;
  + [Lf7/U;
  + [Lf7/g0;
  + [Lf7/x0;
  + [Li/F;
  + [Lj8/j;
  + [Ln9/l;
  + [Lq8/B;
  + [Lra/E;
  + [Lra/N;
  + [Lra/e0;
  + [Lra/g0;
  + [Lra/k;
  + [Lra/p0;
  + [Lra/y;
  + [Lta/d;
  + [Lta/g;
  + [Lw/W;
  + [Lx9/p;
  + [Lx9/s;
  + [Ly9/g;
  + [Ly9/l;
  + Lio/sentry/android/core/internal/gestures/j;
  + Lio/sentry/transport/r;
  + [Lio/sentry/clientreport/d;
  
  - LO9/h;
  - La5/b;
  - Landroidx/lifecycle/g0_a;
  - Lcom/stripe/android/stripecardscan/cardscan/a;
  - Ld8/y;
  - Lra/s0;
  - Lta/j;
  - Lu2/i;
  - Lu2/j;
  - Lu8/G;
  - Lv9/i;
  - [LC9/p;
  - [LC9/q;
  - [LC9/r;
  - [LR3/p;
  - [LR3/t;
  - [LR3/u;
  - [LR3/v;
  - [LV8/q;
  - [Lcom/google/android/material/datepicker/d;
  - [Lcom/google/android/material/datepicker/p;
  - [Ld8/w;
  - [Lf7/F;
  - [Lf7/L;
  - [Lf7/T;
  - [Lf7/f0;
  - [Lf7/w0;
  - [Li/E;
  - [Lj8/h;
  - [Ln9/i;
  - [Lq8/A;
  - [Lra/F;
  - [Lra/O;
  - [Lra/f0;
  - [Lra/h0;
  - [Lra/l;
  - [Lra/q0;
  - [Lra/z;
  - [Lta/e;
  - [Lta/h;
  - [Lw/X;
  - [Lx9/n;
  - [Lx9/q;
  - [Ly9/e;
  - [Ly9/j;
  - [Lio/sentry/clientreport/e;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   71246 │ 71267 │ +21 (+2117 -2096) 
  
  + A.h m(Exception)
  + A.j d(Object)
  + A.j g(o1) → y
  + A.j i()
  + A.j k(p, int, Bundle) → boolean
  + A.l a(CameraCaptureSession_CaptureCallback) → CameraCaptureSession_CaptureCallback
  + A.l c(l, boolean)
  + A0.a0 i(P1, W, F) → s
  + A0.a0 k(JSONObject) → h
  + A0.o1 <init>(H, b, X)
  + A0.o1 <init>(n0, w0)
  + A0
...✂

@cttsai-stripe cttsai-stripe force-pushed the cttsai/cardscan-with-private-cardscan-module branch from f11c1a9 to 8db524b Compare August 13, 2025 22:47
Comment on lines +40 to +45
.setEnvironment(
if (isPaymentSheetExample)
WalletConstants.ENVIRONMENT_TEST
else
WalletConstants.ENVIRONMENT_PRODUCTION
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if ENVIRONMENT_TEST is set, the app does not need to be approved by Google Pay but the return data is always mocked.
if ENVIRONMENT_PRODUCTION is set, the app requires to be approved otherwise an exception will be thrown.

It makes more sense to alway have the real scanner for merchants integrating PaymenSheet, but we might not be able to use it for our example app.

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.

1 participant