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:
- Disabling lightning features for site guest users
- Defining URL rewriter class
- Defining JustOn base URL
- Assigning payment-specific pages
- Configuring payment-specific public access settings
- Configuring Apex class access permissions
- Configuring payment-specific permission set
- Enabling access sharing rules
- Configuring payment page
Next steps:
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.
-
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. -
Deselect the checkbox field
Lightning Features for Guest Users
. - Click Save.
Defining URL Rewriter Class
For the proper functioning of the payment page, you must set a URL rewriter for your site.
-
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. -
In the
URL Rewriter Class
field, specifyURLRewriter
. - 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.
-
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. -
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.
-
Click Manage in the row of Global Settings (with the namespace prefix
ONB2
). - Click Edit in the Default row.
-
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/
, likehttps://<instance>.secure.force.com/
or, if enhanced domains are enabled in your org, like
https://<mydomain>.my.salesforce-sites.com/
-
Click Save.
Assigning Payment-Specific Pages
You must add a number of Visualforce pages to your site to expose the payment-specific functionality.
-
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. -
In the Site Visualforce Pages section, click Edit.
-
Add the following common pages.
- ONB2.InvoicePDF
- ONBSE1.Payment
- ONBSE1.PaymentResult
- ONBSE1.PaymentProviderSetup
-
Add the pages that are required for your payment provider integration.
Provider Page PayPal ONBSE1.PaypalIPN
ONBSE1.PaypalBuyerReturnCyberSource ONBSE1.CyberSourceNotification
ONBSE1.CyberSourceBuyerReturnStripe ONBSE1.PaymentStripe Mollie ONBSE1.PaymentMollie -
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.
-
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. -
Click Public Access Settings to open the site profile.
-
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.
-
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
CreateEdit access for all fields Number Range Read
CreateEdit access for all fields
Required when using the direct debit mandate pageScript Read
Createno particular settings – controlled by the general object permissions Session Read
Createno particular settings – controlled by the general object permissions Style Read no particular settings – controlled by the general object permissions -
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.
-
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. -
Click Public Access Settings to open the site profile.
-
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.
-
Add the provider-specific Apex class to the Enabled Apex Classes list.
Payment Provider Required Apex Class Stripe ONBSE1.StripeWebhookHandler Mollie ONBSE1.MollieWebhookHandler -
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 a custom permission set to allow accessing the Balance object as well as the Account and Contact objects
- Assigning the site guest user the custom permission set and the permission set
PaymentGuest
Creating Custom Permission Set
To create a custom permission set to allow accessing the Balance object as well as the Account and Contact objects:
-
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.
-
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
CreateContact Read Invoice Read Read access to Content Distribution URL
,PaymentProviderOverride
and, optionally if set up, toDisablePaymentLink
andDisablePaymentLinkMessage
. -
Enable the access to custom settings for the new permission set.
- Click System Permissions > Edit.
- Select the checkbox
View All Custom Settings
. - Click Save.
Assigning Permission Sets
To assign the required permission sets to the site guest user:
-
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. -
Click Public Access Settings to open the site profile.
-
In the Original Profile User Interface, click View Users.
If you use the Enhanced Profile User Interface, click Assigned Users.
-
Open the details of the Site Guest User, and scroll to the Permission Set Assignments section.
- Click Edit Assignments.
- Select both the permission set
PaymentGuest
and the custom permission set created before, and click Add. - 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 the sharing setting
Secure guest user record access
- Creating the invoice sharing rule
- Creating template sharing rule
Enabling Sharing Setting
To enable the sharing setting Secure guest user record access
:
-
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.
-
In the Organization-Wide Defaults section, click Edit.
- Navigate to the Other Settings section.
- Select the checkbox
Secure guest user record access
. - Click Save.
Creating Invoice Sharing Rule
To configure the invoice sharing rule:
-
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.
-
In the Invoice Sharing Rules section, click New.
- Specify a meaningful label and rule name in the corresponding fields.
- Select the rule type
Guest user access, based on criteria
. -
Configure the sharing criteria as follows:
Status
equals
Open,Paid,Settled
-
In the
Share with
field, selectSelf Service Site Guest User
. - Select the access level
Read Only
. - Click Save.
Creating Template Sharing Rule
To configure the template sharing rule:
-
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.
-
In the Template Sharing Rules section, click New.
- Specify a meaningful label and rule name in the corresponding fields.
- Select the rule type
Guest user access, based on criteria
. -
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
-
In the
Share with
field, selectSelf Service Site Guest User
. - Select the access level
Read Only
. - Click Save.
Configuring Payment Page
The proper setup of the payment page requires additional configuration tasks:
- Enabling multi-currency support for your org
- Enabling access to the payment page for users
- Enabling partial payments
- Adjusting payment page labels
- Adding logo to the page
- Optionally, allowing to disable the payment link
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.
-
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.
-
Click Edit.
- Select
Activate Multiple Currencies
. - Click Save.
-
Open Manage Currencies.
In Salesforce Lightning, navigate to Company Settings > Manage Currencies.
In Salesforce Classic, navigate to Company Profile > Manage Currencies.
-
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:
-
Make sure that the base URL is configured properly.
For details, see Defining JustOn Base URL.
-
Add the custom placeholder
[PaymentLink]
to the email body of your invoice template.For details, see Modifying Invoice Email.
-
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.
-
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.
-
Click Manage in the row of Global Settings (for the JustOn Self-Service Extension).
- Click Edit in the Default row.
- 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.
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.
-
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.
-
Click the name of the label you want to modify.
To better find the relevant labels, create a filter for the namespace
ONBSE1
. -
Click New Local Translations/Overrides.
- Select the target language and specify the text as required.
-
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.
Inserting Logo
To customize your payment page, you can add a logo image.
- Create a corresponding style record.
- Set the
Payment Page
as the target page. -
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:
- Open the relevant template or template detail.
- In the Header & Footer section, double-click the
Display Type
field and specify the text to be displayed. - Click Save.
Disabling Payment Link
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.
- Navigate to the fields list of the Invoice object.
-
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 fieldDebt 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 labelDisablePaymentLinkMessage
. To allow for a more flexible configuration, use the optional fieldDisablePaymentLinkMessage
– 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