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 fraud detection in FC module #9372

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Oct 1, 2024

Summary

This pull request adds fraud detection data to PaymentMethod-related API calls in the Financial Connections module, namely the calls to /payment_methods and /payment_details/share.

Motivation

BANKCON-15002

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

@tillh-stripe tillh-stripe force-pushed the tillh/move-fraud-detection-to-stripe-core branch from 8c953d9 to 07968b0 Compare October 1, 2024 13:27
@tillh-stripe tillh-stripe force-pushed the tillh/add-fraud-detection-to-fc branch 2 times, most recently from 2bd9582 to 348433f Compare October 1, 2024 13:32
@tillh-stripe tillh-stripe force-pushed the tillh/move-fraud-detection-to-stripe-core branch from 07968b0 to f5ca7d5 Compare October 1, 2024 13:53
@tillh-stripe tillh-stripe force-pushed the tillh/add-fraud-detection-to-fc branch from 348433f to a942e43 Compare October 1, 2024 13:54
Base automatically changed from tillh/move-fraud-detection-to-stripe-core to master October 1, 2024 17:46
@tillh-stripe tillh-stripe force-pushed the tillh/add-fraud-detection-to-fc branch 2 times, most recently from 0c0e57f to b2bc545 Compare October 1, 2024 18:01
Copy link
Contributor

github-actions bot commented Oct 1, 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 │   +374 B │   8.6 MiB │   8.6 MiB │   +692 B 
     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.9 KiB │  25.9 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 │ +1.5 KiB │   2.9 MiB │   2.9 MiB │ +1.5 KiB 
    other │   196 KiB │   196 KiB │     -6 B │ 430.6 KiB │ 430.6 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.9 MiB │  12.9 MiB │ +1.9 KiB │  21.8 MiB │  21.8 MiB │ +2.2 KiB 

 DEX     │ old   │ new   │ diff           
─────────┼───────┼───────┼────────────────
   files │     1 │     1 │  0             
 strings │ 42703 │ 42705 │ +2 (+7 -5)     
   types │ 14177 │ 14178 │ +1 (+5 -4)     
 classes │ 11812 │ 11813 │ +1 (+3 -2)     
 methods │ 60536 │ 60542 │ +6 (+154 -148) 
  fields │ 40145 │ 40150 │ +5 (+309 -304) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6253 │ 6253 │  0
APK
     compressed      │     uncompressed     │                               
──────────┬──────────┼───────────┬──────────┤                               
 size     │ diff     │ size      │ diff     │ path                          
──────────┼──────────┼───────────┼──────────┼───────────────────────────────
  7.8 KiB │ +1.5 KiB │   7.7 KiB │ +1.5 KiB │ ∆ assets/dexopt/baseline.prof 
  3.9 MiB │   +374 B │   8.6 MiB │   +692 B │ ∆ classes.dex                 
 50.1 KiB │    -10 B │ 118.2 KiB │      0 B │ ∆ META-INF/MANIFEST.MF        
 53.4 KiB │     +5 B │ 118.3 KiB │      0 B │ ∆ META-INF/CERT.SF            
  1.2 KiB │     -1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA           
──────────┼──────────┼───────────┼──────────┼───────────────────────────────
  4.1 MiB │ +1.9 KiB │   8.9 MiB │ +2.2 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   42703 │ 42705 │ +2 (+7 -5) 
  
  + LE5/k;
  + LQ7/d;
  + Lh5/h;
  + [LS7/H;
  + [LS7/y;
  + fraudDetectionDataRepository
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"10a6ca7","r8-mode":"full","version":"8.5.35"}
  
  - LS7/P;
  - Ld7/s;
  - [LS7/A;
  - [LS7/I;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"4aa8d2c","r8-mode":"full","version":"8.5.35"}
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   14177 │ 14178 │ +1 (+5 -4) 
  
  + LE5/k;
  + LQ7/d;
  + Lh5/h;
  + [LS7/H;
  + [LS7/y;
  
  - LS7/P;
  - Ld7/s;
  - [LS7/A;
  - [LS7/I;
  

METHODS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   60536 │ 60542 │ +6 (+154 -148) 
  
  + A6.l <init>(e, c, e, e, V, e)
  + C.e U(Boolean, String, boolean, e, boolean, List, H, a, a, boolean) → O
  + E5.g <init>(a, a, a, a, a, a, a, a, int)
  + E5.h <init>(c, V, e)
  + E5.h <init>(a, a, a, a, a, a, int)
  + E5.h get() → Object
  + E5.i <init>(Object, d, int)
  + E5.i i(Object) → Object
  + E5.j <clinit>()
  + E5.j M(Object) → Object
  + F5.V <init>(e, h, c)
  + F7.B <init>(C, H, d)
  + F7.C <init>(w, i, b, E, u)
  + F7.E c() → H
  + F7.o <init>(s, z, H, d)
  + F7.s e(z, H)
  + H0.w b(double) → double
  + H5.c <init>(f, c, O, L, c, w, f, m, int)
  + I.c a(e)
  + I.c b(double) → double
  + I.c c() → boolean
  + I0.h b(double) → double
  + I0.l b(double) → double
  + I0.m b(double) → double
  + I0.n b(double) → double
  + Q7.c <init>(int)
  + Q7.c <init>(a, int)
  + Q7.c get() → Object
  + Q7.d <clinit>()
  + S7.A <init>(L0)
  + S7.A a() → String
  + S7.A getMessage() → String
  + S7.B <clinit>()
  + S7.C <init>(String)
  + S7.C equals(Object) → boolean
  + S7.C hashCode() → int
  + S7.C toString() → String
  + S7.D <init>(StripeIntent_Status)
  + S7.F <init>(Throwable)
  + S7.F getCause() → Throwable
  + S7.H <clinit>()
  + S7.H <init>(C1, c, z, z, G, k)
  + S7.H describeContents() → int
  + S7.H e(H, C1, c, z, int) → H
  + S7.H equals(Object) → boolean
  + S7.H hashCode() → int
  + S7.H toString() → String
  + S7.H writeToParcel(Parcel, int)
  + S7.I <init>(z2)
  + S7.J <init>(c)
  + S7.J equals(Object) → boolean
  + S7.J hashCode() → int
  + S7.J toString() → String
  + S7.K <clinit>()
  + S7.M <init>(e, boolean, e)
  + S7.M equals(Object) → boolean
  + S7.M hashCode() → int
  + S7.M toString() → String
  + S7.N <init>(String)
  + S7.O <init>(N, M, boolean, int, a, a)
  + S7.e <init>(o0)
  + S7.e a() → String
  + S7.e equals(Object) → boolean
  + S7.e getId() → String
  + S7.e hashCode() → int
  + S7.e toString() → String
  + S7.f <init>(G1, E1)
  + S7.h <init>(w, d)
  + S7.h i(Object) → Object
  + S7.i <init>(w, d)
  + S7.j <init>(w, d)
  + S7.k <init>(w, d)
  + S7.l <init>(w, g, I, I, d)
  + S7.l K(Object, Object) → Object
  + S7.l g(Object, d) → d
  + S7.m <init>(w, I, I, d)
  + S7.n <init>(w, r0, C1, g, d)
  + S7.o <init>(I, w, C1, r0, boolean, d)
  + S7.p <init>(w, C1, boolean, r0, d)
  + S7.q <init>(w, boolean, C1, P1, boolean, d)
  + S7.r <init>(w, d)
  + S7.s <init>(w, d)
  + S7.t <init>(w, d)
  + S7.u <init>(w, d)
  + S7.v <init>(w, d)
  + S7.w <init>(c, c, q, j, f, d, b, f, i, d, k, L0, k, b)
  + S7.w a(w, g, k, I, d) → Object
  + S7.w b(w, P1, G1, List, String, d) → Object
  + S7.w c(w, I, I, d) → Object
  + S7.w d(w, C1, d) → Object
  + S7.w e(C1, g, r0, String, boolean, Map, d) → Object
  + S7.w f(C1, d) → Object
  + S7.w g(P1, C1, boolean, boolean, d) → Object
  + S7.w h(C1, g, r0, String, boolean, boolean, Map, d) → Object
  + S7.w i(k, G1, d) → Serializable
  + S7.x <init>(e, c, e, c, l, m, c, l, h, e)
  + S7.x <init>(a, a, a, a, a, a, a, a, a, a, a, a, h)
  + S7.x get() → Object
  + S7.y <clinit>()
  + S7.y valueOf(String) → y
  + S7.y values() → y[]
  + S7.z <init>(o, y, O)
  + S7.z describeContents() → int
  + S7.z equals(Object) → boolean
  + S7.z hashCode() → int
  + S7.z toString() → String
  + S7.z writeToParcel(Parcel, int)
  + T7.B0 <init>(f, c, O, L, c, w, f, int)
  + T7.J0 <init>(O, L, a, a, float, m, int)
  + T7.k <init>(L, d)
  + Y7.e d(String, String, String, String, l, Map, d) → Object
  + c7.f a(e)
  + c7.f b(b, e, Map)
  + d7.k <clinit>()
  + d7.k <init>(c)
  + d7.k d(a, Object, l, c) → Object
  + d7.l <init>(q, b, Context)
  + d7.m <init>(String, String, boolean, String, boolean, int)
  + d7.m equals(Object)
...✂

@tillh-stripe tillh-stripe force-pushed the tillh/add-fraud-detection-to-fc branch from b2bc545 to c3e56b2 Compare October 1, 2024 18:16
@tillh-stripe tillh-stripe force-pushed the tillh/add-fraud-detection-to-fc branch from c3e56b2 to 2dcf6ee Compare October 1, 2024 18:18
@tillh-stripe tillh-stripe marked this pull request as ready for review October 2, 2024 00:22
@tillh-stripe tillh-stripe requested review from a team as code owners October 2, 2024 00:22
@@ -103,6 +107,10 @@ private class FinancialConnectionsConsumerSessionRepositoryImpl(
"android_connections"
}

init {
fraudDetectionDataRepository.refresh()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Similar approach to the Payments SDK: Refresh at launch, then use cached values in the request.

We’re only refreshing in the FinancialConnectionsConsumerSessionRepository for now and not FinancialConnectionsRepository, to avoid double work. We could move this into an initializer and run it just once, regardless of which objects get instantiated.

@tillh-stripe tillh-stripe merged commit 365e458 into master Oct 3, 2024
16 checks passed
@tillh-stripe tillh-stripe deleted the tillh/add-fraud-detection-to-fc branch October 3, 2024 13:10
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