Payment-Specific Site Setup

The JustOn Self-Service Extension includes a payment page. Use this page to provide your users the option to complete their checkout process, directly paying for their purchases. To this end, the JustOn Self-Service Extension can integrate with payment service providers.

Info

This article describes how set up the payment page as part of the JustOn Self-Service Extension.

For details about integrating payment service providers, see Payment Provider Integration.

The common payment-specific setup tasks, which are required for any of the payment provider integrations, include:

Next steps:

Payment Provider Integration

Disabling Lightning Features

By default, Salesforce Sites allow guest users to access dedicated Lightning features. For the proper functioning of the JustOn Self-Service Extension, however, this is not necessary.

In order to prevent unauthorized access via Lightning components and to ensure the security of your site, you must disable the Lightning features for site guest users.

  1. Open the Site Edit page of your site.

    Type Sites in the Quick Find box, or navigate to User Interface > Sites and Domains > Sites. In the Sites list, click Edit in the row of the site.

  2. Deselect the checkbox field Lightning Features for Guest Users.

  3. Click Save.

Defining URL Rewriter Class

For the proper functioning of the payment page, you must set a URL rewriter for your site.

  1. Open the Site Edit page of your site.

    Type Sites in the Quick Find box, or navigate to User Interface > Sites and Domains > Sites. In the Sites list, click Edit in the row of the site.

  2. In the URL Rewriter Class field, specify URLRewriter.

  3. Click Save.

Defining JustOn Base URL

For the proper functioning of the payment page, you must define the URL of your site as the base URL for JustOn.

  1. Copy your new site's URL.

    Find the site URL on the Sites page. Type Sites in the Quick Find box, or navigate to User Interface > Sites and Domains > Sites.

  2. 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.

  3. Click Manage in the row of Global Settings (with the namespace prefix ONB2).

  4. Click Edit in the Default row.
  5. Paste the copied URL into the field Base URL.

    Make sure to use the secure connection URL and to end the Base URL entry with a trailing slash /, like

    https://<instance>.secure.force.com/
    

    or, if enhanced domains are enabled in your org, like

    https://<mydomain>.my.salesforce-sites.com/
    
  6. Click Save.

Assigning Payment-Specific Pages

You must add a number of Visualforce pages to your site to expose the payment-specific functionality.

  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. In the Site Visualforce Pages section, click Edit.

  3. Add the following common pages.

    • ONB2.InvoicePDF
    • ONBSE1.Payment
    • ONBSE1.PaymentResult
    • ONBSE1.PaymentProviderSetup
  4. Add the pages that are required for your payment provider integration.

    Provider Page
    PayPal ONBSE1.PaypalIPN
    ONBSE1.PaypalBuyerReturn
    CyberSource ONBSE1.CyberSourceNotification
    ONBSE1.CyberSourceBuyerReturn
    Stripe ONBSE1.PaymentStripe
    Mollie ONBSE1.PaymentMollie
  5. Click Save.

Configuring Payment-Specific Public Access Settings

The payment support needs access to a number of standard objects and custom objects in order to work correctly. To this end, you must allow/restrict access both on object and field level.

  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 Enhanced Profile User Interface, click Object Settings > Object > Edit.

    If you use the Original Profile User Interface, click Edit, or scroll to the Field-Level Security section, click View next to the object you want to modify, and then click Edit.

  4. Apply the following object permission settings.

    Standard Object Permissions

    Object Object Permissions Field Permissions
    Account Read Read access for all fields

    Custom Object Permissions

    Object Object Permissions Field Permissions
    Balance Read
    Create
    Edit access for all fields
    Number Range Read
    Create
    Edit access for all fields
    Required when using the direct debit mandate page
    Script Read
    Create
    no particular settings – controlled by the general object permissions
    Session Read
    Create
    no particular settings – controlled by the general object permissions
    Style Read no particular settings – controlled by the general object permissions
  5. Click Save.

Note

All other objects must not be selected.

Configuring Apex Class Access Permissions

Your business may decide to use Stripe or Mollie as a payment provider. If you do so, you must enable a specific Apex class (ONBSE1.StripeWebhookHandler or ONBSE1.MollieWebhookHandler, respectively) for your site in order to completely support the 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 provider-specific Apex class to the Enabled Apex Classes list.

    Payment Provider Required Apex Class
    Stripe ONBSE1.StripeWebhookHandler
    Mollie ONBSE1.MollieWebhookHandler
  5. Click Save.

Configuring Payment-Specific Permission Set

Info

To apply this configuration, your site must be set active.

To successfully finish a payment, the site guest user needs additional permissions for a number of objects and fields. Due to restrictions in Salesforce, a part of the required permissions must be configured manually, others are already bundled in the permission set PaymentGuest, which is shipped with the JustOn Self-Service Extension.

Hence, enabling access for the site guest user usually involves the following tasks:

Creating Custom Permission Set

To create a custom permission set to allow accessing the Balance object as well as the Account and Contact objects:

  1. Create a new permission set.

    You can, for example, clone the PaymentGuest permission set, and then add the required additional permissions to the created copy.

    For details, see Create Permission Sets in the Salesforce Help.

  2. Configure the additional object settings in the new permission set.

    Click Object Settings > Object > Edit, and apply the following object permission settings.

    Object Object Permissions Additional Field Permissions
    Account Read
    Balance Read
    Create
    Contact Read
    Invoice Read Read access to Content Distribution URL, PaymentProviderOverride and, optionally if set up, to DisablePaymentLink and DisablePaymentLinkMessage.
  3. Enable the access to custom settings for the new permission set.

    1. Click System Permissions > Edit.
    2. Select the checkbox View All Custom Settings.
    3. Click Save.

Assigning Permission Sets

To assign the required permission sets to the site guest user:

  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, click View Users.

    If you use the Enhanced Profile User Interface, click Assigned Users.

  4. Open the details of the Site Guest User, and scroll to the Permission Set Assignments section.

  5. Click Edit Assignments.
  6. Select both the permission set PaymentGuest and the custom permission set created before, and click Add.
  7. Click Save.

Enabling Access Sharing Rules

Invoices and related records are not visible to the site guest user unless there is a corresponding sharing rule defined. The sharing rules give access to invoices in the statuses Open, Paid and Settled (and to their related templates) in order to allow the site guest users to make the payment.

For details about sharing rules, see Sharing Rules in the Salesforce Help.

Enabling the access sharing rules involves three steps:

Enabling Sharing Setting

To enable the sharing setting Secure guest user record access:

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

    In Salesforce Lightning, navigate to Setup > Security > Sharing Settings.

    In Salesforce Classic, navigate to Setup > Security Controls > Sharing Settings.

  2. In the Organization-Wide Defaults section, click Edit.

  3. Navigate to the Other Settings section.
  4. Select the checkbox Secure guest user record access.
  5. Click Save.

Creating Invoice Sharing Rule

To configure the invoice sharing rule:

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

    In Salesforce Lightning, navigate to Setup > Security > Sharing Settings.

    In Salesforce Classic, navigate to Setup > Security Controls > Sharing Settings.

  2. In the Invoice Sharing Rules section, click New.

  3. Specify a meaningful label and rule name in the corresponding fields.
  4. Select the rule type Guest user access, based on criteria.
  5. Configure the sharing criteria as follows:

    Status equals Open,Paid,Settled

  6. In the Share with field, select Self Service Site Guest User.

  7. Select the access level Read Only.
  8. Click Save.

Creating Template Sharing Rule

To configure the template sharing rule:

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

    In Salesforce Lightning, navigate to Setup > Security > Sharing Settings.

    In Salesforce Classic, navigate to Setup > Security Controls > Sharing Settings.

  2. In the Template Sharing Rules section, click New.

  3. Specify a meaningful label and rule name in the corresponding fields.
  4. Select the rule type Guest user access, based on criteria.
  5. Configure the sharing criteria as follows:

    Language equals <locale>

    If you use templates in English, German, French and Spanish, for example, use

    Language equals en,de,fr,es

  6. In the Share with field, select Self Service Site Guest User.

  7. Select the access level Read Only.
  8. Click Save.

Configuring Payment Page

The proper setup of the payment page requires additional configuration tasks:

Enabling Multi-Currency Support

Due to a Salesforce defect, the payment page may not display the correct currency symbol. If you have a single-currency org, the currency determined by the locale preference set in a user's browser overrules the default currency set on the org – which is not necessarily the currency you want to display to your customers. With multi-currency orgs, however, the browser settings do not affect the currency display.

Info

To ensure the correct currency display, JustOn recommends to enable multi-currency support for your org, even if you work with one currency only.

  1. Click to enter Setup, then open Company Information.

    In Salesforce Lightning, navigate to Company Settings > Company Information.

    In Salesforce Classic, navigate to Company Profile > Company Information.

  2. Click Edit.

  3. Select Activate Multiple Currencies.
  4. Click Save.
  5. Open Manage Currencies.

    In Salesforce Lightning, navigate to Company Settings > Manage Currencies.

    In Salesforce Classic, navigate to Company Profile > Manage Currencies.

  6. Add, activate or deactivate currencies as necessary.

    For details about working with multiple currencies, see Manage Multiple Currencies in the Salesforce Help.

Enabling Access to Payment Page

Once the JustOn Self-Service Extension is properly set up to function with the payment page, JustOn creates a link to the payment page for a given invoice. You can include this link to your invoice email in order to redirect your users to the payment page.

To configure and use the payment page link:

  1. Make sure that the base URL is configured properly.

    For details, see Defining JustOn Base URL.

  2. Add the custom placeholder [PaymentLink] to the email body of your invoice template.

    For details, see Modifying Invoice Email.

  3. Optionally, enable the payment link display on the invoice record.

    For details, see Displaying Payment Link.

Enabling Partial Payments

By default, the payment page shows the complete amount due. Users are not allowed to modify the payment amount.

Your business may, however, require to allow partial payments for invoices. To this end, enable the global setting Allow partial payments and, optionally, Full payment amount.

Note

This setting globally affects all payment providers and payment methods.

  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 Global Settings (for the JustOn Self-Service Extension).

  3. Click Edit in the Default row.
  4. Select the checkbox Allow partial payments and, optionally, Full payment amount.

Info

Once the setting is enabled, the payment page displays the current payment amount due in a large font directly above the payment button. Depending on the device, the user can select the value using the mouse, finger or keyboard, and then change the value. The system validates the specified amount by the following rules:

  • The amount must be equal or larger than 1.
  • The amount must be lower or equal to the maximum payment amount.
  • The maximum payment amount is either the current amount due or the overall outstanding amount (if Full payment amount is enabled).
  • The amount must not have more than two decimal places.

Adjusting Payment Page Labels

The Visualforce pages packaged with the JustOn Self-Service Extension make use of custom labels. The custom labels can contain up to 1000 characters and can include HTML markup.

You can overwrite the custom labels to adjust them to the needs of your business use cases.

The following graphic illustrates the most significant custom labels on the payment page and their position.

paymentpage

Position Custom Label Description
1 Invoice The "lead text" in front of the invoice number. The combination of this label and the actual invoice ID serves as both the heading for the invoice info section and the text on the PDF download link.
2 InvoiceDate The visible label of the Date field in the invoice info section.
3 InvoiceGrandTotal The visible label of the Grand Total field of the invoice as displayed in the invoice info section.
4 InvoiceNet The visible label of the Total (net) field of the invoice as displayed in the invoice info section.
5 InvoiceTax The visible label of the Total (tax) field of the invoice as displayed in the invoice info section.
6 InvoiceReceived The visible label of the Balance Difference field of the invoice as displayed in the invoice info section.
7 PaymentAmount The visible label of the Balance field of the invoice as displayed in the invoice info section.
8 PaymentOptions The heading of the payment section.
9 PaymentTeaser Text to be displayed above the payment method list.
10 PayNow The visible label of the payment button.
11 PaymentFinePrint Text to be displayed below the payment button. Use it, for example, to inform your users about payment options, conditions, etc.

Other, more specific labels include:

  • NoInvoiceAvailable
  • PaymentCancel
  • PaymentException
  • PaymentUseOtherPaypalPaymentOption
  • PaymentPaypalTokenTimedOut
  • PaymentSuccess
  • InvoiceSummary
  • DownloadPDF
  • InvoiceNo
  • Cancel
  • CardNumber
  • CardIssuer
  • CvcHelp
  • Expires
  • CardHolder
  • PaymentFinePrintStripeCreditcard
  • PaymentFinePrintStripeSepa
  • PaymentFinePrintStripeAlipay
  • UseForFuturePayments
  • DisablePaymentLinkMessage

The custom labels PaymentFinePrintStripeCreditcard, PaymentFinePrintStripeSepa and PaymentFinePrintStripeAlipay are displayed when using Stripe as the payment provider. Make sure to provide an appropriate text for these labels before going live with Stripe. For example, the label PaymentFinePrintStripeSepa should show the SEPA mandate acceptance notification.

The custom label UseForFuturePayments is displayed when Stripe is set up to allow for future payments.

The custom label DisablePaymentLinkMessage is displayed when the payment link has been disabled. If the optional invoice field DisablePaymentLinkMessage__c is created and not empty, it replaces the custom label.

Note

To modify custom labels, you must enable the Translation Workbench. For details, see Enable and Disable the Translation Workbench in the Salesforce Help.

  1. Click to enter Setup, then open the Custom Labels list.

    In Salesforce Lightning, navigate to User Interface > Custom Labels.

    In Salesforce Classic, navigate to Create > Custom Labels.

  2. Click the name of the label you want to modify.

    To better find the relevant labels, create a filter for the namespace ONBSE1.

  3. Click New Local Translations/Overrides.

  4. Select the target language and specify the text as required.
  5. Click Save.

    For help about modifying custom labels, see Create and Edit Custom Labels in the Salesforce Help.

Info

Set the locale in the global settings in order to select the intended translation.

To customize your payment page, you can add a logo image.

  1. Create a corresponding style record.
  2. Set the Payment Page as the target page.
  3. Provide the following content:

    .content::before {
        content: url(<image_path>);
        display: block;
        text-align: center;
    }
    

    Info

    Make sure that <image_path> both produces an actual image file and is accessible by the intended users.

Modifying Page Title

The title of the payment page, which is displayed in the browser tab or window title, is taken from the template field Display Type (see PDF Contents). To modify this value:

  1. Open the relevant template or template detail.
  2. In the Header & Footer section, double-click the Display Type field and specify the text to be displayed.
  3. Click Save.

Some use cases may require to disable the payment link – for example, the invoice is still open but the claim has been transferred to a debt collection agency. In this case, the user must no longer pay the invoice to the merchant but is supposed to settle the claim with the debt collection agency.

To support this scenario, you create the checkbox field DisablePaymentLink on the invoice.

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

    API Name Required Data Type Description
    DisablePaymentLink Checkbox or
    Formula (Checkbox)
    Determines whether to display the payment options (default) or the "payment disabled" message.
    Use a checkbox to disable the payment manually or by a flow, or use a formula to disable the payment automatically, for example, if the field Debt Collection Agency is set.
    DisablePaymentLinkMessage Text or
    Formula (Text)
    Optional text to be displayed instead of the custom label DisablePaymentLinkMessage.

    Now if the checkbox is selected, the payment page shows the DisablePaymentLinkMessage message instead of the payment options. The default message is taken from the custom label DisablePaymentLinkMessage. To allow for a more flexible configuration, use the optional field DisablePaymentLinkMessage – if the field is not empty, its value replaces the custom label.

Info

Make sure that the permission set for the site guest user includes read access to the fields DisablePaymentLink and DisablePaymentLinkMessage.

Next Steps

Payment Provider Integration