Table of Contents
GoCardless Integration: Overview & Setup
Updated
by Jennifer Trower
Read Time: 7 mins
GoCardless is a Direct Debit provider that collects payments directly from your subscribers' bank accounts. Sonar integrates with GoCardless as a bank account processor, but it works differently from other processors: subscribers authorize Direct Debit themselves through your Sonar customer portal before you can collect payments from them.
This article explains what GoCardless and Direct Debit mandates are, walks through the three parts of setup, and covers what subscribers see, how notifications and timing work, and how declined or cancelled payments are handled. It is written for administrators setting up GoCardless as a payment option.
Prerequisites
- A GoCardless account with access to the Developers area of the GoCardless dashboard.
- A configured Sonar customer portal. To set one up, see the Adding a Customer Portal to Your Sonar Instance article.
- Your customer portal Settings Key, which is required to change customer portal settings.
Permissions
Before getting started with the feature, your user roles will need to be adjusted to account for the permissions required to use the GoCardless integration feature.
What is GoCardless?
GoCardless is a Direct Debit provider that manages the full collection process on behalf of businesses. Once a subscriber authorizes Direct Debit, you can collect payments from their bank account without them initiating each payment. To learn more about GoCardless, visit the GoCardless website.
What is a Direct Debit mandate?
A Direct Debit mandate, also called a Direct Debit Instruction, is the authorization a subscriber gives you to collect payments from their bank account. You cannot collect Direct Debit payments from a subscriber until they have agreed to and signed the mandate. In Sonar, subscribers complete the mandate through your customer portal.
For more detail, see GoCardless's guide to Direct Debit mandates.
Setting Up the GoCardless Integration
Setup happens in three places, in this order:
- The GoCardless dashboard, where you create an access token and a webhook endpoint.
- Your Sonar instance, where you create the GoCardless bank account processor.
- Your Sonar customer portal, where you turn on GoCardless for subscribers.
Part 1: Within the GoCardless Portal
The access token lets Sonar and your customer portal communicate with GoCardless. The webhook keeps Sonar updated automatically when the status of a payment or mandate changes, such as when a payment fails or a mandate expires.
- Log in to the GoCardless dashboard and go to the Developers tab.
- Click Create in the top-right corner, then select Access token

- In the Create Access Token window, enter a name for the token, select Read-write access, and click Create access token.

- Copy the access token that appears. You will need it in Part 2 and Part 3.
GoCardless only shows your access token once. Copy it now and store it securely, as you would a password. If you lose it, you will need to create a new token.
- Copy the access token that appears. You will need it in Part 2 and Part 3.
- Back on the Developers tab, click Create in the top-right corner, then select Webhook endpoint.

- In the Create Webhook Endpoint window, enter a name for the webhook and enter the URL in this format: your Sonar instance URL followed by /api/webhooks/gocardless/events. For example, https://yourcompany.sonar.software/api/webhooks/gocardless/events.Optionally, enter a passphrase in the Secret field. If you leave it blank, GoCardless generates one for you.

- Click Create webhook endpoint.
- Keep the GoCardless dashboard open, or note your access token and webhook secret somewhere secure. You will need both in Part 2.
Can't find your webhook secret?
On the Developers tab, select your webhook from the Webhook Endpoints table. Its details page shows the secret.
Part 2: Create the bank account processor in Sonar

- Within the Create Bank Account Processor window that appears, select “GoCardless (https://gocardless.com)” as the Bank Account Provider.

- In the Create Bank Account Processor window, select GoCardless (https://gocardless.com) as the Bank Account Provider.
- Enter your access token from Part 1 in the Access Token field and your webhook secret in the Webhook Endpoint Secret field.
- In Companies, select the companies that should use GoCardless.
- Check Enabled. Check Primary if GoCardless should be the default bank account processor.
- Click Create.
Part 3: Turn on GoCardless in your customer portal
- Go to the Settings page of your customer portal at https://[your-portal-url]/settings.Enter your customer portal Settings Key when prompted.
- Scroll to the GoCardless Integration section and turn on Enable GoCardless.
- Paste your access token from Part 1 and, if needed, set the currency mode.

- Save your changes.
Your GoCardless integration is now set up. The next section explains what your subscribers will see.
What subscribers see
Subscribers set up Direct Debit from your customer portal. After logging in, they click "Add new bank account" to add their bank account as a payment method.

The subscriber is then sent to GoCardless, where they enter their bank account details and complete the Direct Debit mandate.

After confirming their details, the subscriber sees a confirmation that Direct Debit has been set up.

GoCardless also emails the subscriber to confirm their details and explain how payments will be collected.

You will receive an email from GoCardless letting you know a new subscriber has signed up and that you can begin collecting payments from them.

Notifications
Direct Debit regulations require subscribers to be notified before their account is charged. GoCardless sends these compliant email notifications automatically, so there is nothing to configure in Sonar. Subscribers who authorize Direct Debit through GoCardless receive emails when their mandate is authorized, ahead of each upcoming payment, and when a payment is made.
Payment timing
Direct Debit is not an instant payment method. Both mandates and payments take several days to process.
Declined and cancelled payments
When a subscriber's payment is submitted through GoCardless and appears to succeed, Sonar marks it as successful. If something goes wrong after that point, GoCardless updates Sonar through the webhook you set up in Part 1.
- Declined payments: If the subscriber's bank declines the charge, for example, because of insufficient funds, GoCardless updates the payment's
successfulflag in Sonar. The full decline message from GoCardless is stored but is not shown in the Sonar interface. You can retrieve it through the Sonar API usingfull_processor_response. - Chargebacks and disputes: If the subscriber initiates a chargeback or disputes the payment, GoCardless updates the payment to
cancelled.
In both cases, the amount owing is restored on the account. Sonar does not notify you when this happens. If the subscriber does not submit a new payment, the difference shows up in your accounting reports and on the subscriber's next invoice.
Related articles
- Setting up Bank Account & Credit Card Processors
- How to Take Bank Account Payments
- Adding a Customer Portal to Your Sonar Instance
- Customizing Your Customer Portal
- Troubleshooting the Customer Portal
Need a hand?
Our Support Team is here to help