1. Home
  2. WP Simple Pay Pro 2.5 & Lite 1.6
  3. Subscriptions Add-on – Basic Use (Pro 2.5)

Subscriptions Add-on – Basic Use (Pro 2.5)

Note: Subscription capabilities are included with Business and Elite licenses only.

You will first need to create a “Plan” in your Stripe dashboard before you can add a subscription shortcode to your site.

Plan IDs must match those set up in your Stripe account. Test and live subscription plans are separate.

Note: Trial plans can also be setup in Stripe and used in the payment form. In this case the customer will not be charged until the specified trial period is over.

Your Test Stripe plans | Your Live Stripe plans

Shortcodes

The WP Simple Pay Pro 2.5 Subscriptions Add-on has two different ways for you to add Stripe plans to your site. One for single plans and one for sites that want to offer a choice from multiple plans (ex: bronze, silver, gold). The plugin will automatically detect if you are using a single or multiple plans.

Single Plans

To create a button that will charge for one specific plan you will need to use the shortcode [stripe_subscription].

Note: We recommend that you describe what the user is signing up for, how much they will be charged, and how often, above or nearby the payment button. Single plans do not display these details as part of the shortcode output.

The following shortcode attributes are available for single plans:

  • id – This is the ID of the plan you created in your Stripe dashboard and is required.
  • label – A label to display above the button.
  • use_amount – Used with a custom field is_amount attribute to allow the user to pick a price for a custom subscription.

Shortcode Examples

Add a subscription with the id of ‘bronze’:

[stripe name="An Awesome Plan" description="Subscribe for $10 per month"]
[stripe_subscription id="bronze"]
[/stripe]

Multiple Plan Choices

The Subscriptions add-on allows for you to offer a choice of plans from users to pick from. You will need to use the shortcode [stripe_plan] for each choice. The plans must be placed inside the [stripe_subscription] shortcode. See examples below.

Note: When using the nested shortcodes for multiple plans you must enclose it with a [/stripe_subscription] code.

Note: When using the nested multiple plan shortcodes you must not include any other shortcodes within the parent [stripe_subscription] shortcode besides the [stripe_plan] shortcodes or it can lead to errors.

The following attributes are available for the [stripe_plan] shortcode:

  • id – This is the ID of the plan you created in your Stripe dashboard and is required.
  • label – A label to display above the button. Default: The plan name in your Stripe dashboard.

Using multiple choice plans also opens up some more options for the [stripe_subscription] shortcode as noted here.

  • label – A label to display above subscription options.
  • default – This is the ID of the plan you want to be selected by default. Default: The first plan in the list.
  • show_details – Used to show the plan details. Can be true or false. Default: true

Shortcode Examples

Add a multiple choice plan with three levels:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription]
[stripe_plan id="bronze"]
[stripe_plan id="silver"]
[stripe_plan id="gold"]
[/stripe_subscription]
[/stripe]

Add a multiple choice plan with three levels and custom labels:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription label="Select a Plan:"]
[stripe_plan id="bronze" label="Beginner Plan"]
[stripe_plan id="silver" label="Intermediate Plan"]
[stripe_plan id="gold" label="Expert Plan (Best Value)"]
[/stripe_subscription]
[/stripe]

Add a multiple choice plan with three levels, custom labels, no details, and a default selected plan:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription show_details="false" default="gold"]
[stripe_plan id="bronze" label="Beginner Plan"]
[stripe_plan id="silver" label="Intermediate Plan"]
[stripe_plan id="gold" label="Expert Plan (Best Value)"]
[/stripe_subscription]
[/stripe]

Subscriptions with Custom Fields

You can use both the subscription shortcode and the custom fields shortcodes together to make a more robust field for your users to fill out when making a purchase. Below are some examples.

You can now use the amounts shortcode attribute of custom fields with the subscriptions use_amount shortcode. This will allow you to give a user predefined options of prices for subscription plans.

Shortcode Examples

Make a form that asks for a name and birthday and has multiple plan options to choose from:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_text label="Your Name" required="true"]
[stripe_date label="Your Birthday" required="true"]
[stripe_subscription default="gold"]
[stripe_plan id="bronze" label="Beginner Plan"]
[stripe_plan id="silver" label="Intermediate Plan"]
[stripe_plan id="gold" label="Expert Plan (Best Value)"]
[/stripe_subscription]
[/stripe]

Set up a checkbox to use with a single subscription plan:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_checkbox label="I understand this is for a recurring payment plan" required="true"]
[stripe_subscription id="gold"]
[/stripe]

Set predetermined prices to allow the user to choose from:

[code lang="text"]
[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_checkbox label="I understand this is for a recurring payment plan" required="true"]
[stripe_dropdown label="Choose your monthly payment" options="$5,$10,$15,$20" amounts="500,1000,1500,2000"]
[stripe_subscription use_amount="true"]
[/stripe]

Subscriptions with User Entered Amount

You can allow users of your site to enter a custom amount to be billed on a recurring basis. You can do this easily by excluding the id attribute of the [stripe_subscription] shortcode and also including the [stripe_amount] shortcode. The plugin will automatically detect this as a custom plan to be set up.

The way the custom plan is created is by using a few things:

  • The email address entered by the customer
  • The amount entered by the customer
  • A UNIX timestamp of the transaction

These three are then used to create a unique string for the new plan. So it will look like this – {email}_{amount}_{timestamp}. This will show up in your Stripe dashboard under “Plans”.

There are also some new attributes you can use on the [stripe_subscription].

AttributeDescriptionChoicesDefault
intervalThe billing frequency.day, week, month, yearmonth
interval_countThe number of intervals between each subscription billing. For example,interval=month and interval_count=3 bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).A number1
statement_descriptionAn arbitrary string to be displayed on your customers' credit card statements (alongside your company name) for charges created by this plan. This may be up to 15 characters.Text. Max of 15 characters. If the string is longer than 15 it will be cut off at the 15 character max automatically.

Shortcode Examples

Setup a form that allows a custom plan to be created:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription]
[stripe_amount label="Enter an amount to be charged monthly"]
[/stripe]

Create a form that will allow a user to enter a custom amount to be billed every 2 weeks:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription interval="week" interval_count="2"]
[stripe_amount label="Enter an amount to be billed every 2 weeks"]
[/stripe]

Subscriptions with Coupons

You can allow users of your site to enter a coupon to use for a subscription plan. Coupons can be set for once, any number of months, or forever and they should apply to the subscription. Below are some examples.

Shortcode Examples

Create a multi-subscription choice form that allows a coupon code:

[stripe name="More Awesome Plans" description="Subscribe Now!"]
[stripe_subscription]
[stripe_plan id="bronze"]
[stripe_plan id="silver"]
[stripe_plan id="gold"]
[/stripe_subscription]
[stripe_coupon label="Enter coupon code"]
[/stripe]
Updated on November 19, 2018

Was this article helpful?

Related Articles