diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 584e19892d..3a1ab40d18 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -207,8 +207,12 @@ async fn premium_info( Ok(Json(row)) } -async fn stripe_checkout(authed: Authed, Extension(base_url): Extension>) { - #[cfg(feature = "enterprise")] +async fn stripe_checkout( + authed: Authed, + Path(w_id): Path, + Extension(base_url): Extension>, +) { + // #[cfg(feature = "enterprise")] { let client = stripe::Client::new(std::env::var("STRIPE_KEY").expect("STRIPE_KEY")); let success_rd = format!( @@ -232,7 +236,7 @@ async fn stripe_checkout(authed: Authed, Extension(base_url): Extension>, ) -> Result<()> { let client = stripe::Client::new(std::env::var("STRIPE_KEY").expect("STRIPE_KEY")); - let success_rd = format!( - "{}/workspace_settings?session={{CHECKOUT_SESSION_ID}}", - base_url.0 - ); - let failure_rd = format!("{}/workspace_settings", base_url.0); + let success_rd = format!("{}/workspace_settings", base_url.0); let portal_session = { - let customerId = CustomerId::from_str("cus_NBP2VHz5yy0y4v").unwrap(); - let mut params = stripe::CreateBillingPortalSession::new(customerId); + let customer_id = CustomerId::from_str("cus_NBP2VHz5yy0y4v").unwrap(); + let mut params = stripe::CreateBillingPortalSession::new(customer_id); params.return_url = Some(&success_rd); stripe::BillingPortalSession::create(&client, params) .await