Skip to content

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

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. In Setup, 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 (for JustOn).

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

Configuring General Object Permissions

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

    If you use the Enhanced Profile User Interface, click Object Settings > Object > Edit.

  4. Apply the following object permission settings.

    Standard Object Permissions

    Object Permissions
    Account Read

    Custom Object Permissions

    Object Permissions Notes
    Balance Read
    Create
    Edit
    (Delete)
    When using Stripe, the Delete permission is required to support the refund functionality.
    When using Mollie, the Delete permission is required to allow for balance deletion in case of payment processing failures.
    Number Range Read
    Create
    Edit
    Required when using the direct debit mandate page.
    Script Read
    Create
    Edit
    Delete
    View All
    Modify All
    Session Read
    Create
    Edit
    Delete
    View All
    Modify All
    Style Read
  5. Click Save.

Note

All other objects must not be selected.

Configuring Field-Level Security

  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 Field-Level Security section, click View next to the object you want to modify, and then click Edit.

    If you use the Enhanced Profile User Interface, click Object Settings > Object > Edit.

  4. Specify the required access levels.

    Field-Level Security for Standard Objects

    Object Permissions
    Account Read access for all fields

    Field-Level Security for Custom Objects

    Object Permissions
    Balance Edit access for all fields
    Number Range Edit access for all fields
    Required when using the direct debit mandate page
    Session Controlled by the general object permissions
    Script Controlled by the general object permissions
    Style Controlled by the general object permissions
  5. Click Save.

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 Permissions Notes
    Account Read
    Balance Read
    Create
    Edit
    Contact Read
    (Edit)
    When using Mollie, Edit access is required for the field Mollie Customer Id.
    Invoice Read Required for context-specific payment settings. Make sure that Read access to the PaymentProviderOverride field is enabled.
  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. In Setup, 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. In Setup, 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. In Setup, 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. In Setup, 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:

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

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.

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. In Setup, 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;
    }