Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(stripe): webhook for new price id (#3452)

Will Hutchinsond44106d737fa
diff --git a/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs b/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
index f23e7b82b1..6eaf38ae1d 100644
--- a/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
+++ b/rust/cloud-storage/authentication_service/src/api/webhooks/user/stripe_webhook.rs
@@ -356,26 +356,14 @@ async fn handle_customer_subscription_event(
}
// Extract the price ID(s) from the subscription items
- let price_id = subscription
+ let _price_id = subscription
.items
.data
.first() // SAFETY: we only need the first item because we know the user is not in a team
.map(|item| item.price.id.as_str().to_string())
.context("no price id attached to subscription")?;
- let product_tier = match price_id.as_str() {
- id if id == ctx.legacy_stripe_price_ids.stripe_price_id_haiku.as_ref() => {
- ProductTier::Haiku
- }
- id if id == ctx.legacy_stripe_price_ids.stripe_price_id_sonnet.as_ref() => {
- ProductTier::Sonnet
- }
- id if id == ctx.legacy_stripe_price_ids.stripe_price_id_opus.as_ref() => ProductTier::Opus,
- _ => {
- tracing::warn!(price_id=?price_id.as_str(), "unsupported price id, defaulting to haiku tier");
- ProductTier::Haiku
- }
- };
+ let product_tier = ProductTier::Opus;
ctx.user_roles_and_permissions_service
.update_user_roles_and_permissions_for_subscription(