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

Add ElementsSessionContext to Instant Debits flows #9251

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Sep 12, 2024

Summary

This pull request adds an ElementsContext struct to the Instant Debits flow, allowing us to pass in information from the hosting surface.

Right now, this is only used with the LinkMode in Instant Debits flow, but can be extended to more properties and to the ACH flow.

Motivation

BANKCON-14527

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Sep 12, 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 │ +1.7 KiB │   8.6 MiB │   8.6 MiB │ +1.9 KiB 
     arsc │   2.3 MiB │   2.3 MiB │      0 B │   2.3 MiB │   2.3 MiB │      0 B 
 manifest │   5.1 KiB │   5.1 KiB │      0 B │  25.6 KiB │  25.6 KiB │      0 B 
      res │ 933.6 KiB │ 933.6 KiB │      0 B │   1.5 MiB │   1.5 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │     6 MiB │     6 MiB │      0 B 
    asset │   2.9 MiB │   2.9 MiB │    +17 B │   2.9 MiB │   2.9 MiB │    +17 B 
    other │   196 KiB │   196 KiB │    -13 B │ 430.6 KiB │ 430.6 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.8 MiB │  12.8 MiB │ +1.7 KiB │  21.7 MiB │  21.7 MiB │ +1.9 KiB 

 DEX     │ old   │ new   │ diff            
─────────┼───────┼───────┼─────────────────
   files │     1 │     1 │   0             
 strings │ 42624 │ 42629 │  +5 (+12 -7)    
   types │ 14127 │ 14130 │  +3 (+6 -3)     
 classes │ 11765 │ 11767 │  +2 (+2 -0)     
 methods │ 60354 │ 60365 │ +11 (+93 -82)   
  fields │ 40021 │ 40032 │ +11 (+116 -105) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6247 │ 6247 │  0
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  3.9 MiB │ +1.7 KiB │   8.6 MiB │ +1.9 KiB │ ∆ classes.dex                             
  7.9 KiB │    +19 B │   7.7 KiB │    +19 B │ ∆ assets/dexopt/baseline.prof             
 53.4 KiB │    -12 B │ 118.3 KiB │      0 B │ ∆ META-INF/CERT.SF                        
    981 B │     -2 B │     849 B │     -2 B │ ∆ assets/dexopt/baseline.profm            
  1.2 KiB │     -2 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
 50.1 KiB │     +2 B │ 118.2 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
    271 B │     -1 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
    4 MiB │ +1.7 KiB │   8.8 MiB │ +1.9 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff        
  ───────┼───────┼─────────────
   42624 │ 42629 │ +5 (+12 -7) 
  
  + , elementsSessionContext=
  + ElementsSessionContext(linkMode=
  + LN6/g;
  + Ly5/F;
  + VLZLZZLZLLZL
  + VZLLZZZLLLLLL
  + VZLLZZZLLLLLLLLLLL
  + [Ly5/b;
  + [Ly5/l;
  + [Ly5/p;
  + [Ly5/r;
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:38b4d93,r8-mode:full,version:8.5.35}
  
  - VLZLZZLZLLZ
  - VZLZZZLLLLLL
  - VZLZZZLLLLLLLLLLL
  - [Ly5/i;
  - [Ly5/m;
  - [Ly5/q;
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:80bd421,r8-mode:full,version:8.5.35}
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   14127 │ 14130 │ +3 (+6 -3) 
  
  + LN6/g;
  + Ly5/F;
  + [Ly5/b;
  + [Ly5/l;
  + [Ly5/p;
  + [Ly5/r;
  
  - [Ly5/i;
  - [Ly5/m;
  - [Ly5/q;
  

METHODS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   60354 │ 60365 │ +11 (+93 -82) 
  
  + F5.d <init>(A0, u, g, String)
  + F5.e <init>(A0, String, u, g, m, b, int)
  + F7.G <init>(boolean, A0, a, boolean, boolean, boolean, String, String, String, x, a, String)
  + F7.m <init>(boolean, A0, String, boolean, boolean, boolean, String, String, String, a, C, e, c, p0, c, c, c)
  + H5.c <init>(A0, u, g, String, int)
  + I7.J a(a, b)
  + N6.f <clinit>()
  + N6.f a(JSONObject) → i2
  + N6.g <init>(int)
  + N6.g a(JSONObject) → k2
  + N6.g s(JSONObject) → h
  + R6.a <init>(String, b)
  + V6.d <init>(String, String, String, b)
  + V6.j <init>(q, l, d)
  + a.a L(V, A0, g, v, int)
  + a.a S(w1, A0, g, v, int)
  + a.a U(A0, String, u, g, m, b, v, int)
  + a.a d0(A0, u, g, String, v, int)
  + c6.b <init>(a, b)
  + c6.b f() → b
  + c6.d <init>(b)
  + c6.d f() → b
  + c6.m <init>(a, L2, b)
  + com.stripe.android.financialconnections.FinancialConnectionsSheetActivity h() → F
  + j6.i <init>(K, boolean, a, boolean, boolean, l, boolean, FinancialConnectionsSessionManifest_Pane, i, boolean, b)
  + r9.b l(k, A0, g, b, m, v, int)
  + y5.A <init>(F, Intent, d)
  + y5.B <init>(F, d)
  + y5.C <init>(F, d)
  + y5.D <init>(F, s, d)
  + y5.D J(Object, Object) → Object
  + y5.D f(d, Object) → d
  + y5.D h(Object) → Object
  + y5.E <init>(int, Object, Object)
  + y5.E L(Object) → Object
  + y5.F <clinit>()
  + y5.F <init>(String, k0, B, i, i, d, a, l, v, i, P, s)
  + y5.F f(Object) → c
  + y5.F h(F, s, Uri)
  + y5.F i(F, s, h, boolean, int)
  + y5.b <clinit>()
  + y5.b <init>(A0)
  + y5.b describeContents() → int
  + y5.b equals(Object) → boolean
  + y5.b hashCode() → int
  + y5.b toString() → String
  + y5.b writeToParcel(Parcel, int)
  + y5.c <init>(FinancialConnectionsSheetActivity, int)
  + y5.c a(Object)
  + y5.d <init>(FinancialConnectionsSheetActivity, d)
  + y5.e <init>(Y, FinancialConnectionsSheetActivity, p, d)
  + y5.e J(Object, Object) → Object
  + y5.e f(d, Object) → d
  + y5.e h(Object) → Object
  + y5.f <init>(Object, int)
  + y5.g <init>(int, Object, Class, String, String, int, int)
  + y5.g n() → Object
  + y5.h <init>(FinancialConnectionsSheetActivity, int)
  + y5.h J(Object, Object) → Object
  + y5.i n() → Object
  + y5.k <init>(U0, f3)
  + y5.l <clinit>()
  + y5.l <init>(Throwable)
  + y5.l describeContents() → int
  + y5.l equals(Object) → boolean
  + y5.l hashCode() → int
  + y5.l toString() → String
  + y5.l writeToParcel(Parcel, int)
  + y5.o <init>(U0)
  + y5.p <clinit>()
  + y5.p <init>(Throwable)
  + y5.p describeContents() → int
  + y5.p equals(Object) → boolean
  + y5.p hashCode() → int
  + y5.p toString() → String
  + y5.p writeToParcel(Parcel, int)
  + y5.r <clinit>()
  + y5.r valueOf(String) → r
  + y5.r values() → r[]
  + y5.s <init>(d, boolean, h1, r, u)
  + y5.s a(s, boolean, h1, r, u, int) → s
  + y5.t <init>(h, Integer)
  + y5.u <init>(String)
  + y5.v <init>(a, L2, b)
  + y5.v equals(Object) → boolean
  + y5.v hashCode() → int
  + y5.v toString() → String
  + y5.w <clinit>()
  + y5.w <init>(int, int)
  + y5.w L(Object) → Object
  + y5.x <init>(F, s, d)
  + y5.y <init>(F, s, d)
  + y5.z <init>(F, d)
  
  - F5.d <init>(A0, u, f, String)
  - F5.e <init>(A0, String, u, f, m, b, int)
  - F7.G <init>(boolean, a, boolean, boolean, boolean, String, String, String, x, a, String)
  - F7.m <init>(boolean, String, boolean, boolean, boolean, String, String, String, a, C, e, c, p0, c, c, c)
  - H5.c <init>(A0, u, f, String, int)
  - I7.J a(a)
  - N6.e a(JSONObject) → i2
  - N6.e s(JSONObject) → h

...✂

@tillh-stripe tillh-stripe changed the base branch from master to tillh/instant-debit-fixes September 12, 2024 18:34
Base automatically changed from tillh/instant-debit-fixes to master September 12, 2024 19:31
@tillh-stripe tillh-stripe force-pushed the tillh/fc-intent-context branch 5 times, most recently from b63d623 to ddc679b Compare September 16, 2024 18:27
@tillh-stripe tillh-stripe changed the title Add IntentContext to FC flows Add ElementsContext to FC flows Sep 16, 2024
@tillh-stripe tillh-stripe changed the title Add ElementsContext to FC flows Add ElementsContext to Instant Debits flows Sep 16, 2024
@tillh-stripe tillh-stripe force-pushed the tillh/fc-intent-context branch 8 times, most recently from 8d24abf to b456e95 Compare September 23, 2024 14:41
@tillh-stripe tillh-stripe changed the base branch from master to tillh/link-synthetic-payment-method September 23, 2024 14:41
@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch from b0f7a69 to 25696f1 Compare September 23, 2024 20:00
Base automatically changed from tillh/link-synthetic-payment-method to master September 23, 2024 20:21
@tillh-stripe tillh-stripe force-pushed the tillh/fc-intent-context branch 4 times, most recently from 0e0404c to f255410 Compare September 25, 2024 13:40
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe left a comment

Choose a reason for hiding this comment

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

Love this approach! it scales (both for adding more context to elements, or following the same approach for new contexts if needed). Just a minor comment.

Comment on lines 282 to 284
private fun CollectBankAccountConfiguration.retrieveElementsContext(): ElementsContext? {
return (this as? InstantDebits)?.elementsContext
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above : )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is a little trickier, since CollectBankAccountConfiguration.USBankAccount is public. Good if we revisit this later this year for the next major version bump?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sounds good! When we do that ideally we also move it out of the configuration object (that intends to be public facing) and follow the Args pattern we do on FC 😄

- Rename `ElementsContext` to `ElementsSessionContext`
- Require the context on `FinancialConnectionsSheetActivityArgs`
@tillh-stripe tillh-stripe marked this pull request as ready for review September 26, 2024 14:40
@tillh-stripe tillh-stripe requested review from a team as code owners September 26, 2024 14:40
@tillh-stripe tillh-stripe changed the title Add ElementsContext to Instant Debits flows Add ElementsSessionContext to Instant Debits flows Sep 26, 2024
@tillh-stripe tillh-stripe merged commit 974dbf7 into master Sep 26, 2024
16 checks passed
@tillh-stripe tillh-stripe deleted the tillh/fc-intent-context branch September 26, 2024 18:17
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