Skip to content
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

Call new elements/detach endpoint for customer sessions. #9801

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Dec 18, 2024

Summary

Calls the new detach endpoint for customer sessions

Motivation

https://jira.corp.stripe.com/browse/MOBILESDK-2903

Testing

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

github-actions bot commented Dec 18, 2024

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 │   3.9 MiB │   3.9 MiB │   +216 B │  8.6 MiB │  8.6 MiB │   +656 B 
     arsc │   2.2 MiB │   2.2 MiB │      0 B │  2.2 MiB │  2.2 MiB │      0 B 
 manifest │     5 KiB │     5 KiB │      0 B │ 24.9 KiB │ 24.9 KiB │      0 B 
      res │ 908.2 KiB │ 908.2 KiB │      0 B │  1.4 MiB │  1.4 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │      0 B 
    asset │   1.6 MiB │   1.6 MiB │ +1.4 KiB │  1.6 MiB │  1.6 MiB │ +1.4 KiB 
    other │   1.4 MiB │   1.4 MiB │     -3 B │  1.6 MiB │  1.6 MiB │      0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
    total │  12.6 MiB │  12.6 MiB │ +1.6 KiB │ 21.5 MiB │ 21.5 MiB │ +2.1 KiB 

 DEX     │ old   │ new   │ diff           
─────────┼───────┼───────┼────────────────
   files │     1 │     1 │  0             
 strings │ 40619 │ 40621 │ +2 (+3 -1)     
   types │ 14022 │ 14023 │ +1 (+1 -0)     
 classes │ 11697 │ 11698 │ +1 (+1 -0)     
 methods │ 59672 │ 59675 │ +3 (+108 -105) 
  fields │ 39863 │ 39866 │ +3 (+96 -93)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6209 │ 6209 │  0
APK
     compressed      │     uncompressed     │                                
──────────┬──────────┼───────────┬──────────┤                                
 size     │ diff     │ size      │ diff     │ path                           
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  7.8 KiB │ +1.4 KiB │   7.7 KiB │ +1.4 KiB │ ∆ assets/dexopt/baseline.prof  
  3.9 MiB │   +216 B │   8.6 MiB │   +656 B │ ∆ classes.dex                  
 50.2 KiB │     -5 B │ 118.4 KiB │      0 B │ ∆ META-INF/MANIFEST.MF         
  1.2 KiB │     +2 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA            
    989 B │     +1 B │     857 B │     +1 B │ ∆ assets/dexopt/baseline.profm 
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
    4 MiB │ +1.6 KiB │   8.7 MiB │ +2.1 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   40619 │ 40621 │ +2 (+3 -1) 
  
  + LN6/T;
  + elements/payment_methods/%s/detach
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"bd26b12","r8-mode":"full","version":"8.7.14"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"5b2d14e","r8-mode":"full","version":"8.7.14"}
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   14022 │ 14023 │ +1 (+1 -0) 
  
  + LN6/T;
  

METHODS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   59672 │ 59675 │ +3 (+108 -105) 
  
  + Aa.j F() → S
  + F4.P <init>(Application, i, S, boolean, i)
  + F8.T1 <init>(S)
  + J2.i <init>(T, q, c, h, a, a)
  + N6.A <init>(S, c)
  + N6.B <init>(S, c)
  + N6.C <init>(S, c)
  + N6.D <init>(S, c)
  + N6.E <init>(S, c)
  + N6.F <init>(S, c)
  + N6.G <init>(S, c)
  + N6.H <init>(S, c)
  + N6.I <init>(S, c)
  + N6.J <init>(S, c)
  + N6.K <init>(S, c)
  + N6.L <init>(S, c)
  + N6.M <init>(S, c)
  + N6.N <init>(S, c)
  + N6.O <init>(S, c)
  + N6.P <init>(S, c)
  + N6.Q <init>(S, c)
  + N6.Q p(Object) → Object
  + N6.S <clinit>()
  + N6.S <init>(Context, a, d, i, Set, q, b, int)
  + N6.S <init>(Context, a, i, Set, b, q, d)
  + N6.S A(l, c, c) → Object
  + N6.S B(Map, R1, F2) → Map
  + N6.S C(p, k, c) → Object
  + N6.S D(String, k, c) → Object
  + N6.S E(String, k, c) → Object
  + N6.S F(k, Map, c) → Object
  + N6.S G(k, c, String, Set) → Object
  + N6.S H(y0, k, c) → Object
  + N6.S I(y0, k, c) → Object
  + N6.S J(String, k, List, c) → Object
  + N6.S K(String, k, List, c) → Object
  + N6.S L(String, k, List, c) → Object
  + N6.S M(String, String, Map, k, c) → Object
  + N6.S N(J2, k, c) → Object
  + N6.S O(String, c2, k, c) → Object
  + N6.S a(String, String, String, k, List, c) → Object
  + N6.S b(String, String, String, k, List, c) → Object
  + N6.S c(String, Set, String, k, c) → Object
  + N6.S d(Set) → String
  + N6.S e(k, c, String, String) → Object
  + N6.S f(k, c, String, String) → Object
  + N6.S g(String, k, c) → Object
  + N6.S h(p, k, List, c) → Object
  + N6.S i(p, k, List, c) → Object
  + N6.S j(q, k, List, c) → Object
  + N6.S k(String, List) → LinkedHashMap
  + N6.S l(S, k, c) → Object
  + N6.S m(String, V, k, c) → Object
  + N6.S n(R1, k, c) → Object
  + N6.S o(String, V, k, c) → Object
  + N6.S p(k, c, String, Set) → Object
  + N6.S q(String, Set, String, k, c) → Object
  + N6.S r(l, b, c, c) → Object
  + N6.S s(PaymentAnalyticsEvent)
  + N6.S t()
  + N6.S u(a, k, c) → Object
  + N6.S v(Object) → String
  + N6.S w(J0, Set, k, c) → Object
  + N6.S x(V)
  + N6.S y(k, c, String, Set) → Object
  + N6.S z(String, k, c) → Object
  + N6.T <init>(a, a, a, a, a, h, a)
  + N6.T <init>(a, a, a, a, a, a, a)
  + N6.T get() → Object
  + N6.d <init>(S, Set, int)
  + N6.e <init>(S, int)
  + N6.f <init>(S, d)
  + N6.j <init>(S, c)
  + N6.k <init>(S, c)
  + N6.l <init>(S, c)
  + N6.m <init>(S, c)
  + N6.n <init>(S, c)
  + N6.o <init>(S, c)
  + N6.p <init>(S, c)
  + N6.q <init>(S, c)
  + N6.r <init>(S, c)
  + N6.s <init>(S, c)
  + N6.t <init>(S, c)
  + N6.u <init>(S, c)
  + N6.v <init>(S, c)
  + N6.w <init>(S, c)
  + N6.x <init>(S, c)
  + N6.y <init>(S, c)
  + N6.z <init>(S, c)
  + S7.j <init>(S, a, d, f, i, Set)
  + S7.q <init>(S, a, i)
  + U6.f <init>(S, boolean, a, a)
  + X6.i <init>(Context, a, S, d, i)
  + X6.m <init>(Context, a, S, d, i)
  + X6.n <init>(e, e, T, a, a, int)
  + X6.r <init>(Context, a, S, d, i)
  + Y7.e <init>(S, h, f, d)
  + Z8.L <init>(H, S)
  + a7.c <init>(S)
  + a7.g <init>(S)
  + com.stripe.android.link.LinkActivityContract <init>(S)
  + f7.d <init>(S, q, b, x, d, i)
  + f7.u <init>(n, S, q, b, a, S, d, E, i, h0, boolean)
  + i7.v <init>(boolean, S, a, a, m, Map, a, a, q, b, i, h0, boolean)
  + j5.H0 <init>(Application, x, h, q, I, d, S, n, i, a, O, Q0, f)
  + l6.F <init>(m, k, v, S, P, k, e, h0, f, i)
  + l6.Z <init>(m, k, W, S, k, e, h0)
  + s6.n <init>(a, a, S, a, i, Locale, f)
  
  - Aa.j F() → Q
  - F4.P <init>(Application, i, Q, boolean, i)
  - F8.T1 <init>(Q)
  - J2.i <init>(S, q, c, h, a, a)
  - N6.A <init>(Q, c)
  - N6.B <init>(Q, c)
  - N6.C <init>(Q, c)
  - N6.D <init>(Q, c)
  - N6.E <init>(Q, c)
  - N6.F <init>(Q, c)
  - N6.G <init>(Q, c)
  - N6.H <init>(Q, c)
  - N6.I <init>(Q, c)
  - N6.J <init>(Q, c)
  - N6.K <init>(Q, c)
  - N6.L <init>(Q, c)
  - N6.M <init>(Q, c)
  - N6.N <init>(Q, c)
  - 
...✂

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/elements-detach branch from 3476176 to e44078b Compare December 18, 2024 19:18
@jaynewstrom-stripe jaynewstrom-stripe changed the title Jaynewstrom/elements detach Call new elements/detach endpoint for customer sessions. Dec 18, 2024
@jaynewstrom-stripe jaynewstrom-stripe marked this pull request as ready for review December 18, 2024 19:40
@jaynewstrom-stripe jaynewstrom-stripe requested review from a team as code owners December 18, 2024 19:40
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we do this branching within the detachPaymentMethod function instead of here? ie add a customerSessionClientSecret: String? param to the existing function and call the old endpoint if the client secret is null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't really have a logic layer in StripeApiRepository. It's basically a pure passthrough to the API. So it doesn't really feel right to me.

@jaynewstrom-stripe jaynewstrom-stripe merged commit aeb503c into master Dec 18, 2024
16 checks passed
@jaynewstrom-stripe jaynewstrom-stripe deleted the jaynewstrom/elements-detach branch December 18, 2024 20:03
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