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

Remove local feature flag for Instant Debits #8418

Merged

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented May 3, 2024

Summary

This pull request removes the local feature flag for Instant Debits, as we merged the server-side feature flag.

We keep the EnableInstantDebitsSettingsDefinition to easily allow testing in the playground.

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog


override fun valueUpdated(value: Boolean, playgroundSettings: PlaygroundSettings) {
FeatureFlags.instantDebits.setEnabled(value)
checkoutRequestBuilder.supportedPaymentMethods(listOf("card", "link"))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Allow Instant Debits by only requesting card and link, but not us_bank_account. This still needs a merchant that supports Instant Debits.

Copy link
Contributor

github-actions bot commented May 3, 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 │ -377 B │   8.6 MiB │   8.6 MiB │ -580 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 │  25.2 KiB │  25.2 KiB │    0 B 
      res │ 907.5 KiB │ 907.5 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 │   2.9 MiB │   2.9 MiB │   +2 B │   2.9 MiB │   2.9 MiB │   +2 B 
    other │   194 KiB │   194 KiB │   +5 B │ 423.6 KiB │ 423.6 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  12.7 MiB │  12.7 MiB │ -370 B │  21.6 MiB │  21.6 MiB │ -578 B 

 DEX     │ old   │ new   │ diff           
─────────┼───────┼───────┼────────────────
   files │     1 │     1 │  0             
 strings │ 42995 │ 42991 │ -4 (+7 -11)    
   types │ 14758 │ 14756 │ -2 (+6 -8)     
 classes │ 12462 │ 12460 │ -2 (+0 -2)     
 methods │ 61033 │ 61025 │ -8 (+196 -204) 
  fields │ 40291 │ 40289 │ -2 (+72 -74)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6028 │ 6028 │  0
APK
    compressed     │    uncompressed    │                                           
──────────┬────────┼───────────┬────────┤                                           
 size     │ diff   │ size      │ diff   │ path                                      
──────────┼────────┼───────────┼────────┼───────────────────────────────────────────
  3.9 MiB │ -377 B │   8.6 MiB │ -580 B │ ∆ classes.dex                             
 52.7 KiB │   +6 B │ 116.7 KiB │    0 B │ ∆ META-INF/CERT.SF                        
  7.4 KiB │   +2 B │   7.2 KiB │   +2 B │ ∆ assets/dexopt/baseline.prof             
 49.4 KiB │   -2 B │ 116.6 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
    272 B │   +1 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
──────────┼────────┼───────────┼────────┼───────────────────────────────────────────
    4 MiB │ -370 B │   8.8 MiB │ -578 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff        
  ───────┼───────┼─────────────
   42995 │ 42991 │ -4 (+7 -11) 
  
  + [LP6/H;
  + [LP6/J;
  + [LP6/O;
  + [LP6/T;
  + [LP6/e0;
  + [LW4/g;
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:6c66146,r8-mode:full,version:8.3.37}
  
  - Enable Instant Debits
  - LP6/f0;
  - LW4/k;
  - [LP6/I;
  - [LP6/K;
  - [LP6/Q;
  - [LP6/U;
  - [LP6/f0;
  - [LW4/h;
  - enableInstantDebits
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:fc2d0c6,r8-mode:full,version:8.3.37}
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   14758 │ 14756 │ -2 (+6 -8) 
  
  + [LP6/H;
  + [LP6/J;
  + [LP6/O;
  + [LP6/T;
  + [LP6/e0;
  + [LW4/g;
  
  - LP6/f0;
  - LW4/k;
  - [LP6/I;
  - [LP6/K;
  - [LP6/Q;
  - [LP6/U;
  - [LP6/f0;
  - [LW4/h;
  

METHODS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   61033 │ 61025 │ -8 (+196 -204) 
  
  + C4.d o(b0)
  + C4.h o(b0)
  + C4.w o(b0)
  + C7.a Z0(String, Object) → O
  + F6.A c(String) → W
  + G6.k G(P, W, k, int)
  + G6.k I(W, k, int)
  + M6.A <init>(V, long, List, Y0, String)
  + M6.m <init>(PaymentSheetPlaygroundActivity, W, int, int)
  + M6.y <init>(W, z, e)
  + P6.B b(Object, W)
  + P6.B f(Object, T0, A, Q)
  + P6.B h() → S
  + P6.D f(Object, T0, A, Q)
  + P6.D k(boolean, T0, A, Q)
  + P6.E <init>(String, e0, e0[])
  + P6.E a(String) → e0
  + P6.E d(String) → Object
  + P6.E e()
  + P6.E g(Object) → String
  + P6.E getKey() → String
  + P6.F <clinit>()
  + P6.F a() → String
  + P6.F b(Object, W)
  + P6.F c() → Object
  + P6.F f(Object, T0, A, Q)
  + P6.F h() → S
  + P6.F i(Object, b)
  + P6.F j() → List
  + P6.G f(Object, T0, A, Q)
  + P6.G k(boolean, T0, A, Q)
  + P6.H <init>(String, int, String)
  + P6.H getValue() → String
  + P6.H valueOf(String) → H
  + P6.H values() → H[]
  + P6.I <init>()
  + P6.I a() → String
  + P6.I b(Object, W)
  + P6.I c() → Object
  + P6.I d(String) → Object
  + P6.I e()
  + P6.I f(Object, T0, A, Q)
  + P6.I g(Object) → String
  + P6.I getKey() → String
  + P6.I h() → S
  + P6.I i(Object, b)
  + P6.I j() → List
  + P6.J <init>(String, int, String)
  + P6.J getValue() → String
  + P6.J valueOf(String) → J
  + P6.J values() → J[]
  + P6.K <init>()
  + P6.K a() → String
  + P6.K b(Object, W)
  + P6.K c() → Object
  + P6.K d(String) → Object
  + P6.K e()
  + P6.K f(Object, T0, A, Q)
  + P6.K g(Object) → String
  + P6.K getKey() → String
  + P6.K h() → S
  + P6.K i(Object, b)
  + P6.K j() → List
  + P6.L l(boolean, b)
  + P6.M a() → String
  + P6.M b(Object, W)
  + P6.M c() → Object
  + P6.M d(String) → Object
  + P6.M e()
  + P6.M f(Object, T0, A, Q)
  + P6.M g(Object) → String
  + P6.M getKey() → String
  + P6.M h() → S
  + P6.M j() → List
  + P6.N b(Object, W)
  + P6.N f(Object, T0, A, Q)
  + P6.N h() → S
  + P6.O <init>(String, Object)
  + P6.O equals(Object) → boolean
  + P6.O hashCode() → int
  + P6.O toString() → String
  + P6.P a() → String
  + P6.P j() → List
  + P6.Q <init>(T0)
  + P6.Q a(c)
  + P6.Q equals(Object) → boolean
  + P6.Q hashCode() → int
  + P6.Q toString() → String
  + P6.S d(String) → Object
  + P6.S e()
  + P6.S g(Object) → String
  + P6.S getKey() → String
  + P6.T b(Object, W)
  + P6.T c() → Object
  + P6.T f(Object, T0, A, Q)
  + P6.T h() → S
  + P6.T i(Object, b)
  + P6.U <clinit>()
  + P6.U <init>(int)
  + P6.U K(Object) → Object
  + P6.U a(T) → Boolean
  + P6.V <init>(W)
  + P6.V a(U) → String
  + P6.V b() → g
  + P6.V c(T) → Object
  + P6.W <clinit>()
  + P6.W <init>(LinkedHashMap)
  + P6.W a(T, Object)
  + P6.X f(Object, T0, A, Q)
  + P6.X k(boolean, T0, A, Q)
  + P6.Y a() → String
  + P6.Y b(Object, W)
  + P6.Y c() → Object
  + P6.Y d(String) → Object
  + P6.Y e()
  + P6.Y f(Object, T0, A, Q)
  + P6.Y g(Object) → String
  + P6.Y getKey() → String
  + P6.Y h() → S
  + P6.Y i(Object, b)
  + P6.Y j() → List
  + P6.Z <init>(String, int)
  + P6.Z F(Object, Object) → Object
  + P6.Z a(k, int)
  + P6.a0 <init>(String, List, Object, c, int, int)
  + P6.a f(Object, T0, A, Q)
  + P6.a k(boolean, T0, A, Q)
  + P6.b0 <init>(int, Object, Object)
  + P6.b0 K(Object) → Object
  + P6.b0 a(int)
  + P6.b0 b(p)
  + P6.b0 c(Throwable)
  + P6.b0 d(boolean)
  + P6.b b(Object, W)
  + P6.b f(Object, T0, A, Q)
  + P6.b h() → S
  + P6.c0 <clinit>()
  + P6.c0 b(Object, W)
  + P6.c0 c() → Object
  + P6.c0 f(Object, T0, A, Q)
  + P6.c0 h() → S
  + P6.c0 i(Obje
...✂

@tillh-stripe tillh-stripe force-pushed the tillh/remove-local-feature-flag-for-instant-debits branch 4 times, most recently from a864e9c to 468565f Compare May 6, 2024 20:05
@@ -64,8 +63,7 @@ internal enum class AddPaymentMethodRequirement {
val noUsBankAccount = USBankAccount.code !in paymentMethodTypes
val supportsBankAccounts = "bank_account" in metadata.stripeIntent.linkFundingSources
val isDeferred = metadata.stripeIntent.clientSecret == null
val isEnabled = FeatureFlags.instantDebits.isEnabled
return noUsBankAccount && supportsBankAccounts && !isDeferred && isEnabled
return noUsBankAccount && supportsBankAccounts && !isDeferred
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 no longer need a feature flag, as the bank_account funding source is now only included if the request comes from a supported client version (or from an explicitly-enabled merchant account).

@tillh-stripe tillh-stripe marked this pull request as ready for review May 6, 2024 20:07
@tillh-stripe tillh-stripe requested review from a team as code owners May 6, 2024 20:07
override fun valueUpdated(value: Boolean, playgroundSettings: PlaygroundSettings) {
FeatureFlags.instantDebits.setEnabled(value)
if (value) {
checkoutRequestBuilder.supportedPaymentMethods(listOf("card", "link"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if we should do this differently.

Should we add this as it's own SettingsDefinition? Otherwise this could clash with another SettingsDefinition, since we set this elsewhere too, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I can tell, the SupportedPaymentMethodsSettingsDefinition is only used in tests, so we wouldn’t have any conflicts right now.

Should we add this as it's own SettingsDefinition?

Can you elaborate what you have in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm suggesting we remove EnableInstantDebitsSettingsDefinition, and add SupportedPaymentMethodsSettingsDefinition to uiSettingDefinitions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

opened this based on Jay's suggestion. Also if multi choice is supported on PaymentSheet settings at some point we can migrate the comma separated string to some payment method picker (this is how we do multichoice on Financial Connections)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rebased onto Carlos’ pull request!

@tillh-stripe tillh-stripe force-pushed the tillh/remove-local-feature-flag-for-instant-debits branch from 468565f to d11cd61 Compare May 9, 2024 13:22
@tillh-stripe tillh-stripe merged commit a65f507 into master May 9, 2024
15 checks passed
@tillh-stripe tillh-stripe deleted the tillh/remove-local-feature-flag-for-instant-debits branch May 9, 2024 13:51
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.

None yet

3 participants