collab: Introduce StripeClient trait to abstract over Stripe interactions (#31615)
This PR introduces a new `StripeClient` trait to abstract over interacting with the Stripe API. This will allow us to more easily test our billing code. This initial cut is small and focuses just on making `StripeBilling::find_or_create_customer_by_email` testable. I'll follow up with using the `StripeClient` in more places. Release Notes: - N/A
This commit is contained in:
@@ -4039,7 +4039,8 @@ async fn get_llm_api_token(
|
||||
} else {
|
||||
let customer_id = stripe_billing
|
||||
.find_or_create_customer_by_email(user.email_address.as_deref())
|
||||
.await?;
|
||||
.await?
|
||||
.try_into()?;
|
||||
|
||||
find_or_create_billing_customer(
|
||||
&session.app_state,
|
||||
|
||||
Reference in New Issue
Block a user