Managing Payments

New for release 3.0 is the ability to cancel or retry any payment that was previously set up via WPdirectdebit.

To amend a payment, you’ll need a very simple payment management form with just two fields. Once created, this will be embedded automatically into the new ‘Payment’ tab of your WPdirectdebit settings page.

Follow this guide to create and embed your payment 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 Payment Management form

  • Create a new Gravity Form and call it Payment 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 Payment ID. In the general settings for this field, check ‘Required’. In the advanced settings, set the Parameter Name to gocardless-payment-id exactly as written here.
  • Add a radio field (or drop-down field if you prefer), and call it Action. Under the general settings for this field, click Edit Choices. Add two choices labelled Retry and Cancel, and set their values to retry and cancel respectively (capitals are unimportant).
  • Save your form.

Now navigate to Forms -> Settings and select the GoCardless tab. Scroll to the Payment Managment Form drop-down and select your new form. Save the settings.

Return to your form, and under ‘Settings’, click ‘Add New’ to add a new GoCardless feed.Because you’ve now selected a Payment Management Form, you’ll find there’s a feed type available called Payment Management.

Complete the feed settings as follows:

  • Set the Feed type to Payment Management.
  • A unique Feed name will have been auto-generated.
  • Map Payment ID to your Payment ID field.
  • Set Action to Map field. Map Action mapped field to your Action drop-down field.

Click Save settings. It should look similar to this:

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 payments tab. Vist the payments tab then copy the URL from your browser’s address bar. 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_payments

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

 

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

 

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

How to manage a payment.

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

Tip: Speeding up your work. Wherever you see an underlined Payment ID, just click it to be taken to the Manage Payments tab, with the payment 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 payment 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 payment is cancelled. You can also send your own notifications via Gravity Forms using the event ‘GoCardless single 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 payment is access to the form and the payment ID. It’s obviously not a good idea to give everyone the ability to amend payments. 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 payments.