Skip to content

Parse out partial field for payment_method_remove in ElementsSession #11421

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

Merged
merged 1 commit into from
Aug 21, 2025

Conversation

samer-stripe
Copy link
Collaborator

@samer-stripe samer-stripe commented Aug 21, 2025

Summary

Parse out partial field for payment_method_remove in ElementsSession.

partial is a new Customer Session feature that soft-deletes PMs. It's actual behavior when calling the detach endpoint will be converting a PM with an always redisplay value to limited.

Motivation

partial will be used to determine some remove messaging. Parsing it out will also to determine the remove messaging.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

github-actions bot commented Aug 21, 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.8 MiB │   4.8 MiB │ +307 B │  10.5 MiB │  10.5 MiB │ +508 B 
     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 │ 924.5 KiB │ 924.5 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 │   +9 B │   1.6 MiB │   1.6 MiB │   +9 B 
    other │ 198.5 KiB │ 198.5 KiB │  +15 B │ 374.9 KiB │ 374.9 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  13.6 MiB │  13.6 MiB │ +331 B │  25.1 MiB │  25.1 MiB │ +517 B 

         │         raw          │             unique             
         ├───────┬───────┬──────┼───────┬───────┬────────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff           
─────────┼───────┼───────┼──────┼───────┼───────┼────────────────
   files │     2 │     2 │    0 │       │       │                
 strings │ 53316 │ 53320 │   +4 │ 49691 │ 49695 │ +4 (+31 -27)   
   types │ 19006 │ 19008 │   +2 │ 17292 │ 17294 │ +2 (+25 -23)   
 classes │ 14591 │ 14592 │   +1 │ 14591 │ 14592 │ +1 (+1 -0)     
 methods │ 74296 │ 74299 │   +3 │ 71485 │ 71488 │ +3 (+891 -888) 
  fields │ 48385 │ 48389 │   +4 │ 47429 │ 47433 │ +4 (+889 -885) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6355 │ 6355 │  0
APK
     compressed     │    uncompressed    │                                           
───────────┬────────┼───────────┬────────┤                                           
 size      │ diff   │ size      │ diff   │ path                                      
───────────┼────────┼───────────┼────────┼───────────────────────────────────────────
   4.3 MiB │ +308 B │   9.4 MiB │ +508 B │ ∆ classes.dex                             
  55.1 KiB │  +19 B │ 122.2 KiB │    0 B │ ∆ META-INF/CERT.SF                        
   9.3 KiB │   +9 B │   9.2 KiB │   +9 B │ ∆ assets/dexopt/baseline.prof             
  51.6 KiB │   -3 B │ 122.1 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
     271 B │   -1 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
 472.2 KiB │   -1 B │   1.1 MiB │    0 B │ ∆ classes2.dex                            
───────────┼────────┼───────────┼────────┼───────────────────────────────────────────
   4.9 MiB │ +331 B │  10.8 MiB │ +517 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   49691 │ 49695 │ +4 (+31 -27) 
  
  + , paymentMethodRemove=
  + Enabled(paymentMethodRemove=
  + LJ7/r4;
  + Partial
  + VZLZLZ
  + [LJ7/B3;
  + [LJ7/E1;
  + [LJ7/G3;
  + [LJ7/J1;
  + [LJ7/J2;
  + [LJ7/O1;
  + [LJ7/O2;
  + [LJ7/S1;
  + [LJ7/U2;
  + [LJ7/W3;
  + [LJ7/X2;
  + [LJ7/Y0;
  + [LJ7/b4;
  + [LJ7/c3;
  + [LJ7/d1;
  + [LJ7/f1;
  + [LJ7/f2;
  + [LJ7/g4;
  + [LJ7/j3;
  + [LJ7/l1;
  + [LJ7/m2;
  + [LJ7/r1;
  + [LJ7/r4;
  + [LJ7/t1;
  + paymentMethodRemove
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"73db60c","r8-mode":"full","version":"8.8.34"}
  
  - , isPaymentMethodRemoveEnabled=
  - Enabled(isPaymentMethodRemoveEnabled=
  - VZZZLZ
  - [LJ7/C3;
  - [LJ7/F1;
  - [LJ7/H3;
  - [LJ7/K1;
  - [LJ7/K2;
  - [LJ7/P1;
  - [LJ7/P2;
  - [LJ7/T1;
  - [LJ7/V2;
  - [LJ7/X3;
  - [LJ7/Y2;
  - [LJ7/Z0;
  - [LJ7/c4;
  - [LJ7/d3;
  - [LJ7/e1;
  - [LJ7/h1;
  - [LJ7/h2;
  - [LJ7/k3;
  - [LJ7/k4;
  - [LJ7/m1;
  - [LJ7/n2;
  - [LJ7/s1;
  - [LJ7/u1;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"c7bb4d1","r8-mode":"full","version":"8.8.34"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   17292 │ 17294 │ +2 (+25 -23) 
  
  + LJ7/r4;
  + [LJ7/B3;
  + [LJ7/E1;
  + [LJ7/G3;
  + [LJ7/J1;
  + [LJ7/J2;
  + [LJ7/O1;
  + [LJ7/O2;
  + [LJ7/S1;
  + [LJ7/U2;
  + [LJ7/W3;
  + [LJ7/X2;
  + [LJ7/Y0;
  + [LJ7/b4;
  + [LJ7/c3;
  + [LJ7/d1;
  + [LJ7/f1;
  + [LJ7/f2;
  + [LJ7/g4;
  + [LJ7/j3;
  + [LJ7/l1;
  + [LJ7/m2;
  + [LJ7/r1;
  + [LJ7/r4;
  + [LJ7/t1;
  
  - [LJ7/C3;
  - [LJ7/F1;
  - [LJ7/H3;
  - [LJ7/K1;
  - [LJ7/K2;
  - [LJ7/P1;
  - [LJ7/P2;
  - [LJ7/T1;
  - [LJ7/V2;
  - [LJ7/X3;
  - [LJ7/Y2;
  - [LJ7/Z0;
  - [LJ7/c4;
  - [LJ7/d3;
  - [LJ7/e1;
  - [LJ7/h1;
  - [LJ7/h2;
  - [LJ7/k3;
  - [LJ7/k4;
  - [LJ7/m1;
  - [LJ7/n2;
  - [LJ7/s1;
  - [LJ7/u1;
  

METHODS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   71485 │ 71488 │ +3 (+891 -888) 
  
  + A0.a0 s(JSONObject) → L1
  + A0.a0 t(JSONObject) → g3
  + A8.A0 a(o2, boolean, Continuation) → Object
  + A8.f1 k(o2, boolean, e) → Object
  + B4.q d(i4, int) → String
  + B5.a <init>(d, Y0, I, U0, Continuation)
  + B5.d a(d, Y0, I, U0, ContinuationImpl) → Object
  + B5.d b(U0, Y0, I)
  + B5.h <init>(String, String, U0, boolean, boolean, f, g, boolean, String, boolean)
  + B8.k0 <init>(CustomPaymentMethodActivity, E0, U1, int)
  + B8.l0 <init>(U1, FawryActivity, int)
  + C9.a R(Y0) → t
  + C9.a x(i4) → String
  + C9.a z(Y0) → boolean
  + D.d <init>(e1, boolean)
  + D.e l(t, boolean, k) → Q1
  + D3.a B(B) → U1
  + D3.a Z(U1) → p0
  + D7.g c(g, s2, U1) → E2
  + D7.g d(JSONObject) → E2
  + D7.g o(String) → n4
  + D7.g p(E2, String) → String
  + D7.g s(i4, String) → f
  + D7.g t(Y0, boolean, C, boolean) → List
  + D8.g a(o2, boolean, Continuation) → Object
  + E7.m getType() → f2
  + E7.o <init>(i4, s0, boolean, boolean, boolean, List, List, c, String, String, p0, b, List, List, List, k, boolean, e1, t, q1, C, e, b, a, String, s1, Map, boolean)
  + E7.o k0(f2) → boolean
  + E7.o q0(f2) → u1
  + E7.q <init>(Q1)
  + E7.q g(boolean, k) → Q1
  + E7.r g(boolean, k) → Q1
  + E7.s g(boolean, k) → Q1
  + E7.t g(boolean, k) → Q1
  + E7.u h(o2) → boolean
  + E7.v <init>(b, g1, D, Function1, E2, V2, K2, J, boolean, A, boolean)
  + F.e <init>(U1, q0, w0, boolean, boolean, Set)
  + F7.A getType() → f2
  + F7.B getType() → f2
  + F7.C getType() → f2
  + F7.D getType() → f2
  + F7.E getType() → f2
  + F7.F getType() → f2
  + F7.G getType() → f2
  + F7.H getType() → f2
  + F7.I getType() → f2
  + F7.J getType() → f2
  + F7.K getType() → f2
  + F7.L getType() → f2
  + F7.M getType() → f2
  + F7.N getType() → f2
  + F7.O getType() → f2
  + F7.P getType() → f2
  + F7.Q getType() → f2
  + F7.S getType() → f2
  + F7.a getType() → f2
  + F7.c getType() → f2
  + F7.d getType() → f2
  + F7.e getType() → f2
  + F7.f getType() → f2
  + F7.g getType() → f2
  + F7.h getType() → f2
  + F7.i getType() → f2
  + F7.j getType() → f2
  + F7.k getType() → f2
  + F7.m getType() → f2
  + F7.n getType() → f2
  + F7.o getType() → f2
  + F7.q getType() → f2
  + F7.s getType() → f2
  + F7.t getType() → f2
  + F7.u getType() → f2
  + F7.v getType() → f2
  + F7.w getType() → f2
  + F7.x getType() → f2
  + F7.y getType() → f2
  + F7.z getType() → f2
  + F8.j b(o2, ContinuationImpl) → Serializable
  + G.d S(JS
...✂

@samer-stripe samer-stripe force-pushed the samer/parse-out-partial-field branch from dc315fc to bd18f42 Compare August 21, 2025 13:37
@samer-stripe samer-stripe marked this pull request as ready for review August 21, 2025 15:28
@samer-stripe samer-stripe requested review from a team as code owners August 21, 2025 15:28
) : MobilePaymentElement {
val isPaymentMethodRemoveEnabled: Boolean
get() = paymentMethodRemove == PaymentMethodRemoveFeature.Enabled ||
paymentMethodRemove == PaymentMethodRemoveFeature.Partial
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Retaining this as a computed property. Tested to ensure we can still remove on either enabled or partial

@samer-stripe samer-stripe merged commit 429b0e5 into master Aug 21, 2025
16 checks passed
@samer-stripe samer-stripe deleted the samer/parse-out-partial-field branch August 21, 2025 16:18
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