Enable Users to Switch Stripe Plan or Prices
Overview
This documentation provides instructions on enabling customers to switch Stripe plan prices through the Stripe portal using the Ultimate Member Stripe extension. It also details the process of changing a UM Stripe Plan using a "Switch to this Plan URL" field. This feature allows users who are already subscribed to a UM Stripe Plan to upgrade or downgrade their plan while ensuring that proration works correctly.
Note: The switching Stripe prices option only applies to recurring Stripe plans. There are limitations when switching prices via the Customer Portal. For detailed information, please refer to the Customer Portal Limitations documentation.
Enable Customers to Switch Stripe Prices
- Go to
wp-admin > Ultimate Member > Stripe Plans > Edit a Recurring Stripe plan
. - In the setup subscription settings, scroll down to the 'Users who have subscribed to this plan can switch to any of the chosen Stripe Prices' option.
- Click "Add New Stripe Prices" to select prices that customers can switch to.
- Save the changes by clicking on the "Update" button.
Test the Switch of Stripe Prices
To test the switch of Stripe prices, follow these steps:
- Register as a new user:
- Open a new browser window and navigate to the registration page of your site.
- Fill out the required information, select your desired subscription plan, for example, "Standard Plan - $19.99/month," and then submit the form.
- After successfully checking out, access the Customer Portal by clicking on the "Customer Portal" button in the order details.
- Once in the Customer Portal, to switch subscription plans:
- Click on "Update plan."
- From the available options, select a new price and click on the "Continue" button.
- To confirm your selection, click on the "Confirm" button. Any necessary proration will be applied automatically.
- In
wp-admin > Users
, you can see in the subscription status column that the price has been updated.
Enable Customers to Switch Stripe Plans via the Switch Plan URL
To enable your customers to switch between Stripe Plans, ensure that you have a test account already subscribed to a plan. For example, Jane Doe is currently subscribed to the premium plan, making her a premium customer with an active subscription status.
When Jane Doe decides to upgrade or downgrade her subscription plan, she should use the 'Switch to this Plan URL', for instance: https://ultimate-member-32659-7891496.umsites.net/stripe/YThmMTVlZGE4MGM1MGFkYjBlNzE5NDNhZGM4MDE1Y2Y?switch=1.
You can find this URL by navigating to wp-admin>Ultimate Member > Stripe Plans > Edit a Stripe plan.
Within the Subscribe URL section, locate the 'Switch to this Plan URL' field, which contains the switch plan URL or for the selected prices or you can also copy the URL in the "Users who have subscribed to this plan can switch to any of the chosen Stripe Prices" option. To facilitate Jane Doe's upgrade to a Platinum Membership, simply copy the 'Switch to this Plan URL' of the Platinum Membership plan.
Add the switch plan URL to a post or page on your website. Alternatively, you can incorporate the URL into a button for a visually appealing and seamless experience on your site. The example image below is a post that contains the "Switch to this Plan URL" of the Platinum Membership plan.
Once the user confirms the switch, they will be redirected back to the site. By default, they will be redirected to the Profile page. However, if the Switch URL is used with an anchor or button tag, they will be redirected back to the page where the anchor or button was added. To redirect back to a specific page, add a redirect_to
parameter in the Switch URL. Example: https://um.x/checkout/NTFkOTJiZTFjNjBkMWRiMWQyZTVlN2EwN2RhNTViMjY?switch=1&<strong>redirect_to</strong>=https://um.x/account/
To check if the switching is a success, go to wp-admin>Users and check if the Subscription Status and Role have changed.