The SmartDebit extension is part of the Bacs for FinDock package and supports collecting one-time and recurring payments using the FinDock Payment API and SmartDebit, an experienced and respected provider of Bacs Direct Debit services in the UK.
|BACS Direct Debit||--|
- FinDock is installed and configured.
- A working connection to ProcessingHub and WebHub.
To complete the SmartDebit configuration, you need to add at least one SmartDebit target (account).
To make creating targets easier, we recommend gathering the required details before you start creating targets. The following table includes all the settings for a SmartDebit target.
|Name||The name of the target should be something that is recognizable within your organization. This name is not shown outside of your organization, but it is used to distinguish easily among different accounts.|
|Target||The payment extension to be used with this target. For Bacs targets, select PaymentHub Bacs.’|
|Type||This is the Bacs implementation to be used with this target. The type affects which settings are needed for the target and how the target is used.|
|Collection file lead time||The lead time between submission and processing of collection files; contact SmartDebit for this information.|
|DDI Lead time||The lead time between submission and activation of your DDIs; contact SmartDebit for this information.|
|Endpoint||The API endpoint for SmartDebit; value depends on whether you are using a sandbox or production environment from SmartDebit.|
|Initial Report Date||The first date the Bacs reports should be fetched from SmartDebit, typically this coincides with your go-live date.|
|DDIs per payer file||Limits the number of DDIs in a single payer or AUDDIS file.|
|Transactions per Collection file||Limit the number of transactions per collection file|
|Password, Service User & Username||These details are provided by SmartDebit and authenticate calls to the SmartDebit API.|
To create a SmartDebit target:
- Launch the FinDock app and select Setup.
- Click the ProcessingHub tile to open up the ProcessingHub setup page.
- Click on the Targets tab and click Add Target to create a new target.
- Add the name for the new target, select ‘PaymentHub BACS’ for Target, and for type, select SMARTDEBIT.
- Once you select Type, you are taken to the target settings window where you can fill in the rest of the settings and click Save.
- If you need to change the settings later, you can go back to the Targets tab, click the button to the right of the target and select Settings.
- Repeat steps 1-5 for each new account.
The Bacs Direct Debit scheme requires you to register a DDI with your bank or service bureau before it can be used to collect direct debits. This process is supported in FinDock through the Mandate Schedule object.
The Bacs extension generates mandates as Direct Debit Instructions (DDIs) when required, such as for direct debit collection runs. The prefix as set in the FinDock mandate settings is combined with the customer’s bank account for the DDI record to create a unique mandate reference.
FinDock uses the Automated Direct Debit Instruction Service (AUDDIS) service to register DDIs with SmartDebit. Conversion of non-AUDDIS to AUDDIS DDIs is not supported by FinDock. If you have a non-AUDDIS DDI, you need to either convert it using an external service or create a new DDI through FinDock and register it as normal.
To use the Mandate schedule for the registration process, you need to first add the Generate Mandates button component to the page layout of Mandate Schedule. Follow the standard Salesforce procedure to modify the Lighting page layout.
To create a new DDI registration file:
- In Findock, click the Mandate Schedules tab.
- Click New to create a new schedule record.
- On the Mandate Schedule Detail page, enter your Bacs target and a processing date (date when the mandates should be active, taking DDI lead time into account).
- Set the status to ‘Scheduled’ and click Save. The detail page is refreshed with the values you entered.
- On the detail page of the mandate schedule, go to the buttons list at the right top of the page and click Generate Mandates.
- A success message is displayed and a Salesforce job is started in the background to select Bacs mandates that are pending registration.
- After the job is finished, the mandate schedule status is set to ‘Generated.’
Once the mandate schedule status changes to ‘Generated,’ you can either validate first and then create the DDI files, or you can immediately create the DDI file.
To validate the mandates first, update the status of the mandate schedule to ‘Validate Mandates.’ This tells FinDock to first validate all the associated mandates and confirm the mandates are complete according to the criteria outlined in the following table.
You can also skip this step and set the mandate schedule status manually to ‘Process.’ Potential errors will be caught later and will still block the DDI registration.
|Mandate Id||Must be > 6 and \< 18 alphanumerical characters. If the Target sub type = SmartDebit the mandateID must be of length 7.||Mandate ID must be between 6 and 18 characters|
|Mandate Id||After taking out nonalphanumeric characters should not contain only the same characters. (see example 2).||Mandate ID must not contain only the same characters.|
|Mandate Id||Should not contain “/”||Mandate ID contains \/|
|Contact > Last name||Contains at least 3 characters.||Lastname must contain at least 3 characters|
|Contact > First Name||not empty, not spaces only||First name cannot be empty|
|Contact > Address Line||not empty, not spaces only||Address line cannot be empty|
|Contact > City||not empty, not spaces only||City cannot be empty|
|Contact > Post code||not empty, not spaces only||Post code cannot be empty|
|Payment Profile > Sort code||Length 6||Sort code must be 6 digits (and thus may not be empty)|
|Payment Profile > Sort code||Only digits||Sort code can only contain digits 0:9|
|Payment Profile > Account number||Length 8||Account number must be 8 digits|
|Payment Profile > Account number||Only digits||Account number can only contain digits 0:9|
|Target||Must have a BACS target||Mandate does not contain a valid target|
|Status||Allowed values are: “Pending registration” “Pending validation” “Pending update”||Invalid mandate state|
|Payment Profile > Holdername||not empty, not spaces only||Holdername cannot be empty|
If a mandate fails validation, the status of the mandate is set to ‘Failed,’ and the error(s) is added to the field Last Status Reason.
If no errors are found, FinDock automatically progresses to the file creation stage.
The DDI file creation is triggered when the mandate schedule status changes to ‘Process.’ This initiates an outbound message which uploads the new DDIs directly to SmartDebit in an AUDDIS file.
Once ProcessingHub has generated the file, it is uploaded to Chatter, and a PaymentHub File record is created to track the status of the generated file.
The mandate schedule, in turn, is updated to ‘Pending Verification.’
Under Related on the mandate schedule, you will find a list of the DDIs that have been included in the Standard 18 file.
For SmartDebit, there is a scheduled job which automatically kicks off the DDI registration process. This automatic flow skips validation and registers any DDI directly with SmartDebit.
To enable this job:
- Open Salesforce Setup, in the quick find box enter "Apex Classes" and click on "Apex Classes" in the search results.
- On that page click Schedule Apex.
- Next, give the job a recognizable name like “DDI Registration.”
- For the Apex Class, enter: "RegisterDDISchedule."
- Set the job to run every day of the week at a time of your choosing. It is recommended to do this in the evening as this ensures all new DDIs for that day will be included as soon as possible.
- Click Save to store the schedule.
Every day at the designated time, FinDock will create a mandate schedule for every SmartDebit target in your org, select the relevant mandates, and register them with SmartDebit.
If any mandate fails, the individual mandate record is marked with status "Failed." Make sure to review and correct these so they are not constantly failing.
The Bacs Direct Debit scheme does not allow multiple transactions for the same mandate on the same date. If you have transactions like this, FinDock automatically aggregates to a single direct debit installment all transactions for each mandate-date combination.
After a payment schedule run for a Bacs target has generated and/or selected installments that meet the schedule’s criteria, FinDock checks if there are installments with the same mandate-date combination.
If such installments are found:
- An aggregated installment is created with an open amount equal to the sum of the open amounts of the individual installments.
- The payment method of the individual installments is set to Aggregated Installment.
- The individual installments are linked to the aggregated installment.
- The original installments are removed from the payment schedule.
If a payment is received for the aggregated installment, it is split and distributed to the original individual installment. Both the aggregated installment and linked individual installments are set to Collected, and all open amounts are set to zero. In addition, a corresponding negative payment is created for the aggregated installment to keep the sum of all payments equal to the actual direct debit payment amount.
If an aggregated installment is reversed, a negative payment is created and distributed across the original individual installments. The status of these installments is set to Reversed, and the open amount is set to the original value.
The payment method of the original installments is set back to direct debit, allowing them to be recollected. The for the Aggregated Installment positive payment is created in order to keep the sum of all Payments equal to the actual money flow.
- Keep in mind when confirming the direct debit to the customer or donor that you mention the total amount rather than the amount of the single transaction.
- Aggregated installments are not eligible for Gift Aid since they are not separate payments or donations.
- In order to keep your reports in line with actual expected and/or realized cash flow, exclude aggregated installments from your reports. Use the field
paybacs__IsAggregated__cto filter out installments that are aggregated installments.
- For the same reporting reasons, NPSP Opportunities are not created for an aggregated installment.
- Do not recollect Aggregated installments after a reversal, but recollect the Original Installments.
As part of the Bacs package a new field ‘Bacs processing date’ (
paybacs__BACS_Processing_Date__c) is added to the Payment Schedule. You can enter a value in this field if you want to match incoming Bacs reports based on the Bacs processing date instead of the collection date noted on the payment schedule.
When a Bacs report is uploaded to ProcessingHub (via Chatter), the records in that file are matched against installments in the system. If a value is provided in the field ‘Bacs processing date’ on a payment schedule, then FinDock matches incoming Bacs reports on that.
To test your SmartDebit configuration, you can use the following messages with the Payment API.