Applying templates to mandates
New for release 3.1 is the ability to create a payment template and apply it to an existing mandate. This means you can set up new payments and subscriptions on an existing customer’s mandate without the customer needing to interact at all. (Naturally you will want to let them know in advance that you intend to do this.)
To take a new payment or subscription on a mandate, you’ll need a payment template form. This can be embedded automatically into the new ‘Mandate’ tab of your WPdirectdebit settings page. If you have a mandate management form appearing here, the payment template form will replace it – but it’s easy to switch back and forth.
A payment template form is extremely simple to create. Follow the steps below to make your form.
How to make your own payment template form
- Create a new Gravity Form and call it Payment Template (or you could give it a more meaningful name that reflects the type of payment you’ll use it for). 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 Mandate ID. In the general settings for this field, check ‘Required’. In the advanced settings, set the Parameter Name to gocardless-mandate-id exactly as written here.
- If you wish to assign metadata, also add a single line text field to your form.
- Save your form.
Now that you have a form to use, navigate to Forms -> Settings then click the GoCardless tab and scroll down to the Mandate Management Form drop-down and select your new form. Save the settings.
Return to your form, and under ‘Settings’, choose GoCardless, then click ‘Add New’ to add a new GoCardless feed. Because you’ve assigned a Mandate Management Form, you’ll find there’s a feed type available called Mandate Management.
Complete the feed settings as follows:
- Set the Feed Action to Mandate Management.
- A unique Feed name will have been auto-generated.
- Map Mandate ID to your Mandate ID field.
- Set Action to Apply Template.
- Mandate Metadata is unaffected; you don’t need to enter anything here.
- Complete the payment section to reflect the type of payment you wish to create.
Click Save settings. It should look similar to the example below, which sets up a recurring payment called ‘VIP Treatment’ and takes £50 annually, until further notice. If you want to add metadata to the payment, you can by adding a text field to your form and mapping it in the 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 could be the customers tab. 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_customers
How to use your payment template form
Ensure that the form assigned to the Mandate Management tab is your new payment template as described earlier. Then you can access your payment template form via the WPdirectdebit settings. Click on the tab labelled ‘Mandates’. Now you can enter the ID of any GoCardless mandate created by WPdirectdebit, and set up a payment using that mandate.
Tip: You don’t have to memorise a mandate ID. Wherever you see an underlined mandate ID (except the ones highlighted in yellow), just click it to be taken to the Mandates tab, with the mandate ID pre-populated on the form.
Using multiple templates
Only one payment template is active at any time – this is the one assigned in the GoCardless Gravity Forms settings, but you can create multiple template forms and switch between templates by changing that assignment.
Using payment templates alongside mandate management forms
The active template replaces the mandate management form you may have created, so if you also wish to cancel and amend mandates you’ll need to remember to switch to the relevant form so that the form that appears under the subscription management tab is the one you wish to use at the time.
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 payment template form. You can view and edit these as you would with any form entry.
GoCardless will send an email to the customer automatically whenever a new payment is set up.
Security considerations.
All you need to set up a payment is access to the form and the mandate ID. It’s obviously not a good idea to give everyone the ability to set up payments. To prevent misuse, we’ve added checks to the code to ensure that you must be an Admin to use a payment template form. However anyone who has admin access to your site will be able to view your GoCardless customer data and create payments.