Managing Subscriptions

New for release 3.0 is the ability to cancel or retry payments, cancel and amend mandates and amend subscriptions. You can now amend, resume, pause and cancel a subscription that was previously set up via WPdirectdebit.

To amend a subscription, you’ll need a simple subscription management form which will be embedded automatically into the new ‘Subscription’ tab of your WPdirectdebit settings page.

Follow this guide to create and embed your subscription management form like the one shown above: Time to complete, around 10 minutes.

Either download and import this set of ready-made forms, or follow the steps below to make your own form.

How to make your own Subscription Management form

  • Create a new Gravity Form and call it Subscription Management (or similar). Under the Restrictions, we recommend you check the box marked ‘require user to be logged in’.
  • Add a single line text field, and call it Subscription ID. In the general settings for this field, check ‘Required’. In the advanced settings, set the Parameter Name to gocardless-subscription-id exactly as written here.
  • Add a drop-down field, and call it Action. Under the general settings for this field, click Edit Choices. Add four choices labelled Amend, Resume, Pause and Cancel, and set their values to amend, resume, pause and cancel respectively.
  • Add a Product field and call it New Amount. Enable Conditional Logic for this field and set it to Show this field if Action Is Amend.
  • Add a Single Line text field and call it New Subscription Name. Enable Conditional Logic for this field and set it to Show this field if Action Is Amend.
  • Add a Single Line text field and call it New Metadata Value. Enable Conditional Logic for this field and set it to Show this field if Action Is Amend.
  • Save your form.

Now that you have a form to use, navigate to Forms -> Settings and select the GoCardless tab. Scroll to the Subscription Management Form drop-down and select your new form. Save the settings.

Subscription Management form selection

Return to your form, and under ‘Settings’, click ‘Add New’ to add a new GoCardless feed.

Because you’ve now selected a Subscription Management Form, you’ll find there’s a feed type available called Subscription Management.

Complete the feed settings as follows:

  • Set the Feed type to Subscription Management.
  • A unique Feed name will have been auto-generated.
  • Map Subscription ID to your Subscription ID field.
  • Set Action to Map field. Map Action mapped field to your Action drop-down field.
  • Map the Subscription name and Amount fields to the corresponding fields on the form.
  • If you use metadata, enter your Metadata key, and map the Metadata value field to the form.

Click Save settings. It should look similar to this:

GoCardless Subscription management form feed settings

Confirmations

If you wish to, you can visit the Confirmations tab to tailor the confirmation message, or choose to redirect to a URL. A good choice of URL would be the subscriptions tab. Visit the subscriptions tab and copy and paste the URL. It will be something like this, but with your own website at the start.

https://example.com/wp-admin/options-general.php?page=wpdirectdebit_options_page&tab=tab_subscriptions

This will redirect you back to the list of subscriptions, once you submit your form.

Tip: Speeding up your work: If you are planning to work your way through a long list of subscriptions, you can easily step through them one by one. Add a query string containing the Subscription ID of the subscription you have just amended to the redirect URL. This will ensure that the subscription tab will open with the next subscription at the top of the list. Here’s how to do it:

The subscription ID is inserted using a merge tag. Click on the {..} symbol to select and insert the tag after “after=” as shown above.

How to manage a subscription.

Once you’ve followed the steps to create a subscriptions management form, you can access the form via the WPdirectdebit settings. Click on the tab labelled ‘Manage Subscriptions’. Now you can enter the ID of any GoCardless subscription created by WPdirectdebit, and amend, resume, pause or cancel the subscription.

Tip: Speeding up your work. Wherever you see an underlined Subscription ID, just click it to be taken to the Manage Subscriptions tab, with the subscription ID pre-populated on the form.

Keeping track

Gravity Forms helps you to keep track of changes you have made. Each time you make a change, you are creating a new entry for your subscription management form. You can view and edit these as you would with any form entry. In addition, the result of the amendment request is added to the entry as a note.

GoCardless will send an email to the customer automatically whenever a subscription is amended. You can also send your own notifications via Gravity Forms using the event ‘GoCardless recurring payment amended’. This could be useful if you want to send an email to your accounts department, for example.

Security considerations.

All you need to manage a subscription is access to the form and the subscription ID. It’s obviously not a good idea to give everyone the ability to amend subscriptions. To prevent misuse, we’ve added checks to the code to ensure that you must be an Admin to use the form. However anyone who has admin access to your site will be able to view your GoCardless customer data and modify subscriptions.