#vickygiyst
1 messages · Page 1 of 1 (latest)
Hi
Stripe Checkout Session is just for creating Subscription, not for managing it. You should rather use Customer Portal. In order to let your customers manage their subscriptions and PaymentMethods:
https://stripe.com/docs/customer-management
please check this
i m referring to return To Giyst LTD
i have used this to come to this page
const portalSession = await stripe.billingPortal.sessions.create({
customer: checkoutSession.customer,
return_url: returnUrl,
});
AH sorry I mis understand you initial request then. You can set the return url of the customer portal in the configuration:
https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-default_return_url
Or when creating the session using:
https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url
is it not correct?
Yes it should be, can you share that customer portal id ?
test_YWNjdF8xTWpPeHhLR0UwWWxKMDE1LF9OZWx4azdDTlk3Z0lrVTlpdUhBQUFPVUhibERmaWNp0100nBNz3AYJ
is that what you are asking?
yes let me check
The return url of that session is this url:
https://joyce1.ucd.ie/giyst/payment/status/?success=true&session_id={checkoutSession}
When I click on return I'm sent back to this page
isn't this what you are expecting ?
no
this should come, after a successful payment
i m using this billing url under account section of the user
i just save the checkout session id, and used it later for a user when they click on manage subscription button
What you mean by no? the return_url of that customer portal is this url:
https://joyce1.ucd.ie/giyst/payment/status/?success=true&session_id={checkoutSession}
Which is explaining that redirection. If this isn't the desired return_url then you should use another url
this is fine if the user clicks on this just after the payment is successful. but i m not using this at the moment
i m using at different page
and at different time(not just after the payment)
suppose the user has made the purchase and after few days they again login and wants to manage their subscription. in this case if they return to success url, that would not be the apprpriate page to see
You can't specify multiple return url when creating a Customer portal. However you can update the customer portal default_Return url using the update url:
https://stripe.com/docs/api/customer_portal/configurations/update#update_portal_configuration-default_return_url
does this url same as payment success url?
no this is the default returning url of the Customer portal
like updating the return_url in this request you sent for creation
great, this helps
Cool!