Reputation: 11
I did the Stripe integration, I am using the Stripe Checkout and Stripe customer portal for payments management. I have 2 types of users, Students and Teachers. I want to show them subscription on the Customer portal based to their role. The Stripe is giving us the option for the product that we want to show but I am unable to figure out how to show the products to both the users based on their roles so that the Teacher don't see the Students products and the Students do not see the Teachers products.
Upvotes: 1
Views: 462
Reputation: 1354
If you need multiple Customer Portal configurations, you can do so via the API[1]. You can specify what products and prices are allowed in each configuration by passing them in to the features.subscription_update.products
parameter[2] of the billingPortal.configurations.create
call.
Then when creating the Customer Portal session, you can pass in the ID for your Student or Teacher configuration to the configuration
parameter[3] of the sessions.create
function.
[1] https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#configure
[3] https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-configuration
Upvotes: 1