#Surya-Mani
1 messages · Page 1 of 1 (latest)
I this page after clicking confirm ,Can we customize to where this page to redirect?
Hum... I don't think so. Are you using the no-code customer portal, or the one with code?
With code
this one
Got it. I don't see any options to do that in the customer portal configuration here: https://stripe.com/docs/api/customer_portal/configurations/create
There is no way to redirect
You can set a redirect URL here https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-default_return_url
But I don't think it will be used when confirming a subscription update.
ok
I just deleted your message since it contained your test key
What exactly is the issue with the code you shared? Do you get an error message? If so which one?
no in session url there is an object like url
How will I store that object in variable
I'm sorry I don't understand your question. Maybe can you share your code again (without the secret key)?
Thanks for sharing your code. Can you clarify if the code is working of there's an error?
code is working
If i hover in session url I will see some responses
There is one response like url ,I need to store that url in variable How will i do that?
Store it where? What are you trying to do? I still don't understand.
Also why do you want to store it? A poartal session is only valid for a few minutes. So you'll probably need to create another session for the user if needed instead of reusing the same one.
I need to store that url in a variable and use it in frontend for redirection by clicking that link or button
Your backend code can do two things:
- Either directly redirect the user to the portal session, I think that's what your code is doing. This is covered here also: https://stripe.com/docs/customer-management/integrate-customer-portal#redirect
- Or return a JSON that contains the URL to the frontend.
You said earlier there is no options for redirect the page after clicking confirm button
Then how the updated plan will store in our DB
With webhook events, this is mentioned here: https://stripe.com/docs/customer-management/integrate-customer-portal#webhooks
i don;t understand
Which part? When the customer change their plan, a webhook event will be sent to your server, and there will (for example) update your database with the new plan.
If you are not familiar with webhook events, you can learn about it here: https://stripe.com/docs/webhooks/stripe-events