#farhanah_77012

1 messages · Page 1 of 1 (latest)

sweet sealBOT
#

Hello farhanah_77012, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
farhanah_77012, 14 minutes ago, 35 messages
farhanah_77012, 2 hours ago, 14 messages
farhanah_77012, 5 hours ago, 29 messages
farhanah_77012, 6 hours ago, 2 messages
farhanah_77012, 7 hours ago, 10 messages
farhanah-portal-cancel, 1 day ago, 9 messages

ember pulsar
#

here is the code for reference: await stripe.api.billingPortal.configurations.create({
features: {
subscription_cancel: {
enabled: true,
mode: "immediately",
cancellation_reason: {
enabled: true,
options: [
"customer_service",
"low_quality",
"missing_features",
"switched_service",
"too_complex",
"too_expensive",
"unused",
"other",
],
},
},
invoice_history: {
enabled: true,
},
payment_method_update: {
enabled: true,
},
},
business_profile: {
privacy_policy_url: “x”,
terms_of_service_url:
“Y”,
},
metadata: {
customer: input.customerId,
},
default_return_url: input.default_return_url,
});

supple cipher
#

Hello! That code looks like it should be enabling the cancel option. Can you share the code where you're using this configuration?

ember pulsar
#

uh so im using nextjs with trpc . i create the portal configuration first and then use the id and pass it to the portal session

#

and its all linked to a button

supple cipher
ember pulsar
#

here is the code :
export const StripeButton = (props: { customerId: string }) => {
const { customerId } = props;

const { data: configurationPortal } =
api.stripe.configureBillingPortal.useQuery({
customerId: customerId,
default_return_url: “x”,
});

const { data: billingSession } = api.stripe.getBillingPortalSession.useQuery(
{
customerId,
return_url:
(typeof window !== "undefined" && window.location.href) ||
“X”,
configurationId: configurationPortal ? configurationPortal.id : "",
},
);
return (
<Button

  disabled={!Boolean(billingSession) || !Boolean(configurationPortal)}
  href={billingSession?.url || ""}
  target="_blank"
  rel="noreferrer"
>
</Button>

);
};

#

req id: req_KCxTuP0zFRt8NA

supple cipher
#

Looking, hang on...

ember pulsar
#

it shows enabled is false for subscription_cancellation in my log, but i'm explicitly setting it to true in my api call

supple cipher
#

You mean the cancelation_reason?

ember pulsar
#

this right here in my log: "subscription_cancel": {
"cancellation_reason": {
"enabled": false,
"options": [
"too_expensive",
"missing_features",
"switched_service",
"unused",
"other"
]
},

#

oh wait nvm im readin gthe wrong field for the wrong property

supple cipher
#

Yeah, that's the enabled property under cancellation_reason.

ember pulsar
#

its been a day apologies. do u see any other reason for the cancel button to not show?

supple cipher
#

Oh, the Subscription is being managed by a Subscription Schedule.

#

That's probably it.

ember pulsar
#

in this case, my user downgrades so i applied a sub schedule so the downgrade takes effect end of their billing cycle

#

is there a workaround for when a user downgrades and then wants to cancel their subscription? meaning for that button to show up

supple cipher
#

Customers can’t update or cancel subscriptions that currently have an update scheduled with a subscription schedule.

#

There is no workaround other than not using a Subscription Schedule.

ember pulsar
#

would my only option be to create my own cancel subscription button for when a user downgrades their paln?

supple cipher
#

Yes, if you want to continue using Subscription Schedules.