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

Pass customer_id to /lookup calls. #11195

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

Merged
merged 6 commits into from
Jul 25, 2025

Conversation

carlosmuvi-stripe
Copy link
Collaborator

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

Summary

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

val result = linkRepository.lookupConsumer(email)
val result = linkRepository.lookupConsumer(
email = email,
customerId = null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

LinkController does not need to pass customer_id.

@@ -327,6 +327,7 @@ private class FinancialConnectionsConsumerSessionRepositoryImpl(
appId = appId,
sessionId = sessionId,
requestOptions = provideApiRequestOptions(useConsumerPublishableKey = false),
customerId = null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FC does not need to pass customer_id

Copy link
Contributor

github-actions bot commented Jul 23, 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 │ +1.3 KiB │  10.4 MiB │  10.4 MiB │ +740 B 
     arsc │  2.5 MiB │  2.5 MiB │      0 B │   2.5 MiB │   2.5 MiB │    0 B 
 manifest │  5.8 KiB │  5.8 KiB │      0 B │  30.1 KiB │  30.1 KiB │    0 B 
      res │  918 KiB │  918 KiB │      0 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 │     -1 B │   1.6 MiB │   1.6 MiB │    0 B 
    other │  198 KiB │  198 KiB │     +2 B │ 373.9 KiB │ 373.9 KiB │    0 B 
──────────┼──────────┼──────────┼──────────┼───────────┼───────────┼────────
    total │ 13.4 MiB │ 13.5 MiB │ +1.3 KiB │  24.9 MiB │  24.9 MiB │ +740 B 

         │         raw          │            unique            
         ├───────┬───────┬──────┼───────┬───────┬──────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff         
─────────┼───────┼───────┼──────┼───────┼───────┼──────────────
   files │     2 │     2 │    0 │       │       │              
 strings │ 53161 │ 53163 │   +2 │ 49305 │ 49307 │ +2 (+4 -2)   
   types │ 19094 │ 19094 │    0 │ 17174 │ 17174 │  0 (+0 -0)   
 classes │ 14514 │ 14514 │    0 │ 14514 │ 14514 │  0 (+0 -0)   
 methods │ 73922 │ 73922 │    0 │ 70986 │ 70986 │  0 (+12 -12) 
  fields │ 48156 │ 48160 │   +4 │ 47032 │ 47036 │ +4 (+9 -5)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6327 │ 6327 │  0
APK
      compressed      │    uncompressed    │                                           
───────────┬──────────┼───────────┬────────┤                                           
 size      │ diff     │ size      │ diff   │ path                                      
───────────┼──────────┼───────────┼────────┼───────────────────────────────────────────
   4.2 MiB │ +1.3 KiB │   9.3 MiB │ +740 B │ ∆ classes.dex                             
  54.8 KiB │     +6 B │ 121.7 KiB │    0 B │ ∆ META-INF/CERT.SF                        
   1.2 KiB │     -2 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA                       
     271 B │     -1 B │     120 B │    0 B │ ∆ META-INF/version-control-info.textproto 
 482.5 KiB │     -1 B │   1.1 MiB │    0 B │ ∆ classes2.dex                            
     240 B │     -1 B │     101 B │    0 B │ ∆ assets/sentry-debug-meta.properties     
  51.4 KiB │     -1 B │ 121.7 KiB │    0 B │ ∆ META-INF/MANIFEST.MF                    
───────────┼──────────┼───────────┼────────┼───────────────────────────────────────────
   4.8 MiB │ +1.3 KiB │  10.7 MiB │ +740 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   49305 │ 49307 │ +2 (+4 -2) 
  
  + LLLLLLLLLL
  + LLLLLZLL
  + VLLLLLZLLLLLLZZZLLLZLZZZL
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"a271c20","r8-mode":"full","version":"8.8.34"}
  
  - VLLLLLZLLLLLLZZZLLLZLZZZ
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"3875f46","r8-mode":"full","version":"8.8.34"}
  

METHODS:

   old   │ new   │ diff        
  ───────┼───────┼─────────────
   70986 │ 70986 │ 0 (+12 -12) 
  
  + X6.L o(String, String, ContinuationImpl, boolean) → Object
  + g7.H <init>(L3, String, String, G, b, boolean, Map, F, a, b, r0, o0, boolean, boolean, boolean, F, String, X0, boolean, String, boolean, boolean, boolean, String)
  + h7.C a(String, M0, boolean, String, ContinuationImpl) → Object
  + h7.C b(String, M0, boolean, String, ContinuationImpl) → Object
  + h7.x k(String, String, ContinuationImpl, boolean) → Object
  + h7.x l(String, M0, String, String, boolean, String, ContinuationImpl) → Object
  + l9.h d(String, boolean, k, String, SuspendLambda) → Object
  + l9.h e(String, M0, String, String, String, k, String, String, ContinuationImpl) → Object
  + p7.D l(String, String, ContinuationImpl) → Object
  + p7.D n(String, M0, String, String, String, String, ContinuationImpl) → Object
  + p7.q <init>(D, String, String, Continuation)
  + p7.u <init>(D, String, M0, String, String, String, String, Continuation)
  
  - X6.L o(String, String, boolean, ContinuationImpl) → Object
  - g7.H <init>(L3, String, String, G, b, boolean, Map, F, a, b, r0, o0, boolean, boolean, boolean, F, String, X0, boolean, String, boolean, boolean, boolean)
  - h7.C a(String, M0, boolean, ContinuationImpl) → Object
  - h7.C b(String, M0, boolean, ContinuationImpl) → Object
  - h7.x k(String, boolean, ContinuationImpl) → Object
  - h7.x l(String, M0, String, String, boolean, ContinuationImpl) → Object
  - l9.h d(String, boolean, k, SuspendLambda) → Object
  - l9.h e(String, M0, String, String, String, k, String, ContinuationImpl) → Object
  - p7.D l(String, ContinuationImpl) → Object
  - p7.D n(String, M0, String, String, String, ContinuationImpl) → Object
  - p7.q <init>(D, String, Continuation)
  - p7.u <init>(D, String, M0, String, String, String, Continuation)
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   47032 │ 47036 │ +4 (+9 -5) 
  
  + g7.H o0: String
  + h7.z X: String
  + h7.z Y: C
  + h7.z Z: boolean
  + h7.z a0: Object
  + h7.z b0: C
  + h7.z c0: int
  + p7.q Z: String
  + p7.u d0: String
  
  - h7.z X: C
  - h7.z Y: boolean
  - h7.z Z: Object
  - h7.z a0: C
  - h7.z b0: int

@@ -42,26 +42,33 @@ internal interface LinkAccountManager {
* Optionally starts a user session, by storing the cookie for the account and starting a
* verification if needed.
*
* When the [email] parameter is null, will try to fetch the account for the currently stored
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

email can't be null, deleting this comment.

@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/consumer_id_on_lookup branch from 7fbf2d8 to 547504a Compare July 23, 2025 17:19
@carlosmuvi-stripe carlosmuvi-stripe changed the title Pass customer_id to /lookup calls. Pass customer_id to /lookup calls. Jul 23, 2025
@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/consumer_id_on_lookup branch from 547504a to 3f3d12f Compare July 23, 2025 18:13
@carlosmuvi-stripe carlosmuvi-stripe marked this pull request as ready for review July 23, 2025 18:29
@carlosmuvi-stripe carlosmuvi-stripe requested review from a team as code owners July 23, 2025 18:29
@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/consumer_id_on_lookup branch from 3f3d12f to 6cbd57a Compare July 24, 2025 17:26
@carlosmuvi-stripe carlosmuvi-stripe requested review from lng-stripe and removed request for tillh-stripe and tianzhao-stripe July 24, 2025 18:47
Copy link
Contributor

@lng-stripe lng-stripe left a comment

Choose a reason for hiding this comment

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

Just a few nits and a question. Nothing blocking if you don't think so and if CI passes.

@@ -35,7 +35,12 @@ internal data class LinkConfiguration(
val collectMissingBillingDetailsForExistingPaymentMethods: Boolean,
val allowUserEmailEdits: Boolean,
val enableDisplayableDefaultValuesInEce: Boolean,
val customerId: String?
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be private val _customerId to enforce/encourage usage of customerIdForEceDefaultValues instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea! f6d9b8a

@@ -35,7 +35,8 @@ internal class DefaultLinkAttestationCheck @Inject constructor(
val lookupResult = linkAuth.lookUp(
email = email,
emailSource = EmailSource.CUSTOMER_OBJECT,
startSession = false
startSession = false,
customerId = linkConfiguration.customerId
Copy link
Contributor

Choose a reason for hiding this comment

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

attestation doesn't need customerId, 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.

it does - in prod we'll use the mobile/lookup endpoint for verified merchants as an extra layer of security too

Copy link
Contributor

@lng-stripe lng-stripe Jul 25, 2025

Choose a reason for hiding this comment

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

Correct if I'm wrong, but in this request in particular, it's only used for attestation. linkAuth.lookUp() obtains an integrity check token, makes a request with it, and largely drops the result. Unless the customer ID is used in the backend for attestation, I don't think it's necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed off thread. Though it's technically not used now, it may be later, so it could be a good idea to include today.

@carlosmuvi-stripe carlosmuvi-stripe enabled auto-merge (squash) July 25, 2025 15:59
@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/consumer_id_on_lookup branch from f6d9b8a to c78b420 Compare July 25, 2025 16:18
@carlosmuvi-stripe carlosmuvi-stripe merged commit a5ad204 into master Jul 25, 2025
16 checks passed
@carlosmuvi-stripe carlosmuvi-stripe deleted the carlosmuvi/consumer_id_on_lookup branch July 25, 2025 16:37
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