Skip to content

Enabling JustOn Bank Payments

Your business may use JustOn Bank Payments to directly integrate Salesforce CRM with German or other European banks as well as payment service providers.

Info

The integration with JustOn Bank Payments as outlined below is available as of JustOn Billing & Invoice Management 2.76.

Integration Concepts

The payment functionality shipped with JustOn Bank Payments is centered around entries (see Important App Concepts). These records hold all information with respect to an amount of money owed to or requested by a business partner, based on statements that justify the corresponding request.

In JustOn Billing & Invoice Management, the produced invoices or – if set up and used – installments represent payment requests. Now integrating JustOn Billing & Invoice Management with JustOn Bank Payments provides for both

  • the creation of the relevant entry records upon invoice finalization or installment creation, and
  • the creation of the relevant balance records for a registered money flow (where the field Origin is set to JPAY1).

jpay_jo_integration
Creating entries on invoice finalization or installment creation, creating balances for payments

Balance creation details

In JustOn Bank Payments, registering a money flow for a payment record results in a modified amount value of the payment. "Translating" this to JustOn Billing & Invoice Management means to create or update balance records.

In the simplest use case, there are 1:1 relations – one invoice (or installment) makes one entry, and one payment for this entry makes one balance record associated to the invoice.

JustOn Bank Payments can, however, relate entries with payments in an n:m relationship. This allows, for example, to distribute one money transfer to multiple entries or to settle one entry with multiple money transfers.

The integration with JustOn Billing & Invoice Management provides for the creation of the relevant balances. The system takes the registered payment amount per entry and compares it to the existing payment balance (with Origin = JPAY1) of the original invoice – producing new payment balance records in the amount of the difference, associated to the original invoices or, in case of overpayments, to the related account.

The following examples illustrate this behavior.

Multiple payments for one invoice

# Step Payment Amount Settled Amount per Entry Existing Balance Produced Balances
1 Finalize invoice
I1 100
0 I1: 0
2 Partial payment
P1 80
80 80 I1: 0 I1: Payment P1 -80
3 Partial payment
P2 20
20 100 I1: -80 I1: Payment P2 -20

Multiple payments for multiple invoices

# Step Payment Amount Settled Amount per Entry Existing Balance Produced Balances
1 Finalize invoice
I1 100
0 I1: 0
2 Finalize invoice
I2 100
0 I2: 0
3 Partial payment
P1 180
180 I1: 100
I2: 80
I1: 0
I2: 0
I1: Payment P1 -100
I2: Payment P1 -80
3 Partial payment
P2 20
20 I1: 100
I2: 100
I1: -100
I2: -80
I2: Payment P1 -20

Multiple payments for an invoice with installments

# Step Payment Amount Settled Amount per Entry Existing Balance Produced Balances
1 Finalize invoice
I1 100
4 installments
0
0
0
0
I1: 0
2 Partial payment
P1 80
80 25
25
25
5
I1: 0 I1: Payment P1 -80
3 Partial payment
P2 20
20 25
25
25
25
I1: -80 I1: Payment P2 -20

Overpayment, producing a "free" balance on the account A1

# Step Payment Amount Settled Amount per Entry Existing Balance Produced Balances
1 Finalize invoice
I1 100
0 I1: 0
2 Payment
P1 120
120 I1: 100 I1: 0 I1: Payment P1 -100
A1: Payment P1 -20

Preconditions

The integration requires JustOn Bank Payments to be set up properly. For details, see Setting Up JustOn Bank Payments.

The integration requires the payment method SEPA to be set up in JustOn Billing & Invoice Management. For details, see Enabling Payment Method SEPA.

Configuring Data Relations

Enabling Lookup

As entries are always linked to the original statements, you must allow for relating the produced entries with the original invoices or statements. To this end, you create lookup fields on the Entry object.

  1. Navigate to the fields list of the Entry object.
  2. Create the following new fields.

    Label API Name Data Type Description
    Invoice Invoice Lookup (Invoice) Links to the related invoice.
    Must be writable.
    Installment Payment Lookup (Payment) Links to the related installment (Payment object).
    Must be writable.

Enabling PDF Preview

Entries provide a public link to the PDF of the original statement. To support this, you must set up the corresponding public file link generation for invoices. This involves enabling the content distribution and creating the PDF preview URL field.

To enable the content distribution:

  1. In Setup, 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 Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Always Create Content Distribution.
  5. Click Save.

To create the PDF preview URL field:

  1. Navigate to the fields list of the Invoice object.
  2. Create the following new field.

    API Name Data Type Description
    ContentDistributionUrl URL Specifies the public link to the PDF preview.
    Make sure to grant edit access for all users who finalize invoices.

Once set up, this will copy the value from the Content Distribution URL field on the invoice to the Statement Distribution URL on the produced entry.

Activating Integration

To activate the integration with JustOn Bank Payments, enable the corresponding global setting:

  1. In Setup, 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 Global Settings.

  3. Click Edit in the Default row.
  4. Select the checkbox Enable JustOn Bank Payments.
  5. Click Save.

Enabling Balance Creation

Registering a money flow for a payment record results in a modified amount value of the payment (see Integration Concepts). This modification can be used to trigger a process that creates or updates relevant balances of the related invoices (or, if applicable, the accounts).

To this end, configure a custom process that calls the appropriate Apex class provided by JustOn.

  1. In Setup, open Process Builder.

    In Salesforce Lightning, navigate to Process Automation > Process Builder.

    In Salesforce Classic, navigate to Create > Workflow & Approvals > Process Builder.

  2. Click New.

  3. Specify a (descriptive) process name.
  4. Set the process to start when A record changes.
  5. Configure the process as required.

    Step Option Description
    Add Object Object The object whose modifications are to trigger the balances creation, must be Payment (JPAY1__Payment__c)
    Be aware that both JustOn Billing & Invoice Management and JustOn Bank Payments provide a Payment object. Unfortunately, it is not immediately apparent which to pick when configuring the process trigger. To verify the selection
    1. Proceed to defining criteria.
    2. Select Conditions are met.
    3. Open the Select a Field dialog.
      The dialog must show JPAY1__Payment__c.
    If it does, just cancel the criteria definition and select No criteria -- just execute the actions.
    If it does not, abort the current process creation and start again, selecting the other Payment object as the process trigger.
    Start the process The type of record change that triggers the process, must be when a record is created or edited
    Add Criteria Criteria for Executing Actions The type of criteria, must be Conditions are met
    Set Conditions [JPAY1__Payment__c].JPAY1__SettledAmount__c Is changed True
    Add Action Action Type The type of action to be executed, must be Apex
    Apex Class The Apex class to be executed, must be Create payment balances
    Set Apex Variables Invocable variables for the Apex class, must be The ID of the Payment to specify the reference to the ID field of the Payment whose modification is to trigger the balance creation
    The ID of the Payment Field Reference [JPAY1__Payment__c].Id
  6. Click Save.

  7. Click Activate.

    When the defined process criteria are met, JustOn creates the payment balances with field Origin set to JPAY1.

    For help about creating processes, see Lightning Process Builder in the Salesforce Help.

Data Mapping

Entries hold all information with respect to an amount of money owed to or requested by a business partner. The entries' data is based on invoice data or on installments data and, if applicable, on already received payments. If a payment plan is modified after the invoice finalization producing new installments, the existing entry records are deleted, and new entry records are created accordingly.

The following fields are set on entry creation:

Data Category Entry Field Invoice Source Field Installment Source Field Default Value/Notes
General Type Debit for positive amount
Credit for negative amount
Title Invoice: custom label with invoice number
Installment: custom label with title and invoice number
Payment Reference String built as defined in the Payment Reference field of the template, see Configuring Payment Reference Text
Business Entity Tenant Invoice__r.Tenant The business entity record in JustOn Bank Payments is modified or created on entry record creation using the values given by the invoice.
Requests Requested Payment Method PaymentMethod Invoice__r.PaymentMethod
Requested Payment Provider RequestedPaymentProvider Invoice__r.RequestedPaymentProvider Optional lookup to JPAY1__PaymentProvider
Requested Payment Instrument RequestedPaymentInstrument Invoice__r.RequestedPaymentInstrument Optional lookup to JPAY1__PaymentInstrument
Requested Bank Account RequestedBankAccount Invoice__r.RequestedBankAccount Optional lookup to JPAY1__BankAccount
Customer Data BP Number DebtorNo or
Account__r.ON_DebtorNo
Invoice__r.DebtorNo or
Invoice__r.Account__r.ON_DebtorNo
Optional
BP Type Debtor
Account Account Invoice__r.Account
Account Name AccountName Invoice__r.AccountName
Contact EmailContact Invoice__r.EmailContact
Statement Data Statement Type Invoice | Installment
Statement Description
Statement No Name Invoice__r.Name
Invoice Id Invoice Lookup to entry source
Installment Id Lookup to entry source
Statement Distribution URL ContentDistributionUrl Invoice__r.ContentDistributionUrl
Dates Statement Date Date Invoice__r.Date
Statement Payment Due Date NextPaymentDueDate Date
Service Period Start ServicePeriodStart ServicePeriodStart
Service Period End ServicePeriodEnd ServicePeriodEnd
Amount Status Status PaymentStatus OpenOpen
PaidBalanced
Open Amount NextPaymentDue OpenPaymentAmount