Direct Debit 2.0 - Direct Debit Enhancements
New Features for Direct Debit
In Direct Debit 2.0, we have introduced a new feature that allows us to handle the automatic updates on payment methods. The GoCardlessWebhookTransferredScheduler scheduled job will automatically update the bank details and mandate id whenever there are Transferred/Replaced mandate changes in Gocardless.
In addition, a new custom object has been added to the Direct Debit API to enhance performance and provide a method for staff to review and process payments through Direct Debit. This new object, GoCardless Webhook, will serve as a way for staff to:
See the status of payments
Run new scheduled batch jobs to handle exceptions
Manually run scripts or process single records
Step 1: Install or Update Direct Debit
From the Spark Admin Object, select Product Updates.
The Product Updates page will display all available packages, which includes DirectDebit. Click the Install or Update button, depending on your organization’s use of Direct Debit.
When the install/update is complete, an email notification will be sent to the system administrator, and you will receive a Success notification message.
Step 2: Setting Up GoCardless Webhook
Run Access Manager for the Community profile, the Fonteva Customer Community Login User profile, and the Guest user profile. For more information on Access Manager, Click Here.
Configure old and/or Add new API Service Connections. For more information on API Services, click Here. New API Service Connections:
Last_N_Days is used in the GoCardlessWebhookBatch, and GoCardlessWebhookTransferredBatch. Note: if you choose not to create this connection, then the batch query’s default value will be 1
Delete_Last_N_Days is used in GoCardlessWebhookRemovalBatch. Note: if the user does not create this connection, then the batch query’s default value will be 200
Schedule three new batch jobs. To learn about batch jobs, look Here.
GoCardlessWebhookScheduler will pick records that haven’t been processed and schedule them to be processed
GoCardlessWebhookTransferredScheduler will process the transferred and replaced records
GoCardlessWebhookRemovalScheduler will remove records that have already been processed
Add the Process Webhook button to your page layout. For more information on updating your page layout, click Here.
Note: This button is only available in Lightning view, not Classic
Manually Running Scripts
The batch jobs created in the previous section will automatically process payments and mandates. If you wish to run the scripts manually or process a single record, you can do so through Spark Admin.
Option 1: Process Payments and Mandates Manually
Users can Process Payments and Mandates manually through Spark Admin
Go to Spark Admin > Apps > Fonteva Direct Debit.
In the Custom Scripts section, run the appropriate script by clicking the Run hyperlink:
Process Payments and Mandates will process all Gocardless Webhooks Except Transferred/Replaced Status
Process Transferred/Replaced Mandates will process all GoCardless Webhooks with the status of Transferred/Replaced
Remove Processed Records will remove all processed payments/mandates
Option 2: Process a Single Record
If appropriate, users can process a single record by using the Process Webhook lightning action.
In the GoCardless Webhook object, double-click to select the record you would like to process.
In the Highlights Panel, select the Process Webhook Lightning Action
Note: The Process Webhook lightning action must be added to your layout in order for it to be used.
New Fields Added:
There are two new fields added to support the Direct Debit enhancements:
GoCardless PaymentID has been added to the ePayment order and is set as the ExternalID.
GoCardless Mandate has been added to the Payment Method and is set as the ExternalID.
Scheduled Jobs
Below is the list of scheduled jobs to be configured in relation to Direct Debit GoCardless.
Related Documentation: Depending on the complexity of your organization, you may choose to schedule these jobs to run multiple times in a day. To do so, we recommend referring to this article about Using CRON Expression in Salesforce.
Time | Summary | Job Criteria | Actions When Ran |
GoCardlessWebhookScheduler | |||
3:00 AM | Running this job will process the GoCardless_Webhook__c records for all statuses except for Transferred/Replaced Mandates
| · LastModifiedDate = last_n_days: Last_N_Days AND
· Status__c IN ('Submitted' , 'Confirmed' , 'Paid_out' , 'Charged_back' , 'Cancelled' , 'Failed' , 'Expired') AND
· Is_Processed__c = FALSE AND
· Limit 9999
| · Update the EPayment records (If Epayment lookup is populated on GoCardless Webhook record)
· Update the Payment Method records (If Payment Method lookup is populated on GoCardless Webhook record)
· Update the GoCardless Webhook records to (Is_Processed_c = TRUE)
· If any error occurs during update, the records Error will be updated in the Error Message field on the GoCardless Webhook record
Note: You can not populate both the Epayment and Payment Method lookup fields on the same GoCardless Webhook record
|
GoCardlessWebhookTransferredScheduler This scheduled job will automatically update the bank details and mandate id whenever there are Transferred/Replaced mandate changes in Gocardless. | |||
3:00 AM | Running this job will process the GoCradless_Webhook__c records of Transferred/Replaced Mandates
| · LastModifiedDate = last_n_days: Last_N_Days AND
· Status__c IN ('Transferred' , 'Replaced') AND
· Is_Processed__c = TRUE AND
· Limit 9999
| · Update the Payment Method records
· Update the GoCardless Webhook records to (Is_Processed__c = TRUE) Note: You can not populate both the Epayment and Payment Method lookup fields on the same GoCardless Webhook record
|
GoCardlessWebhookRemovalScheduler | |||
3:00 AM | Running this job will delete the GoCradless_Webhook__c records
| · CreatedDate < last_n_days:Delete_Last_N_Days AND · Is_Processed__c = TRUE AND · Limit 9999
| · Delete all Gocardless Webhook records that have already processed
|