Stripe Customer Portal Shortcode Action

Summary

The Stripe Add-on adds an action to the Gravity Forms shortcode that can be used to display the logged in users subscription information, and a link that redirects to the payment gateway for each.

If no subscriptions were found, a message will be displayed that the user has no active subscriptions. The markup of this message is filterable.

Prerequisites

Before using this shortcode, the merchant must configure their billing portal settings as described in this article from Stripe. if not completed, the shortcode will still display matching subscriptions, but clicking the manage subscription link will display an error.

Usage

The action argument is “stripe_customer_portal_link“, which is required.

[gravityforms action="stripe_customer_portal_link"]

The following is an example using all the optional arguments.

[gravityforms action="stripe_customer_portal_link" id="1" show_inactive="false" redirect_url="https://example.com/custom-login-page" ]

Parameters

ParameterDescription
idOptional. If provided, only the subscriptions made by this form id will be displayed. Otherwise, all subscriptions will be displayed.
show_inactiveOptional. Defaults to true. If true, will show canceled subscriptions as well.
redirect_urlOptional. If the user is not logged in and tries to access where the shortcode is placed, the user will be automatically redirected to the default WordPress login page or this URL if provided. A redirect_to query param will be added that points to where the shortcode was displayed.

Result

When successfully setup and subscriptions are found, the shortcode will display to the user a list of matching subscriptions, each including a Manage Subscription link that redirects the user to Stripe’s subscription management portal.

The shortcode looks up the subscriptions using the email address of the logged-in WordPress user.

If no subscriptions were found, a message will be displayed informing that the user has no active subscriptions. The markup of this message is filterable (see below).

Example output of the Stripe shortcode action

Since

Stripe Add-On 4.2

See Also

The filter gform_stripe_subscriptions_self_serve_markup.
The filter gform_stripe_no_subscriptions_found_message.