Skip to content

Salesforce Order Management

Last updated: 6th July 2022

Learn how to get started with our integration for Salesforce Order Management.

Minimum requirements

Our plugin (app) for Salesforce Order Management is compatible with:

  • SFRA v.5.0.0 – 5.3.0
  • SiteGenesis v.5.0

Supported features

  • Capture, partial capture, refund and partial refund, directly from Order Management
  • Webhook fallback logic for payment capture
  • Webhook signature for securing payment notifications

Payment authorization is done through Salesforce Commerce Cloud, not Order Management.


Supported payment methods

    Payment methodCountries

    American Express

    Global

    Diners

    Global

    Discover

    Global

    JCB

    Global

    Mastercard

    Global

    Visa

    Global


    Before you start

    To install our plugin, you must first sign in to Salesforce as an administrator. The plugin can be installed in Professional, Enterprise, Force.com, Developer and Unlimited editions.

    Before installing the plugin, make sure you've installed and configured Salesforce Order Management.


    Install the plugin

    1. Download the latest Checkout.com Payments for Order Management plugin from the Salesforce AppExchange.
    2. Choose the environment where you wish to install the plugin: production or sandbox.
    3. Select the terms and conditions checkbox and select Confirm and Install.
    4. Enter your credentials.
    5. Specify your desired security level and select Install.
    6. When the installation process has finished, select Done.

    Configure the plugin

    Create a payment gateway provider

    Creating a payment gateway provider is currently not supported from the UI. To create a payment gateway provider, follow the steps below:

    1. Sign in to Workbench using your organization’s credentials.
    2. Select Utilities > REST Explorer.
    3. Select POST as the HTTP method.
    4. In the URL box, enter: /services/data/v51.0/composite
    5. For Request Body enter:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "allOrNone": true,
    "compositeRequest": [{
    "method": "GET",
    "url": "/services/data/v51.0/query/?q=SELECT+Id+FROM+ApexClass+WHERE+Name+=+'CheckoutAdapter'",
    "referenceId": "refCheckoutAdapter"
    },
    {
    "method": "POST",
    "url": "/services/data/v51.0/sobjects/PaymentGatewayProvider",
    "referenceId": "refPaymentGatewayProvider",
    "body": {
    "ApexAdapterId": "@{refCheckoutAdapter.records[0].Id}",
    "DeveloperName": "Checkout_Payment_Provider",
    "MasterLabel": "Checkout_Payment_Provider",
    "IdempotencySupported":"Yes",
    "Comments":"Comments"
    }
    }
    ]
    }
    1. Select Execute and look for the success indicator (status codes in the 200299 range and IDs that are populated).

    Create named credentials

    Next, you'll need to set up named credentials that are needed to connect to our APIs:

    1. In Salesforce Order Management, go to Setup > Security > Named Credentials and select New Named Credential.
    2. Set the fields to the following values:
    Field nameValue

    Label

    Checkout Payment

    Name

    Checkout_Payment

    URL

    • Production: https://api.checkout.com
    • Sandbox: https://api.sandbox.checkout.com

    Identity Type

    Anonymous

    Authentication Protocol

    No Authentication

    1. Select the following checkboxes:
      • Generate Authorization Header
      • Allow Merge Fields in HTTP Header
      • Allow Merge Fields in HTTP Body
    2. Select Save.

    Create a payment gateway

    1. Go to App Launcher > Payment Gateways and select New.
    2. Specify the Payment Gateway Name (for example, Checkout CC for credit cards).
    3. For Payment Gateway Provider select the previously created Checkout.com payment gateway provider (Checkout_Payment_Provider).
    4. For Merchant Credential select the previously created Checkout.com named credentials (Checkout_Payment).
    5. Set Status to Active.
    6. For External Reference enter the payment processor ID used on the SFCC side:
      • For credit credit cards: CHECKOUTCOM_CARD
      • For APMs: CHECKOUTCOM_APM
      • For PayPal: PAYPAL_EXPRESS
      • For Google Pay: CHECKOUTCOM_GOOGLE_PAY
      • For Apple Pay: CHECKOUTCOM_APPLE_PAY
    7. Select Save.

    You'll need to set up individual payment gateways for each payment method to be processed.

    Enable webhook notifications

    To enable us to send webhook notifications to Salesforce Order Management, you'll need to create a new site:

    1. In Order Management, go to Setup > User Interface > Sites and Domains > Sites.
    2. Follow the steps on the Sites page to register your site domain. Choose a site domain name that will be used for Checkout.com webhook notifications.
    3. Select New to create a new site.
    4. Set the fields to the following values:
    Field nameValue

    Site Label

    Checkout_Notifications

    Site Name

    Checkout_Notifications

    Site Description

    Used for exposing REST services to Checkout Webhooks Notifications.

    1. In the Active Site Home Page field, specify a home page (for example, AnswersHome).
    2. Select the following checkboxes:
      • Active
      • Guest Access to the Payments API
    3. The rest of the settings can remain as they are. Select Save.
    4. On the Sites page, select the site label (Checkout_Notifications).
    5. On the Site Details page, select Public Access Settings.
    6. In the list of app settings, select Apex Class Access.
    7. On the Apex Class Access page, select Edit.
    8. In the Available Apex Classes list, select checkoutcom.CheckoutNotificationListener and add it to the Enabled Apex Classes list.
    9. Select Save.

    Give read access to the site guest user

    1. On the Site Details page for the Checkout_Notifications site, select Public Access Settings.
    2. In the list of app settings, select Object Settings.
    3. In the All Object Settings list, select Checkout_Payment_Configs.
    4. Select Edit.
    5. Under Object Permissions, select Read.
    6. Under Field Permissions, select Active and Secret Key under the Read Access column.
    7. Leave the other settings as they are and select Save.

    Create a sharing rule

    Since no authentication is used for the site, you must create a sharing rule for extending the access for the webhook notifications:

    1. Go to Setup > Security > Sharing Settings.
    2. Scroll down to Checkout_Payment_Config Sharing Rules and select New.
    3. Set the fields to the following values and select Save:
    Field nameValue

    Label

    Share Config with Webhook Notification

    Rule Name

    Share_Config_with_Webhook_Notification

    Description

    Sharing rule for webhook notification

    Rule Type

    Guest user access, based on criteria

    Criteria: Field

    Active

    Criteria: Operator

    Equals

    Criteria: Value

    True

    Share with

    Checkout_Notifications Site Guest User

    Access Level

    Read Only

    Create named credentials for notifications

    Next, you'll need to set up named credentials that are used for the webhook listener:

    1. Go to Setup > Security > Named Credentials.
    2. Select New Named Credential.
    3. Set the fields to the following values:
    Field nameValue

    Label

    Checkout Notification

    Name

    Checkout_Notification

    URL

    https://YourDomain/services/data/v51.0/commerce/payments/notify?provider=CheckoutPaymentProviderId

    Identity Type

    Anonymous

    Authentication Protocol

    No Authentication

    In the URL box, for YourDomain enter your organization’s site domain. For CheckoutPaymentProviderId, enter the ID of the payment gateway provider. To find the ID, open the Workbench and select Queries > SOQL Query. Set Object to PaymentGatewayProvider, select all the fields, and select Query.

    1. Select Generate Authorization Header.
    2. Select Save.

    Webhook fallback settings

    We've implemented a fallback to ensure that payments are processed even if the webhook service is unavailable. You can schedule a job to check the payment status in the Checkout.com Hub and update the payment in Order Management. The check is done for payments with a Pending status in Order Management. If a payment is captured in the Hub, it will be marked as processed in Order Management.

    To schedule the job, follow the steps below:

    1. Go to Setup > Custom Code > Apex Classes and select Schedule Apex.
    2. Specify the job name (for example, Checkout Webhook Fallback).
    3. For Apex Class select WebhooksfallbackBatch_Scheduable.
    4. Specify how often the Apex class will run:
      • Weekly: Select one or more days of the week (for example, Monday and Wednesday).
      • Monthly: Select either the date the job is to run or the day (for example, the second Saturday of every month).
    5. Set the start and end dates for the Apex scheduled class. If you specify a single day, the job only runs once.
    6. Specify a preferred start time. The exact time the job starts depends on service availability.
    7. Select Save.

    You can view all scheduled jobs by selecting Setup > Environments > Jobs > Scheduled Jobs.

    Checkout.com account configuration

    1. Select the App Launcher and search for Checkout_Payment_Configs.
    2. Select New.
    3. In the Checkout_Payment_Config Name field, specify the name (for example, Checkout Settings).
    4. For Webhook Endpoint enter the endpoint for the previously created site: https://YourDomain/services/apexrest/checkoutcom/Checkout_Notifications
    5. Enter the secret key and public key from your Hub account.
    6. Select the Active checkbox.
    7. Select your organization’s currency.
    8. Select Save.

    When you create or update a Checkout Payment Config that is set as active, you are subscribed to the Checkout.com webhook notifications using the webhook endpoint as the URL. To see which events you are subscribed to, go to Setup > Custom Code > Custom Metadata Types > Webhook Event Types. By default, all webhook events are marked as subscribed and should remain as they are to ensure that the right webhook notifications are processed.