From 9c3d80d6e8d1a936e243005871e179fbf23ca526 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 16 Oct 2024 11:40:56 -0400 Subject: [PATCH] collab: Fetch more meters and prices when initializing `StripeBilling` (#19288) This PR makes it so we fetch more meters and prices when initializing `StripeBilling`, as we have more than 10 meters defined. Release Notes: - N/A --- crates/collab/src/stripe_billing.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/collab/src/stripe_billing.rs b/crates/collab/src/stripe_billing.rs index c121d8e8fddb326cad96fee7119ff767b82ea8bb..f7cce28a3ad439dc39a6708faf03a369d2c00108 100644 --- a/crates/collab/src/stripe_billing.rs +++ b/crates/collab/src/stripe_billing.rs @@ -45,7 +45,13 @@ impl StripeBilling { let (meters, prices) = futures::try_join!( StripeMeter::list(&self.client), - stripe::Price::list(&self.client, &stripe::ListPrices::default()) + stripe::Price::list( + &self.client, + &stripe::ListPrices { + limit: Some(100), + ..Default::default() + } + ) )?; for meter in meters.data { @@ -396,9 +402,12 @@ impl StripeMeter { pub fn list(client: &stripe::Client) -> stripe::Response> { #[derive(Serialize)] - struct Params {} + struct Params { + #[serde(skip_serializing_if = "Option::is_none")] + limit: Option, + } - client.get_query("/billing/meters", Params {}) + client.get_query("/billing/meters", Params { limit: Some(100) }) } }