Permission for charging a Swiss bank account based on the direct debit mandate (ch-ta) is subject to a mandate verification by the executing bank. This leads to a significant time delay (usually several weeks) between the initial creation of the contract (NPSP recurring donation) in Salesforce and the actual activation of the corresponding RaiseNow subscription.
Depending on the specific formulation of the underlying agreement between the donor and the NPO installment payments may be defined as due after verification of the contract or at the time of contract signature.
This article describes a simple implementation in Salesforce Flow to execute charges via RaiseNow retrospectively on activation of a recurring donation in Salesforce after successful mandate verification.
- A recurring donation is created on 6 January 2022. The effective date of the recurring donation is defined as 6 January 2022 but the recurring donation is defined as "Lapsed" due to pending contract verification. An opportunity exists for that recurring donation with a Closed Date 6 January.
- As the recurring donation has the status "Lapsed" a linked RaiseNow subscription exists but is currently suspended. This means no charges will be executed by RaiseNow until the recurring donation is activated in Salesforce.
- Initiate a direct debit installment payment via RaiseNow on activation of the recurring donation in Salesforce at an unspecified time after 6 January.
This is a schematic of the flow we are going to build.
Define the trigger
As trigger we define a property value change on the recurring donation
npsp__Status__c property. The trigger should execute when the status of the recurring donation is changed to "Active". In addition, we restrict this to direct debit payment methods. The actual action we want to perform will concern related records and not the recurring donation itself. So we choose the corresponding option. Be sure to activate the checkbox to activate an asynchronous path.
Identify relevant opportunity
Next we want to identify an opportunity that should be charged retrospectively. We search Salesforce for opportunities for that recurring donation that should have been closed successfully in the past. To keep this example simple, we restrict our search to a single opportunity, sorting by CloseDate.
Define exit condition
If we do not find any matching opportunity, we stop the process.
Execute apex action
If our previous search returned an opportunity we leverage the apex action "Charge Opportunity at RaiseNow", providing the Id of the previously identified opportunity as an input value to that method.
As the charging process is asynchronous you will not see an immediate payment in Salesforce. However, the activity field of the opportunity will show that a charge request was sent to RaiseNow.
RaiseNow will now include this charge automatically in the next payment initiation message (pain.008 file) provided to Salesforce. At this time, the opportunity will be linked to a RaiseNow transaction record. Once a payment can be successfully identified via camt file processing, the opportunity StageName will be automatically updated.