Open ruseinov opened 4 years ago
I have implemented this directly in my application in a very minimal fashion, looks similar to this:
#[derive(Serialize)]
struct BillingPortalParams {
pub customer: String,
pub return_url: String,
}
#[derive(Deserialize)]
struct BillingPortalResponse {
pub url: String,
}
let resp: BillingPortalResponse = stripe_client
.post_form(
"/billing_portal/sessions",
&BillingPortalParams {
customer: ...,
return_url: ...,
},
)
.await?;
Ok(HttpResponse::Found()
.header(LOCATION, resp.url)
.finish()
.into_body())
Thank you for opening the issue and posting your solution. I am also looking to offer my customers to use the self service portal.
Add support for https://stripe.com/docs/api/self_service_portal.
Similar to https://stripe.com/docs/billing/subscriptions/integrating-self-serve-portal#redirect