I want to redirect the user directly to plan subscription page with plan selected , so how can i do that .
If you can tell me how to read a parameter plan id from sso that will he help as well.
I want to redirect the user directly to plan subscription page with plan selected , so how can i do that .
If you can tell me how to read a parameter plan id from sso that will he help as well.
To read the plan ID you can use the following Liquid tag: {{ plan | to_param }}
when you already have access to the plan attribute from the Application object. This is used if you are doing a signup directly from the plan subscription page. Alternatively you can use application[plan_id]={{plan.id}}
if you just want to maintain the plan ID in the query params upon redirect.
If you want the plan ID from your external site then you will need to use the 3scale APIs to retrieve this data so that the plan.system_name
or plan.id
can be passed in the redirect to the 3scale Developer Portal. Equally if these plans are fairly static then you could just hardcode them into the HTML.
When the user lands on the Developer Portal page there will need to be some custom Liquid that reads the query params and then filters the plans available:
{% assign params = request.request_uri | split: 'plan_id=' %}
{% param = params[1] %}
{% for service in provider.services %}
{% for plan in service.application_plan %}
{% case plan.id %}
{% when param %}
Some HTML here that renders the subscription form to that plan.
{% endcase %}
{% endfor %}
{% endfor %}
The Liquid is very flexible so there are many ways you can do the same thing.
Check out the Liquid Reference documentation for more information on the Application Plan Drop.