collab: Fully move StripeBilling over to using StripeClient (#31722)

This PR moves over the last method on `StripeBilling` to use the
`StripeClient` trait, allowing us to fully mock out Stripe behaviors for
`StripeBilling` in tests.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-29 19:49:14 -04:00 committed by GitHub
parent 406d975f39
commit c7047d5f0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 273 additions and 50 deletions

View file

@ -1182,10 +1182,8 @@ async fn sync_subscription(
.has_active_billing_subscription(billing_customer.user_id)
.await?;
if !already_has_active_billing_subscription {
let stripe_customer_id = billing_customer
.stripe_customer_id
.parse::<stripe::CustomerId>()
.context("failed to parse Stripe customer ID from database")?;
let stripe_customer_id =
StripeCustomerId(billing_customer.stripe_customer_id.clone().into());
stripe_billing
.subscribe_to_zed_free(stripe_customer_id)