1

Implementing Chargebee Portal Session integrating it into my app. If the users subscription is inactive, Im redirecting them to the portal to update their subscription.

The API provides:

redirect_url
URL to redirect when the user logs out from the portal.

My (ruby) code is like this, matches the example in the API:

result = ChargeBee::PortalSession.create({
      :customer => {
        :redirect_url => current_lessons_url,
        :id => chargebee_customer_token
        }
      })

I get the portal loading just fine.. but how does the user logout.. and trigger the return to my app? I can't see it.

Here's how it looks for me. How does the user logout and initate a return to my app?

enter image description here

1 Answer 1

0

Assuming that you are using SSO via API portal auth setup, In order to handle the Logout scenario, you can call Chargebee's Logout a portal session API endpoint and pass the respective portal session ID from which the user is trying to log out. So on logout call, the redirect URL passed in the create function is used and the end-user is redirected to the specified URL destination/app.

Reference - https://apidocs.chargebee.com/docs/api/portal_sessions?lang=ruby#logout_a_portal_session

1
  • But that requires you to be able to provide the user a button or something to click to trigger this logout code. How do you display a button to the user when the chargebee portal is open? You can't.
    – Vincent
    Sep 11 at 22:23

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.