#stibbs_best-practices

1 messages ยท Page 1 of 1 (latest)

torpid bronzeBOT
vocal sphinxBOT
#

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.

torpid bronzeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1247399002845216843

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

weak zodiac
boreal zodiac
weak zodiac
#

OK. Can you share with me the billing portal configuration that you use to create the billing portal session?

boreal zodiac
#

The only change to standard was enabling customers to update subscriptions.

#

Here's an example session triggered from my app.

#

Above demonstrates that selecting the Yearly version of Full is not available, as it is already 'Selected'?

#

Code-wise I've been really impressed with how little it takes to get going with the portal ๐Ÿ™‚

const portalSession = await stripe.billingPortal.sessions.create({
    customer: customer.id,
    return_url: `${PUBLIC_BASE_URL}/account`
});

if (!portalSession.url) {
    throw error(500, "Error retrieving billing information. We're working on it!");
}

throw redirect(302, portalSession.url);
weak zodiac
#

Or can you share with me the portal session ID? or that I can look for its session configuration object.

boreal zodiac
#

test_YWNjdF8xSWdKQklGU1l6QUVFMm1ULF9RRUhIUEZrSm8wUTg3U1h2Rk1oQ0ExaWhIZGpPYkt40100gKwaUGvH

weak zodiac
#

A billing portal session ID should start with bps_

boreal zodiac
#
{
  id: 'bps_1PNokdFSYzAEE2mTkAv4Hinm',
  object: 'billing_portal.session',
  configuration: 'bpc_1PLajXFSYzAEE2mTDChhsyWf',
  created: 1717474415,
  customer: 'cus_QEDMjKkpoe9wO7',
  flow: null,
  livemode: false,
  locale: null,
  on_behalf_of: null,
  return_url: 'http://localhost:5173/account',
  url: 'https://billing.stripe.com/p/session/test_YWNjdF8xSWdKQklGU1l6QUVFMm1ULF9RRUhKUUxyaHZyU0h1RTAwV0RPN1plVGgxYThYSUhH01002zy3mllt'
}
weak zodiac
#

OK, this is the configuration object bpc_1PLajXFSYzAEE2mTDChhsyWf and it contains subscription_update[products][prices]. Is price_1PNnrIFSYzAEE2mTD2AvFTOt the price that you want your customer to be able to update to?

boreal zodiac
#

Correct, I thought the user would be able to opt into paying annually (price_id of price_1PNnrIFSYzAEE2mTD2AvFTOt) and get the discounted rate

weak zodiac
#

OK, isn't it this one?

boreal zodiac
#

Is this about to be user error? ๐Ÿ˜…

weak zodiac
#

Hmm, I don't quite understand what error you refer to.

boreal zodiac
#

Hahaha it is just me being daft... it does appear to work. Wow

weak zodiac
#

Your customer can click on the 'Continue' button to update to the yearly plan.

boreal zodiac
#

The fact it was already 'Selected' made me think that the billing portal wasn't letting them pick it to change to, but they can still press continue and change to it. Just me misreading it (hence user error)

weak zodiac
#

I see, so the UI/UX made you think that you are not able to change the plan, but in fact you can?

boreal zodiac
#

Yes. The highlighted 'Full' section and the text saying 'Selected' made me think it was behaving weirdly

#

I assumed the current plan would be the highlighted/selected one

#

Whereas it highlights/selects any price that corresponds to the product the user is subscribed

weak zodiac
#

Ok. Thanks for the feedback, I'd pass along to the relevant team.

boreal zodiac
#

Thank you for your help!

#

Embarrassing for me ๐Ÿ˜