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 us_bank_account LPM filter #6687

Merged
merged 4 commits into from
May 23, 2023

Conversation

jameswoo-stripe
Copy link
Contributor

@jameswoo-stripe jameswoo-stripe commented May 5, 2023

Summary

  • Changes the logic to show or hide the us_bank_account payment method
  • Add LPM filter for us_bank_account, specifically for its requested verification method. If the desired verification method is instant or automatic, as described in the docs, then we can display the payment method, hide it otherwise.

Can verify this with your own server.

// Create the PaymentIntent
args.payment_method_options = {
  us_bank_account: {
    verification_method: 'instant', // or microdeposits
    financial_connections: {permissions: ['payment_method', 'balances']},
  },
}
const paymentIntent = await stripe.paymentIntents.create(args, headers);

Motivation

Hide the payment method when verification method is microdeposits as this would cause the user to not be able to complete payment.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Changelog

  • [Changed] Show the US Bank Account payment method if the specified verification method is either automatic or instant, otherwise, hide the payment method.

@jameswoo-stripe jameswoo-stripe requested review from a team as code owners May 5, 2023 21:11
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/lpm-us-bank-account-filter branch from d399d8f to 26b9f08 Compare May 5, 2023 21:12
@jameswoo-stripe jameswoo-stripe requested review from tillh-stripe and jaynewstrom-stripe and removed request for carlosmuvi-stripe May 5, 2023 21:13
@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/lpm-us-bank-account-filter branch from 26b9f08 to cf475d3 Compare May 5, 2023 21:18
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

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.4 MiB │   3.4 MiB │ +194 B │   7.5 MiB │   7.5 MiB │ +396 B 
     arsc │   2.1 MiB │   2.1 MiB │    0 B │   2.1 MiB │   2.1 MiB │    0 B 
 manifest │   4.6 KiB │   4.6 KiB │    0 B │  22.5 KiB │  22.5 KiB │    0 B 
      res │   869 KiB │   869 KiB │    0 B │   1.3 MiB │   1.3 MiB │    0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │     6 MiB │     6 MiB │    0 B 
    asset │     3 MiB │     3 MiB │  -15 B │     3 MiB │     3 MiB │  -15 B 
    other │ 199.7 KiB │ 199.7 KiB │  -13 B │ 446.8 KiB │ 446.8 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  12.1 MiB │  12.1 MiB │ +166 B │  20.4 MiB │  20.4 MiB │ +381 B 

 DEX     │ old   │ new   │ diff         
─────────┼───────┼───────┼──────────────
   files │     1 │     1 │  0           
 strings │ 36364 │ 36364 │  0 (+2 -2)   
   types │ 12064 │ 12064 │  0 (+0 -0)   
 classes │ 10164 │ 10164 │  0 (+0 -0)   
 methods │ 53723 │ 53726 │ +3 (+70 -67) 
  fields │ 34150 │ 34151 │ +1 (+1 -0)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  291 │  291 │  0   
 entries │ 6943 │ 6943 │  0
APK
    compressed     │    uncompressed    │                               
──────────┬────────┼───────────┬────────┤                               
 size     │ diff   │ size      │ diff   │ path                          
──────────┼────────┼───────────┼────────┼───────────────────────────────
  3.4 MiB │ +194 B │   7.5 MiB │ +396 B │ ∆ classes.dex                 
  6.4 KiB │  -15 B │   6.2 KiB │  -15 B │ ∆ assets/dexopt/baseline.prof 
 62.7 KiB │  -10 B │ 140.9 KiB │    0 B │ ∆ META-INF/CERT.SF            
 48.4 KiB │   -2 B │ 140.8 KiB │    0 B │ ∆ META-INF/MANIFEST.MF        
  1.2 KiB │   -1 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA           
──────────┼────────┼───────────┼────────┼───────────────────────────────
  3.5 MiB │ +166 B │   7.7 MiB │ +381 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   36364 │ 36364 │ 0 (+2 -2) 
  + VLIJLLLZLLLLLLLLLL
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:1252dd9,r8-mode:full,version:8.0.40}
  
  - VLIJLLLZLLLLLLLLL
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:b38e07d,r8-mode:full,version:8.0.40}
  

METHODS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   53723 │ 53726 │ +3 (+70 -67) 
  + b1.f0 o(g0, g0, g0) → g0
  + b1.t o(g0, g0, g0) → g0
  + b1.w o(g0, g0, g0) → g0
  + hc.a1 s() → List
  + hc.a1 u() → String
  + hc.b1 s() → List
  + hc.b1 u() → String
  + hc.g5 m() → Map
  + hc.g5 p() → u2
  + hc.g5 q() → boolean
  + hc.g5 t() → boolean
  + hc.g5 v() → List
  + hc.m r() → String
  + hc.m x(String)
  + hc.m y() → o
  + hc.n r() → String
  + hc.n x(String)
  + hc.n y() → o
  + hc.o r() → String
  + hc.o x(String)
  + hc.o y() → o
  + hc.p3 <init>(String, int, long, String, String, String, boolean, u2, String, List, StripeIntent_Status, StripeIntent_Usage, o3, List, ArrayList, f5, String)
  + hc.p3 m() → Map
  + hc.p3 p() → u2
  + hc.p3 q() → boolean
  + hc.p3 t() → boolean
  + hc.p3 v() → List
  + hc.s0 n() → String
  + hc.s0 w() → StripeIntent_Usage
  + hc.t0 n() → String
  + hc.t0 w() → StripeIntent_Usage
  + hc.u0 n() → String
  + hc.u0 w() → StripeIntent_Usage
  + hc.w1 m() → Map
  + hc.w1 p() → u2
  + hc.w1 q() → boolean
  + hc.w1 t() → boolean
  + hc.w1 v() → List
  + hc.y0 s() → List
  + hc.y0 u() → String
  + hc.z0 s() → List
  + hc.z0 u() → String
  + pc.a o() → String
  + pc.b o() → String
  + pc.c o() → String
  + pc.d o() → String
  + pc.e o() → String
  + s0.i2 o(g0, g0, g0) → g0
  + s0.m0 o(g0, g0, g0) → g0
  + td.l o() → h3
  + td.m o() → h3
  + td.n o() → h3
  + td.o o() → h3
  + td.p o() → h3
  + vc.d A() → String
  + vc.d B(Integer)
  + vc.d o() → String
  + vc.d z() → Integer
  + vc.e A() → String
  + vc.e B(Integer)
  + vc.e o() → String
  + vc.e z() → Integer
  + vc.f A() → String
  + vc.f B(Integer)
  + vc.f o() → String
  + vc.f z() → Integer
  + vc.g A() → String
  + vc.g B(Integer)
  + vc.g o() → String
  + vc.g z() → Integer
  
  - b1.f0 n(g0, g0, g0) → g0
  - b1.t n(g0, g0, g0) → g0
  - b1.w n(g0, g0, g0) → g0
  - hc.a1 r() → List
  - hc.a1 t() → String
  - hc.b1 r() → List
  - hc.b1 t() → String
  - hc.g5 o() → u2
  - hc.g5 p() → boolean
  - hc.g5 s() → boolean
  - hc.g5 u() → List
  - hc.m q() → String
  - hc.m w(String)
  - hc.m x() → o
  - hc.n q() → String
  - hc.n w(String)
  - hc.n x() → o
  - hc.o q() → String
  - hc.o w(String)
  - hc.o x() → o
  - hc.p3 <init>(String, int, long, String, String, String, boolean, u2, String, List, StripeIntent_Status, StripeIntent_Usage, o3, List, ArrayList, f5)
  - hc.p3 o() → u2
  - hc.p3 p() → boolean
  - hc.p3 s() → boolean
  - hc.p3 u() → List
  - hc.s0 m() → String
  - hc.s0 v() → StripeIntent_Usage
  - hc.t0 m() → String
  - hc.t0 v() → StripeIntent_Usage
  - hc.u0 m() → String
  - hc.u0 v() → StripeIntent_Usage
  - hc.w1 o() → u2
  - hc.w1 p() → boolean
  - hc.w1 s() → boolean
  - hc.w1 u() → List
  - hc.y0 r() → List
  - hc.y0 t() → String
  - hc.z0 r() → List
  - hc.z0 t() → String
  - pc.a n() → String
  - pc.b n() → String
  - pc.c n() → String
  - pc.d n() → String
  - pc.e n() → String
  - s0.i2 n(g0, g0, g0) → g0
  - s0.m0 n(g0, g0, g0) → g0
  - td.l n() → h3
  - td.m n() → h3
  - td.n n() → h3
  - td.o n() → h3
  - td.p n() → h3
  - vc.d A(Integer)
  - vc.d n() → String
  - vc.d y() → Integer
  - vc.d z() → String
  - vc.e A(Integer)
  - vc.e n() → String
  - vc.e y() → Integer
  - vc.e z() → String
  - vc.f A(Integer)
  - vc.f n() → String
  - vc.f y() → Integer
  - vc.f z() → String
  - vc.g A(Integer)
  - vc.g n() → String
  - vc.g y() → Integer
  - vc.g z() → String
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   34150 │ 34151 │ +1 (+1 -0) 
  + hc.p3 z: String

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/lpm-us-bank-account-filter branch from cf475d3 to d801806 Compare May 22, 2023 23:20
@@ -3157,7 +3157,7 @@ public final class com/stripe/android/model/PaymentIntent : com/stripe/android/m
public fun getNextActionType ()Lcom/stripe/android/model/StripeIntent$NextActionType;
public fun getPaymentMethod ()Lcom/stripe/android/model/PaymentMethod;
public fun getPaymentMethodId ()Ljava/lang/String;
public final fun getPaymentMethodOptions ()Ljava/util/Map;
public fun getPaymentMethodOptions ()Ljava/util/Map;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can keep this final.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PaymentIntent is already final, so this method cannot be overriden.

@jameswoo-stripe jameswoo-stripe force-pushed the jameswoo/lpm-us-bank-account-filter branch from 6d4123f to a806309 Compare May 23, 2023 06:16
@jameswoo-stripe jameswoo-stripe merged commit 3e17ce0 into master May 23, 2023
9 checks passed
@jameswoo-stripe jameswoo-stripe deleted the jameswoo/lpm-us-bank-account-filter branch May 23, 2023 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.

None yet

3 participants