#Mitri
1 messages ยท Page 1 of 1 (latest)
hello! you can use the customer portal for that yes. I'm not familiar with firebase so i wouldn't be able to advise on that
I see, in the portal configuration object there's no customer id
How would I know the details for each customer?
i'm a bit confused - you create a portal configuration to reuse across portal sessions. You would create a portal session for a customer using this API : https://stripe.com/docs/api/customer_portal/sessions/create
can you elaborate more on what details for each customer you're referring to?
Oh I see, I can see the customer id here
But how can I edit this in a way to disable the cancellation?
Would this just be added under the other properties?
if you want to configure the default customer portal configurations, you can do it via the Dashboard if that's easier for you : https://dashboard.stripe.com/test/settings/billing/portal
Thanks for pointing this out, but I want to configure it according to some conditions
So for some customers I need to hide the cancellation button, but for others I need to show it
you can disable the subscription cancellation here : https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_cancel-enabled
const sessionParams = {
customer: customerId,
return_url,
features: {
subscription_cancel: { enabled: false },
},
};
const session = await stripe.billingPortal.sessions.create(sessionParams);
Would the configuration be passed like that in the object?
have you tried running that code?
Seems like it, I'll try it and let you know
Not yet, gonna deploy and let you know if it works
Seems like I can't use features directly in that object
what's the error message?
i just noticed this, but you should be creating the portal configuration which is stripe.billingPortal.configurations.create first
Unknown parameter features
I think I can't disable the cancellation for specific users, correct?
It's either for everyone or no one
Hi @stiff cedar I'm taking over this thread.
Hi Jack
You can create another billing configuration that with cancellation disabled, and use this config to create a session for a particular customer
Oh, I didn't know I can create multiple billing configs
Do you know where I can create those?
https://stripe.com/docs/api/customer_portal/configurations/create?lang=curl#create_portal_configuration this is the API to create portal configs
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I actually can't find the config id ๐
This: bpc_1N8HOdJkrlmcPYXM8s3GSxqU
https://dashboard.stripe.com/test/settings/billing/portal
I searched and found this link - but the config id isn't there
You can't find specify a billing portal config in Dashboard, you need to use API to create a billing portal with the config https://stripe.com/docs/api/customer_portal/sessions/create?lang=php#create_portal_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.