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:
- 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:
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. -
In Setup, 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 JustOn).
- 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/
-
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.
Configuring General Object Permissions
-
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 Edit.
If you use the Enhanced Profile User Interface, click Object Settings > Object > Edit.
-
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
EditRequired when using the direct debit mandate page. Script Read
Create
Edit
Delete
View All
Modify AllSession Read
Create
Edit
Delete
View All
Modify AllStyle Read -
Click Save.
Note
All other objects must not be selected.
Configuring Field-Level Security
-
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 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.
-
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 pageSession Controlled by the general object permissions Script Controlled by the general object permissions Style Controlled by the general object permissions -
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.
-
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 Permissions Notes Account Read Balance Read
Create
EditContact 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 thePaymentProviderOverride
field is enabled. -
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
:
-
In Setup, 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:
-
In Setup, 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:
-
In Setup, 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
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.
-
In Setup, 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.
- Add the custom placeholder
[PaymentLink]
to the email body of your invoice template. - Optionally, enable the payment link display on the invoice record.
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.
-
In Setup, 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
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.
-
In Setup, 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; }