这是indexloc提供的服务,不要输入任何密码
Skip to content

Link signup toggle in FlowController #11199

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 18 commits into
base: master
Choose a base branch
from

Conversation

carlosmuvi-stripe
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe commented Jul 24, 2025

Summary

  • Adds SignupToLink toggle state to FlowController
  • Adds SignupForLink usecase that creates account + adds payment details if toggle enabled
record1.webm
image image

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Jul 24, 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 │ +6.9 KiB │  10.4 MiB │  10.4 MiB │   +14 KiB 
     arsc │  2.5 MiB │  2.5 MiB │ +1.4 KiB │   2.5 MiB │   2.5 MiB │  +1.4 KiB 
 manifest │  5.8 KiB │  5.8 KiB │      0 B │  30.1 KiB │  30.1 KiB │       0 B 
      res │  918 KiB │  918 KiB │     -1 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 │     +4 B │   1.6 MiB │   1.6 MiB │      +4 B 
    other │  198 KiB │  198 KiB │    +16 B │ 373.9 KiB │ 373.9 KiB │       0 B 
──────────┼──────────┼──────────┼──────────┼───────────┼───────────┼───────────
    total │ 13.5 MiB │ 13.5 MiB │ +8.3 KiB │  24.9 MiB │  24.9 MiB │ +15.4 KiB 

         │         raw          │              unique               
         ├───────┬───────┬──────┼───────┬───────┬───────────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff              
─────────┼───────┼───────┼──────┼───────┼───────┼───────────────────
   files │     2 │     2 │    0 │       │       │                   
 strings │ 53170 │ 53258 │  +88 │ 49313 │ 49378 │ +65 (+100 -35)    
   types │ 19099 │ 19133 │  +34 │ 17178 │ 17201 │ +23 (+55 -32)     
 classes │ 14516 │ 14532 │  +16 │ 14516 │ 14532 │ +16 (+22 -6)      
 methods │ 73933 │ 74018 │  +85 │ 70996 │ 71079 │ +83 (+2543 -2460) 
  fields │ 48170 │ 48175 │   +5 │ 47046 │ 47039 │  -7 (+1744 -1751) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  242 │  242 │  0         
 entries │ 6329 │ 6331 │ +2 (+2 -0)
APK
      compressed      │     uncompressed      │                                
───────────┬──────────┼───────────┬───────────┤                                
 size      │ diff     │ size      │ diff      │ path                           
───────────┼──────────┼───────────┼───────────┼────────────────────────────────
   4.2 MiB │ +6.2 KiB │   9.3 MiB │ +12.9 KiB │ ∆ classes.dex                  
   2.5 MiB │ +1.4 KiB │   2.5 MiB │  +1.4 KiB │ ∆ resources.arsc               
 483.2 KiB │   +693 B │   1.1 MiB │  +1.2 KiB │ ∆ classes2.dex                 
  51.4 KiB │    +11 B │ 121.7 KiB │       0 B │ ∆ META-INF/MANIFEST.MF         
   9.3 KiB │     +9 B │   9.1 KiB │      +9 B │ ∆ assets/dexopt/baseline.prof  
   1.1 KiB │     -5 B │     1 KiB │      -5 B │ ∆ assets/dexopt/baseline.profm 
  54.8 KiB │     +5 B │ 121.7 KiB │       0 B │ ∆ META-INF/CERT.SF             
     844 B │     -1 B │   1.8 KiB │       0 B │ ∆ res/8Q.xml                   
     947 B │     -1 B │   2.5 KiB │       0 B │ ∆ res/de.xml                   
   1.1 KiB │     +1 B │   3.3 KiB │       0 B │ ∆ res/nn.xml                   
───────────┼──────────┼───────────┼───────────┼────────────────────────────────
   7.4 MiB │ +8.3 KiB │  13.2 MiB │ +15.4 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   49313 │ 49378 │ +65 (+100 -35) 
  
  + , termsAndConditions=
  + -black
  + -light
  + -medium
  + -thin
  + <ContentHandlerReplacementTag />
  + ContentHandlerReplacementTag
  + FontFamily.Cursive
  + FontFamily.Monospace
  + FontFamily.SansSerif
  + FontFamily.Serif
  + LS8/E;
  + LS8/F;
  + LS8/G;
  + Landroid/text/style/AlignmentSpan;
  + Landroid/text/style/SubscriptSpan;
  + Landroid/text/style/SuperscriptSpan;
  + Lg9/P2;
  + Lg9/Q2;
  + Lorg/xml/sax/Attributes;
  + Lorg/xml/sax/ContentHandler;
  + Lorg/xml/sax/Locator;
  + Lorg/xml/sax/XMLReader;
  + Lq8/D2;
  + Lq8/E2;
  + Lq8/F2;
  + Lt8/G;
  + Lu1/P;
  + Lu1/Q;
  + Lu1/S;
  + Lu1/T;
  + Lu1/U;
  + Lz1/O;
  + Lz1/P;
  + Lz1/Q;
  + Lz1/S;
  + Lz1/T;
  + Lz3/c;
  + Lz3/d;
  + Lz8/z0;
  + VIIJLI
  + VLLLLLLLLLLLLLLLLLLLLLLLL
  + VLLLLLLLLLLLLLLLLLZLLLLLZL
  + Visible(title=
  + [Lb8/L;
  + [Lb8/f;
  + [Lb8/t;
  + [Lg9/R0;
  + [Lg9/q2;
  + [Lg9/r2;
  + [Lg9/v2;
  + [Lq8/E2;
  + [Lq8/F2;
  + [Lq8/G1;
  + [Lq8/I1;
  + [Lq8/K1;
  + [Lq8/P1;
  + [Lq8/m1;
  + [Lq8/v1;
  + [Lq8/w1;
  + [Lq8/x1;
  + [Lu1/j;
  + [Ly7/r;
  + [Ly9/d;
  + [Ly9/g;
  + [Ly9/h;
  + [Ly9/l;
  + [Lz1/E;
  + [Lz1/L;
  + [Lz8/w0;
  + cursive
  + endElement
  + endPrefixMapping
  + flowControllerState
  + getAlignment
  + getBackgroundColor
  + getContentHandler
  + getFamily
  + getLocalName
  + getSizeChange
  + handleTag
  + ignorableWhitespace
  + link.new_user_signup_api.payment_detail_creation_failure
  + link.new_user_signup_api.payment_detail_creation_success
  + link.new_user_signup_api.signup_failure
  + link.new_user_signup_api.signup_success
  + link_enable_new_user_signup_api
  + monospace
  + processingInstruction
  + serif
  + setContentHandler
  + setDocumentLocator
  + signupForLink
  + signupToLinkToggleInteractor
  + skippedEntity
  + startElement
  + startPrefixMapping
  + termsAndConditions
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"9f2c101","r8-mode":"full","version":"8.8.34"}
  + link_new_user_signup_api_initial_value
  
  - Lb8/b0;
  - Ly7/s;
  - Ly8/z;
  - Ly9/m;
  - Ly9/n;
  - Ly9/o;
  - VLLLLLLLLLLLLLLLLLLLLLL
  - VLLLLLLLLLLLLLLLLLZLLLZL
  - [Lb8/M;
  - [Lb8/h;
  - [Lb8/u;
  - [Lg9/P0;
  - [Lg9/n2;
  - [Lg9/o2;
  - [Lg9/t2;
  - [Lq8/B1;
  - [Lq8/B2;
  - [Lq8/C1;
  - [Lq8/C2;
  - [Lq8/D1;
  - [Lq8/M1;
  - [Lq8/c1;
  - [Lq8/d1;
  - [Lq8/e1;
  - [Lq8/p1;
  - [Lu1/h;
  - [Ly7/s;
  - [Ly9/f;
  - [Ly9/m;
  - [Ly9/n;
  - [Ly9/o;
  - [Lz1/A;
  - [Lz1/H;
  - [Lz8/t0;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"b89df0e","r8-mode":"full","version":"8.8.34"}
  

TYPES:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   17178 │ 17201 │ +23 (+55 -32) 
  
  + LS8/E;
  + LS8/F;
  + LS8/G;
  + Landroid/text/style/AlignmentSpan;
  + Landroid/text/style/SubscriptSpan;
  + Landroid/text/style/SuperscriptSpan;
  + Lg9/P2;
  + Lg9/Q2;
  + Lorg/xml/sax/Attributes;
  + Lorg/xml/sax/ContentHandler;
  + Lorg/xml/sax/Locator;
  + Lorg/xml/sax/XMLReader;
  + Lq8/D2;
  + Lq8/E2;
  + Lq8/F2;
  + Lt8/G;
  + Lu1/P;
  + Lu1/Q;
  + Lu1/S;
  + Lu1/T;
  + Lu1/U;
  + Lz1/O;
  + Lz1/P;
  + Lz1/Q;
  + Lz1/S;
  + Lz1/T;
  + Lz3/c;
  + Lz3/d;
  + Lz8/z0;
  + [Lb8/L;
  + [Lb8/f;
  + [Lb8/t;
  + [Lg9/R0;
  + [Lg9/q2;
  + [Lg9/r2;
  + [Lg9/v2;
  + [Lq8/E2;
  + [Lq8/F2;
  + [Lq8/G1;
  + [Lq8/I1;
  + [Lq8/K1;
  + [Lq8/P1;
  + [Lq8/m1;
  + [Lq8/v1;
  + [Lq8/w1;
  + [Lq8/x1;
  + [Lu1/j;
  + [Ly7/r;
  + [Ly9/d;
  + [Ly9/g;
  + [Ly9/h;
  + [Ly9/l;
  + [Lz1/E;
  + [Lz1/L;
  + [Lz8/w0;
  
  - Lb8/b0;
  - Ly7/s;
  - Ly8/z;
  - Ly9/m;
  - Ly9/n;
  - Ly9/o;
  - [Lb8/M;
  - [Lb8/h;
  - [Lb8/u;
  - [Lg9/P0;
  - [Lg9/n2;
  - [Lg9/o2;
  - [Lg9/t2;
  - [Lq8/B1;
  - [Lq8/B2;
  - [Lq8/C1;
  - [Lq8/C2;
  - [Lq8/D1;
  - [Lq8/M1;
  - [Lq8/c1;
  - [Lq8/d1;
  - [Lq8/e1;
  - [Lq8/p1;
  - [Lu1/h;
  - [Ly7/s;
  - [Ly9/f;
  - [Ly9/m;
  - [Ly9/n;
  - [Ly9/o;
  - [Lz1/A;
  - [Lz1/H;
  - [Lz8/t0;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   70996 │ 71079 │ +83 (+2543 -2460) 
  
  + A.l <init>(N, boolean)
  + A0.p1 <init>(T, p1)
  + A1.D <init>(String, long, Q)
  + A1.D <init>(f, long, Q)
  + A1.H b(D, w, N, N0, d, d)
  + A1.c a(CursorAnchorInfo_Builder, N, d) → CursorAnchorInfo_Builder
  + A1.k c() → Q
  + A1.m <init>(int, int, int, N)
  + A1.y b(D, w, N, N0, d, d)
  + A3.b Z(C
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6329 │ 6331 │ +2 (+2 -0) 
  + string/stripe_link_signup_toggle_description
  + string/stripe_link_signup_toggle_title

@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/signup-link-toggle branch from d36f94b to 2aa61ef Compare July 24, 2025 06:25
Comment on lines +8 to +13
internal interface SignupToLinkToggleStringProvider {
val title: String
val description: String
val termsAndConditions: AnnotatedString
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

abstraction to avoid injecting the application in the interactor.

@carlosmuvi-stripe carlosmuvi-stripe changed the title [WIP Link signup toggle Link signup toggle Jul 25, 2025
@carlosmuvi-stripe carlosmuvi-stripe changed the title Link signup toggle Link signup toggle in FlowController Jul 25, 2025
Comment on lines +338 to +339
@Composable
private fun LinkSignupToggle(flowController: PaymentSheet.FlowController) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mock view showcasing how the merchant would integrate this.

- Extract SignupToLinkToggleStringProvider interface and implementation
- Move Android string resource access from interactor to string provider
- Use AnnotatedString.fromHtml() with placeholder tag replacement
- Update dependency injection in FlowControllerModule
- Simplify tests by removing Android mocking requirements
- Fix code style issues (ktlint, detekt)
- Remove handleToggleChange from SignupToLinkToggleInteractor interface
- Remove implementation from DefaultSignupToLinkToggleInteractor
- Remove implementation from FakeSignupToLinkToggleInteractor
- Remove associated unit tests that used the deprecated method
- Update PaymentSheetPlaygroundActivity to use direct flow value assignment instead of toggle/setToggle pattern
- Fix ktlint formatting issues
- Updated LinkAuth.signUp() to accept nullable phone and country
- Updated LinkAccountManager and LinkRepository layers for nullable support
- Removed UserInput.SignUpOptionalPhone and updated SignupForLink to use UserInput.SignUp
- Added test coverage for link_enable_new_user_signup_api flag on/off scenarios
- Country can now be inferred from phone number when not explicitly provided
@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/signup-link-toggle branch from 15b0a4d to 0304fe2 Compare July 25, 2025 20:28
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