#Vasil

1 messages · Page 1 of 1 (latest)

cold brambleBOT
stray venture
#

hi!

But I cannot understand how we can redirect user if he/she wants not just buy subscription first time but change subscription plan.

That's what the Customer Portal is for!

only found this working in case we use it from Customer portal page
yep!

our client decided to disable this ability and provide user our own page for switching between subscription plans.
yep, then indeed you will have to build your own page to do this. You'll have to build a web page that lets the customer pick various plans and select them, and then on the backend you call the Subsciption.update API to make the changes they specify
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade

How can I implement redirecting user on create checkout session to change subscription?
You don't, Checkout is only for creating subscriptions and payments, not modifying them.
Is it even possible to redirect user to built-in subscription upgrade/downgrade page (when he selects card and sees short summary before press to change subscription) or this is only possible if we use built-in pricing table?
that's what the Customer Portal is for! If you're not using that, then you have to build your implementation of that functionality using the API directly.

jade drift
#

Ok, it sheds much light, thank you

Looks like i do exactly this way (if we need to upgrade subscription the backend calls Subscription.update() under the hood)
But for the user - he just clicks on the plan and get redirected back to app

Can I somehow reuse confirmation (and other) pages which I can see when switching plans via Customer portal?

stray venture
#

no, those are components specifically inside the Customer Portal and aren't available as standalone components for direct embedding in your own pages today

jade drift
stray venture
jade drift
#

that is what i am talking about. I already implemented this logic on backend, but I do not understand how to represent it to user, like what if I want to draw confirmation page (like the screen I've sent above) - what API to call, what redirect links maybe, any other information?

stray venture
#

It would all be entirely custom.

Like on the frontend you want to call your backend to get details of the Price+Product objects that they can pick from. You can show the details those on the frontend. In your screenshot "Light" is the name of the Product object associated with the Price. $15.00 is the unit_amount and currency fields on the Price object. You need to get all that information from your backend, pass it back, and work it into your UI on the frontend.

jade drift
#

does it described anywhere? like some simple path as an example?

stray venture
#

there's no such document as what you're looking for , no

#

happy to try to answer some specific questions if you have them

jade drift
#

ok, thank you for quick answers!!

#

I just want (client wants actually 🙂 ) to implement standard flow but with custom design (customisation of built-in pages is quite limited)
Maybe you can describe which steps I need to perform at least high-level?

stray venture
#

You'll have to build a web page that lets the customer pick various plans and select them. You get the information about the available Prices from your backend server, which can get it from the API. You have your own custom page and forms and input elements and so on. When the customer picks something and submits, you send that to your backend. Your backend sees what Price they want to change to and calls and then on the backend you call the Subscription.update API to make the changes they specify

https://stripe.com/docs/billing/subscriptions/upgrade-downgrade