Mollie

The JustOn Self-Service Extension can integrate with Mollie as a payment provider. The implementation currently supports future payments only, which requires Payment Instrument records to be available.

The Mollie integration uses the Mollie Webhooks to implement the payment procedure.

Mollie webhook URL

The JustOn Self-Service Extension automatically builds the webhook URL to be called. It is transferred with every payment request.

The URL is composed of

  • the secure site URL of your Force.com site,
  • the path /services/apexrest/ONBSE1/MollieWebhook, and
  • your Mollie profile ID, like
https://<instance>.secure.force.com/services/apexrest/ONBSE1/MollieWebhook/<profileID>

The payment records in your Mollie Dashboard show the webhook URL.

Info

As opposed to the usual payment workflow (see Payment Page), the Mollie integration creates a payment balance, setting the corresponding invoice Paid, upon issuing the payment request without waiting for a success notification. If the payment processing fails, the Mollie integration triggers JustOn to delete the payment balance and to set the invoice Open again.

Setting up Mollie as a payment provider involves the following tasks:

Once set up, you can proceed to creating payment instruments in order to have your payments processed.

Creating Mollie Account

In order to use Mollie as a payment provider, you need a valid Mollie account. To create it, navigate to the Mollie website, click Sign up and follow Mollie's instructions.

To configure the integration with the JustOn Self-Service Extension, you need the API key and Profile ID. Find these values in your Mollie Dashboard.

Enabling Mollie Webhook Handler

As part of the payment-specific site setup, you must enable the specific Apex class ONBSE1.MollieWebhookHandler for your site in order to completely support the Mollie integration.

  1. Open the Site Details of your site.

    Type Sites in the Quick Find box, or navigate to User Interface > Sites and Domains > Sites. In the Sites list, click the label of the site to open its details.

  2. Click Public Access Settings to open the site profile.

  3. In the Original Profile User Interface, scroll to the Enabled Apex Class Access section, and then click Edit.

    If you use the Enhanced Profile User Interface, click Apex Class Access > Edit.

  4. Add the Apex class ONBSE1.MollieWebhookHandler to the Enabled Apex Classes list.

  5. Click Save.

Configuring Mollie Integration

To configure the Mollie integration with the JustOn Self-Service Extension:

  1. Open the Payment Provider Setup page.

    Open the Payment Provider Setup page directly, or navigate to Visualforce Pages > PaymentProviderSetup in Setup, and open the preview.

  2. Select the payment provider and click New to create a new configuration, or click Edit next to an existing configuration to modify it.

    You can create one active payment configuration per business entity and payment provider. Before creating a new configuration for an entity/provider combination that already exists, you must deactivate the existing configuration.

  3. Select the business entities for which the configuration is applicable.

    If there is no business entity selected, this configuration is used by default for all business entities.

  4. Specify a name for this configuration setting.

    Make sure to use a descriptive name that helps to unequivocally identify the configuration setting.

  5. Specify the provider-specific configuration.

    Field Required Notes
    API Key The secret API key of the test or live environment. Can be obtained from the Mollie profile.
    Profile ID The Mollie profile ID. A payment provider configuration with this profile ID must exist.
    Site Hostname The site URL of your Force.com site, like https://INSTANCE.force.com.
    Make sure to use the site URL, not the domain URL.

    When editing existing configurations, API Key and Profile ID values are not displayed. The values remain unchanged as long as you leave the corresponding fields empty.

  6. Click Add for new configurations or, respectively, Save for existing configurations.

Creating Payment Instruments

Creating payment balances with Mollie during the payment run requires payment instruments to be available.

Info

The payment instrument creation is project-specific and therefore not covered with this documentation. Generally, you can

  • Create payment instruments manually,
  • Use automation tools like Salesforce processes to have payment instruments created automatically, or
  • Use a Salesforce API (REST, SOAP, Dataloader, Apex) to insert Payment Instrument records

The following payment instrument fields must be set:

Field Label API Name Description Value
Account ONB2__Account__c The associated Salesforce account ID of this payment instrument. Salesforce account ID, like 0011t000007Lk1xAAC
Payment Provider ONB2__PaymentProvider__c The payment provider that handles this payment instrument. Mollie
Provider Specific Data ONB2__ProviderSpecificData__c JSON encoded values needed for the specific payment provider. Mollie customer ID
Mollie mandate ID
Mollie profile ID
Type ONB2__Type__c The payment instrument type. Mollie

The field Provider Specific Data must contain the following JSON keys:

Key Description
customerId The ID of the customer for whom the payment is being created.
mandateId The ID of a specific mandate must be supplied to indicate which of the consumer's accounts are to be credited.
profileId The Mollie profile ID. A payment provider configuration with this profile ID must exist.

Example for Provider Specific Data:

{
 "customerId": "cst_kEn1PlbGa",
 "mandateId": "mdt_h3gAaD5zP",
 "profileId": "pfl_beqeERw3jM"
}