#Mitri

1 messages ยท Page 1 of 1 (latest)

ocean furnaceBOT
manic sinew
#

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

stiff cedar
#

I see, in the portal configuration object there's no customer id

#

How would I know the details for each customer?

manic sinew
#

can you elaborate more on what details for each customer you're referring to?

stiff cedar
#

But how can I edit this in a way to disable the cancellation?

#

Would this just be added under the other properties?

manic sinew
stiff cedar
#

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

manic sinew
stiff cedar
#
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?

manic sinew
#

have you tried running that code?

stiff cedar
#

Seems like it, I'll try it and let you know

stiff cedar
#

Seems like I can't use features directly in that object

manic sinew
#

what's the error message?

#

i just noticed this, but you should be creating the portal configuration which is stripe.billingPortal.configurations.create first

stiff cedar
#

Unknown parameter features

#

I think I can't disable the cancellation for specific users, correct?

#

It's either for everyone or no one

ocean furnaceBOT
summer garden
#

Hi @stiff cedar I'm taking over this thread.

stiff cedar
#

Hi Jack

summer garden
#

You can create another billing configuration that with cancellation disabled, and use this config to create a session for a particular customer

stiff cedar
#

Oh, I didn't know I can create multiple billing configs

#

Do you know where I can create those?

summer garden
stiff cedar
#

I actually can't find the config id ๐Ÿ˜‚

#

This: bpc_1N8HOdJkrlmcPYXM8s3GSxqU

summer garden
stiff cedar
#

Ohhhh I see now, I'll get it from the response

#

Thank you for the help!