Skip to content

Implementation Example

The JustOn Self-Service Extension includes an example implementation that demonstrates the provided functionality. You can use this demo site as a model when creating your own implementation, or just modify the example, adjusting it to your requirements.

The example implementation includes the following components:

sse_site
Implemented example site

Login Page

At first access, the login page shows a login button for each configured identity provider. A returning user only sees the button of the last used identity provider. This information is stored in a cookie.

Authenticated users are redirected to the page defined in the global setting Redirect after login.

The page uses the following custom labels, which are to be overwritten:

  • Login
  • LoginTeaser
  • LoginOAuth
  • LoginPassword
  • Username
  • Password
  • LoginFinePrint
  • LoginWithAmazon
  • SignInWithGoogle
  • LoginWithPaypal

Products Page

Info

The products page is only visible for authenticated users. Otherwise it redirects to the login page.

Features

The example products page shows all master items and master products, which are available for checkout. The items are retrieved using the MasterItemRetriever.

Info

Typically, you choose to present either master items or master products for checkout, depending on your business requirements. You can, however, combine the two approaches.

Users can add master items and master products to a cart. Once an item or product has been added to the cart, users can change its quantity. The page considers scaled prices and commissions defined for the master items.

When users click Checkout, the page calls the SubscriptionManager, which creates or updates a subscription. After the subscription has been created, the user is redirected to the subscriptions page, on which the new subscription is highlighted.

Used Custom Labels

The page uses the following custom labels, which are to be overwritten:

  • Products
  • MasterItems
  • MasterItemTeaser
  • add
  • MasterItemFinePrint
  • Cart
  • CartTeaser
  • remove
  • checkout
  • CartFinePrint

Additional Configuration

Product Images

If there is an image attachment found on the master item or master product, it is displayed as the product logo.

Master Item Fields

You can define the fields of the master item that are to be displayed on the products page. To this end, use the global setting Master Item Fields:

  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.
  3. Click Edit in the row of Default.
  4. In Master Item Fields, specify the fields to be shown on the Products page.
  5. Click Save.

Info

If there is no setting specified, it defaults to ONB2__Title__c,ONB2__Description__c.

Sort Order

You can define the display order of master items and master products. To do so, use the global settings Master Item Sort Order or Pricebook Entry Sort Order, respectively.

  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.
  3. Click Edit in the row of Default.
  4. In Master Item Sort Order or Pricebook Entry Sort Order, specify the SOQL order statement.
  5. Click Save.

Info

If there is no sort order defined, it defaults to the creation date.

Shopping Cart Fields

You use the custom setting Cart to define which fields of an item are visible after the item has been added to the shopping cart.

Field Possible Values Description
Name string A unique name for the record.
Fieldname any item field The API name of the field of the ONB2__Item__c object to be displayed, like ONB2__Title__c.
Must be enabled in the Public Access Settings of the Force.com site.
Read Only (checkbox) true
false
Determines whether the field is editable or not.
Required (checkbox) true
false
If the field is set editable, this setting determines whether it is required or not.
Sequence positive integer A number that defines the display order of the cart fields.
Type any, including empty The field is only shown for items with that specific type.
You must add the field ON_ProductType__c to the Item object and the Product2 object if you use master products

Note

Create a Cart record for each field to be visible.

  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 Cart.
  3. Click New.
  4. Specify the information as necessary.
  5. Click Save.

Info

If there are no cart fields defined, the system falls back to Title (read only) and Quantity (editable).

Subscriptions Page

Info

The subscriptions page is only visible for authenticated users. Otherwise it redirects to the login page.

Features

The example subscriptions page shows all subscriptions for the authenticated user. The page uses the SubscriptionRetriever in order to get the subscriptions of the current user.

The page shows the list of subscriptions in reverse chronological order. Each subscription shows the name, creation date and a list of items. Each item shows the title, unit price and quantity.

If the first subscription is highlighted (after checkout), the page shows the additional label FirstSubscriptionInfo.

Optionally, the page can display a welcome message. To do so, provide the parameter welcome=true.

Used Custom Labels

The page uses the following custom labels, which are to be overwritten:

  • Subscriptions
  • SubscriptionsWelcomeMessage
  • ActiveSubscriptions
  • SubscriptionsTeaser
  • FirstSubscriptionInfo
  • Position
  • Title
  • UnitPrice
  • Quantity
  • SubscriptionsFinePrint

Invoices Page

Info

The invoices page is only visible for authenticated users. Otherwise it redirects to the login page.

Features

The example invoices page shows all invoices for the authenticated user. The page uses the InvoiceRetriever in order to get the invoices of the current user.

The page shows the list of invoices in reverse chronological order. Each invoice shows the invoice number, date and payment amount, as well as a link to the invoice PDF file.

Used Custom Labels

The page uses the following custom labels, which are to be overwritten:

  • Invoices
  • InvoicesTeaser
  • InvoiceNo
  • InvoiceDate
  • PaymentAmount
  • InvoiceStatus
  • PDFLink
  • ViewInvoice
  • InvoicesFinePrint

Payment Page

The payment page shows an overview of an invoice and allows users to view or download the invoice PDF. If there are configured payment providers, the page also displays buttons to trigger the payment process for the current invoice.

Info

The payment process implementation is payment provider-specific.

Enabling Access to Payment Page

Once the JustOn Self-Service Extension is properly set up to function with the payment page, JustOn can create 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:

General Payment Process

(1) The user clicks Pay Now for one of the available payment providers.
(2) This displays an input form that allows to enter the banking details.
(3) The user clicks the pay button of the input form.
(4) If the input data is not valid, the input form displays an error message.
(5) If the input data is valid, the amount of the invoice is captured.
(6) If the capture is successful, JustOn creates a Balance record for the captured amount, and displays the success message. The balance field TransactionNo is set to a provider-specific transaction number for this capture.
(7) If the capture is not successful, JustOn creates a Payment Entry record that holds the provider-specific information about the failed capture, and displays an error message.

Info

The payment page is also visible for unauthenticated users.

Used Custom Labels

The page uses the following custom labels, which are to be overwritten:

  • PayeezyWarnClose
  • PayeezyNoCvc
  • NoInvoiceAvailable
  • PaymentCancel
  • PaymentException
  • PaymentUseOtherPaypalPaymentOption
  • PaymentPaypalTokenTimedOut
  • PaymentSuccess
  • InvoiceSummary
  • DownloadPDF
  • InvoiceNo
  • InvoiceDate
  • InvoiceNet
  • InvoiceTax
  • InvoiceGrandTotal
  • InvoiceReceived
  • InvoicePaymentAmount
  • PayNow
  • Cancel
  • PaymentTeaser
  • PaymentFinePrint
  • PaymentOptions
  • PaymentAmount
  • CardNumber
  • CardIssuer
  • CvcHelp
  • Expires
  • CardHolder

Profile Page

The example profile page enables users to modify their account and contact information, like name, email or billing address. The page uses the DefaultSessionHandler in order to retrieve the account and contact information.

Info

The profile page is only visible for authenticated users. Otherwise it redirects to the login page.

Configuring Visible Fields

The page shows all contact and account fields that are configured using the custom setting Profile.

Note

Create a Profile record for each field to be visible on the profile page.

  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 Profile.
  3. Click New.
  4. Specify the information as necessary.
    For details, see Profile.
  5. Click Save.

Info

Fields may require a value. If they are empty and the profile is therefore considered incomplete, the user is always redirected to the Profile Edit page until all required information is provided.

Once the profile is complete, the user is redirected to the page defined in the global setting Redirect after profile complete.

Overriding Field Labels

You use record of the custom setting Field Label to override the field labels of updatable fields. Labels that are not overwritten show the default label, which is also visible in Salesforce.

Field Description
Name A unique name for the record.
Object Name The name of the target object, like Account or Contact.
Field Name The API name of the target field, like BillingStreet or ONB2__TaxNumber__c.
Label The text to use to override the original label.

Note

Create a Field Label record for each field to be overridden.

  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 Field Label.
  3. Click New.
  4. Specify the information as necessary.
  5. Click Save.
Multi-Language Configuration

If you use multiple languages, you can define additional fields using the Field Label custom setting that hold language-specific translations for labels:

Field NameData TypeDescription
deText (255)German translation
enText (255)English translation
en_GBText (255)British English translation
frText (255)French translation

Make sure to provide a field and translation for each activated language. If there is no language-specific field or content, the system uses the content of the Label field.

Used Custom Labels

The page uses the following custom labels, which are to be overwritten:

  • Profile
  • ProfileTeaser
  • Edit
  • Save
  • Cancel
  • ProfileFinePrint

The header component is used on every page. It displays a logo and the site name, as well as the site navigation.

Note

The image file that you intend to use as the site logo must be stored as a file in the Salesforce Documents tab and selected as Externally Available Image.

The logo file is enabled in the global setting Logo Name:

  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.
  3. Click Edit in the row of Default.
  4. In Logo Name, specify the name of the logo image file.
  5. Click Save.

▶ This includes the specified file as the logo in the page header.

Defining Home URL

You can specify a URL that is to be opened when a user clicks the site logo or site name - usually, the site home page. The link target is defined in the global setting Home URL:

  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.
  3. Click Edit in the row of Default.
  4. In Home URL, specify the intended URL.
  5. Click Save.

▶ The specified URL is now opened when a user clicks the site logo or site name.

Info

If there is no URL configured, clicking the site logo or site name has no effect.

Used Custom Labels

The component uses the following custom labels, which are to be overwritten:

  • SiteName
  • SiteDescription

The footer component is used on every page. It displays a footer text.

The component uses the following custom labels, which are to be overwritten:

  • Footer
  • Footer2
  • Footer3

Logout

The logout component is used on every page. It displays the user name, the identity provider and a logout button.

The component uses the following custom labels, which are to be overwritten:

  • Logout