action.skip

Enabling SEPA Mandate Payment Instruments

JustOn makes use of Payment Instrument records to hold the SEPA Direct Debit Mandate information for accounts. This is useful, in particular, with large customers who successively use multiple SEPA mandates, and allows for managing the SEPA mandate information.

If there is an active payment instrument set for an account (in the field Current SEPA Mandate), JustOn uses the customer's SEPA-relevant data from the payment instrument when exporting SEPA orders – irrespective of whether SEPA Direct Debit or SEPA Credit from invoices, or SEPA Credit from balances. In this case, any SEPA-specific data on the account or the invoice will be ignored.

sepa_exp_pi
Managing SEPA mandate information using a payment instrument

The SEPA export involves the following payment instrument fields: Account Holder, IBAN, SWIFT-BIC, Direct Debit Mandate Granted and Direct Debit Mandate Reference.

Note

If there is no active payment instrument, the SEPA-relevant information is taken from the invoice or, when exporting SEPA orders from balances, from the account.

You can create and update account-specific payment instruments based on the SEPA-related information available on the account (or, if set up accordingly, on another custom object) using a dedicated flow. Once created, the payment instruments are accessible via the corresponding related list on the account detail page.

Enabling SEPA Direct Debit Mandates as payment instruments involves

Configuring SEPA Mandate Reference Counter

JustOn requires the specific invoice counter MandateReferencePaymentInstrument to act as the SEPA mandate reference counter. Once set up, the SEPA mandate reference for the payment instrument is set automatically by the flow on creation or update.

  1. Click to enter Setup, then open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Counters.

  3. Click New.
  4. Specify the details as necessary.

    • Name: MandateReferencePaymentInstrument
    • Template: Specify the pattern as necessary.

      Info

      The resulting mandate string can contain up to 35 characters. The allowed characters include the alphanumeric characters a-z A-Z 0-9, the punctuation and symbol characters +?/-:().,' and the space character.

      Note that there is no support for custom placeholders with SEPA mandate reference counters.

  5. Click Save.

Creating Flow for Managing Payment Instruments

Creating or updating SEPA mandate payment instruments requires a flow that calls the appropriate Apex class provided by JustOn. When the defined criteria are met, the flow can, generally

  • Create a new Payment Instrument record with the Account Holder, IBAN, SWIFT-BIC, Direct Debit Mandate Granted, Direct Debit Mandate Reference and Masked PAN fields populated, which will be used on SEPA XML export,
  • Deactivate an existing payment instrument and create a new one if a new IBAN value is available,
  • Deactivate all payment instruments if the IBAN value is empty.

If applicable, the flow sets the active payment instrument in the Account field Current SEPA Mandate.

The source object for the flow depends on the object to be monitored for changes to the SEPA-related information – usually Account or, if set up accordingly, on another custom object. Generally, the input data include (and must therefore be available on the source object):

Field Required Notes
Account ID
Bank Account Owner
Bank Account (IBAN) () Providing an IBAN either creates a new or updates an existing payment instrument for an account.
Executing the flow with an empty IBAN value deactivates existing payment instruments.
Bank Code (BIC) With an IBAN as bank account number, the bank code (BIC) is not required.
Direct Debit Mandate Granted Can specify a specific date, falls back to TODAY if empty

Note

Depending on your use cases, the flow setup and the objects to involve will vary.

  1. Click to enter Setup, then navigate to Process Automation > Flows.
  2. Click New Flow.
  3. Select Record-Triggered Flow and click Create.
  4. Configure the Start element.

    Option Description
    Object The object whose record modifications are to create or deactivate a payment instrument, usually Account
    Trigger The type of record change that triggers the flow, must be A record is created or updated
    Conditions The use case-specific trigger conditions, one or more filter criteria for evaluating certain field values or a formula for evaluating records
    Optimize for Actions and Related Records
  5. Click and add the following Action element.

    Option Description
    Action The Apex class to call, must be Manage Payment Instrument records for SEPA
    Input Values Invocable variables for the Apex class
    Account Id: specifies the reference to the ID field of the relevant account
    Bank Account Owner: specifies the reference to the field that holds the bank account owner
    IBAN: specifies the reference to the field that holds the IBAN, used to pass a new bank account
    BIC: optionally specifies the reference to the field that holds the bank code (BIC)
    Mandate Date: optionally specifies a specific date

    Specify a label and an API name as required.

  6. Click Save.

    Specify a label and an API name as required.

  7. Click Activate.

    When the defined conditions are met, JustOn triggers the flow. It deactivates the existing payment instrument and creates a new one with the new IBAN.

    For help about creating flows, see Flows in the Salesforce Help.

Example use case: IBAN of an account is modified

The IBAN of an account is kept in BankAccount__c. To trigger the flow when the value is modified, specify:

Flow Element Option Value
Start Object Account
Trigger A record is created or updated
Conditions All Conditions Are Met (AND)
BankAccount__c Is changed {!$GlobalConstant.True}
Action Action Manage Payment Instrument records for SEPA
Input Values Account Id: {!$Record.Id}
Bank Account Owner: {!$Record.BankAccountOwner__c}
IBAN: {!$Record.BankAccount__c}

This triggers JustOn to execute the flow when the BankAccount__c field of an account modified: It deactivates the existing payment instrument and creates a new one with the new IBAN.

Using Payment Instrument Placeholders

When using direct debits, an invoice PDF must usually show the relevant SEPA mandate information. To this end, JustOn provides a set of custom placeholders for payment instruments that can be used for the invoice PDF generation.

If enabled and set, the active payment instrument is kept in the field Current SEPA Mandate on the account. For the placeholder support, JustOn sets the active payment instrument also in the invoice field Last Payment Instrument on invoice creation and finalization if the current payment method is Direct Debit or Bank Transfer. If the conditions are not met or if the current SEPA mandate is not active, the Last Payment Instrument field is cleared.

Info

A successful SEPA Direct Debit export also updates the invoice field Last Payment Instrument. But at this stage, any new data have no further influence on the invoice PDF.

The following payment instrument-related placeholders are available by default:

Placeholder Description
[PaymentInstrumentType] The type of the payment, for example, Direct Debit.
[PaymentInstrumentAccountHolder] The name of the card holder or bank account owner.
[PaymentInstrumentMaskedPAN] The masked account number (like credit card, IBAN) as provided by the payment provider.
[PaymentInstrumentIBAN] The International Bank Account Number.
[PaymentInstrumentBIC] The Bank Identifier Code.
[PaymentInstrumentDDMandateGranted] The date on which the direct debit mandate has been granted.
[PaymentInstrumentDDMandateReference] The unique mandate reference assigned by the creditor.
[PaymentInstrumentValidUntil] The date until which the payment instrument is valid and can be captured.
[PaymentInstrumentPaymentInstitution] The name of the bank (only useful for the type Bank Account).
[PaymentInstrumentPaymentProvider] The payment provider that handles this payment instrument.

Info

You can also define your own custom placeholders with PaymentInstrument set as Source. For details, see Defining Custom Placeholder.