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.
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.
The action argument is “stripe_customer_portal_link“, which is required.
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" ]
|Optional. If provided, only the subscriptions made by this form id will be displayed. Otherwise, all subscriptions will be displayed.
|Optional. Defaults to true. If true, will show canceled subscriptions as well.
|Optional. 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.
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).