GoCardless Direct Debit Integration
Overview
GoCardless is a Direct Debit payment gateway that allows your customers to set up mandates for automatic payments directly from their bank accounts. Unlike credit card gateways, GoCardless uses bank-to-bank transfers which typically have lower fees and higher success rates for recurring payments.
Key Features
Direct Debit Mandates - Customers authorise ongoing payments from their bank account
Hosted Setup Flow - Secure GoCardless-hosted pages for mandate creation
Email-Based Setup - Send customers a link to set up their mandate
Webhook Integration - Automatic payment status updates
One-Off Payments - Charge any amount against an existing mandate
Refund Support - Process refunds through the platform
Multi-Currency - Supports AUD, GBP, EUR and other currencies
How GoCardless Works
Customer sets up a mandate - They authorise your business to collect payments from their bank account
Mandate is created - GoCardless verifies the bank details and creates a mandate
You collect payments - Charge any amount against the mandate when invoices are due
Payment is confirmed - GoCardless notifies Pracbill when payment succeeds or fails
Setting Up GoCardless
Prerequisites
Before you begin, you'll need:
A GoCardless account (Sandbox for testing, Live for production)
Your GoCardless Access Token
Your Webhook Secret (for secure event notifications)
Step 1: Create a GoCardless Account
Go to gocardless.com and sign up for an account
Complete the verification process
For testing, use the Sandbox environment first
Step 2: Generate API Credentials
Log in to your GoCardless Dashboard
Navigate to Developers → Create → Access Token
Copy your Access Token (keep this secure!)
Navigate to Developers → Webhooks → Create
Set the webhook URL to:
https://billing.pracbill.com.au/api/gocardless/webhookCopy your Webhook Secret
Step 3: Configure GoCardless in Pracbill
Navigate to Admin → Payment Options
Click Add New Payment Gateway
Select GoCardless from the gateway list
Enter your configuration:
Field | Description |
|---|---|
Sandbox Mode | Check this box for testing. Uncheck for live payments. |
Access Token | Your GoCardless API access token |
Webhook Secret | Your webhook endpoint secret for signature verification |
Click Save
Step 4: Enable Direct Debit Option
In the Payment Options configuration:
Check the Direct Debit option under Payment Types
Set any surcharges if applicable
Save your changes
Setting Up Customer Mandates
There are two ways to set up a Direct Debit mandate for a customer:
Method 1: Send Email Link (Recommended)
Navigate to the customer record
Go to Payment Methods tab
Click Add Payment Method
Select GoCardless as the gateway
Ensure Email the setup link to the customer is checked
Click Send Setup Email
The customer will receive an email with a secure link to complete their mandate setup on GoCardless's hosted page.
Method 2: Direct Setup Link
Follow steps 1-4 above
Uncheck the email option
Click Open Setup Page
A new tab opens with the GoCardless mandate setup page
Complete the setup with the customer present
What Happens After Setup
Customer completes the mandate setup on GoCardless
GoCardless sends a webhook to Pracbill
Pracbill automatically creates a Payment Method record
The mandate is now ready for payments
Taking Payments
Automatic Payments
Once a mandate is set up and marked as Primary:
Invoices generated for the customer will automatically attempt payment on the due date
GoCardless processes the Direct Debit (typically 3-5 business days)
Payment status is updated via webhook when confirmed or failed
Manual Payments
Navigate to the customer or invoice
Click Take Payment
Select the GoCardless payment method
Enter the amount
Click Process Payment
Note: Direct Debit payments are asynchronous - they show as "Pending" initially and are confirmed via webhook after bank processing.
Payment Lifecycle
Understanding the Direct Debit payment lifecycle:
Status | Description |
|---|---|
Pending Submission | Payment created, not yet submitted to bank |
Submitted | Submitted to bank network, awaiting processing |
Confirmed | Payment successful, funds collected |
Paid Out | Funds transferred to your GoCardless account |
Failed | Payment failed (insufficient funds, cancelled mandate, etc.) |
Cancelled | Payment was cancelled before processing |
Charged Back | Customer disputed the payment |
Webhooks
GoCardless sends webhook events to notify Pracbill of payment and mandate status changes.
Webhook URL
Configure this URL in your GoCardless Dashboard:
https://billing.pracbill.com.au/api/gocardless/webhookEvents Handled
Event | Action in Pracbill |
|---|---|
| Creates payment method from completed mandate setup |
| Marks pending request as cancelled |
| Marks pending request as failed |
| Deactivates payment method |
| Deactivates payment method |
| Deactivates payment method |
| Reactivates payment method |
| Marks payment as completed |
| Marks payment as failed, updates invoice balance |
| Marks payment as failed |
| Marks payment as failed |
| Marks payment as reconciled |
Refunds
To refund a GoCardless payment:
Navigate to the payment record
Click Refund
Enter the refund amount (partial or full)
Confirm the refund
Refunds are processed through GoCardless and typically take 3-5 business days.
Troubleshooting
Mandate Setup Email Not Received
Check the customer's email address is correct
Verify the email isn't in spam/junk folder
Payment Shows Pending for Too Long
Direct Debit payments typically take 3-5 business days
Check the GoCardless Dashboard for payment status
Ensure webhook URL is correctly configured and accessible
Webhook Signature Verification Failing
Ensure the Webhook Secret in Pracbill matches GoCardless Dashboard
Check the webhook secret hasn't been regenerated
Verify no proxy is modifying the request body
Payment Failed
Common reasons for failed payments:
Insufficient funds - Customer's bank account doesn't have enough funds
Bank account closed - The bank account no longer exists
Mandate cancelled - Customer cancelled the Direct Debit with their bank
Invalid bank details - Bank details were incorrect
Supported Features
Feature | Supported |
|---|---|
Credit Card | No |
Bank Account / Direct Debit | Yes |
Multiple Payment Methods | Yes (unlimited mandates per customer) |
Tokenized Storage | Yes (mandate ID stored as token) |
Recurring Payments | Yes |
One-Off Payments | Yes |
Refunds | Yes |
Partial Refunds | Yes |
Webhooks | Yes |
Sandbox Mode | Yes |