On This Page
Salesforce Order Management
Salesforce Order Management helps you manage orders and delivers a seamless, omnichannel
commerce experience to your customers. It is integrated with B2C Commerce and supports
Service Cloud to provide a single view of your order and service history.
With Salesforce Order Management:
- Customers can submit orders from any commerce channel and manage their orders throughout the order cycle.
- Merchants can manage order fulfilment, shipping, payment capture, invoicing, and service with integrated and custom business processes and workflows.
- Service agents can access a central repository of order-related information to see the entire order lifecycle and to process cancellations and returns.
Requirements
You must fulfill these requirements to use Salesforce Order Management:
- Open a Cybersource sandbox account to use for testing. For more information, see Signing Up for a Sandbox Account.
- Open a Salesforce account with access to your cloud instance.
- Obtain an API key and API shared secret key to authenticate requests. For more information, see Creating a Shared Secret Key Pair.
- Know how to configure and work within Salesforce. This guide does not explain how to work with Salesforce software, so you must already be familiar with Salesforce products.
Integrating with Salesforce
To integrate Salesforce Order Management with Salesforce, you must complete these
procedures:
- Create a connection between your storefront and your Salesforce cloud instance. See Connecting to the Salesforce Commerce Cloud.
- Define one or more processors for your business. See Creating a Payment Gateway Provider.
- Create records of the API credentials used to authenticate your transactions. See Creating a Named Credentials Record.
- Provide information that Salesforce needs for each payment gateway to send payment data for each payment method that you accept. See Creating a Payment Gateway Record.
- Assign the permissions your administrator needs in order to configure payment settings. See Assigning the Permissions Set to the Admin User.
- Enable the process in Salesforce that creates invoices and allows the exchange of funds. See Activating the Create Invoice and Ensure Funds Flow.
- Create records of the API keys that are used to authenticate your requests toCybersource. Each merchant ID and sales channel requires its own payment configuration record. See Creating a Payment Configuration Record.
- Test to verify that your configuration works correctly. See Testing Your Integration.
Connecting to the Salesforce Commerce Cloud
You must set up a connection between your B2C Commerce Business Manager and your
Salesforce Commerce Cloud account. Follow this procedure for each storefront that
needs a connection.
- After logging in to Salesforce, clickSetup.
- In the Quick Find box, typeB2C Commerce Connections.
- ClickNew Connection.
- Enter a connection name and the B2C instance ID (also known as the tenant ID from Business Manager).
- ClickSave.
- Set the integration state toActive.
- In the Allow Tenant Linkage window, clickAllow.
- In the Connection Type section,Order IntegrationandCart and Checkout Datafrom the Available Connection Type list to the Selected Connection Type list.
- ClickSave.
Creating a Payment Gateway Provider
This procedure cannot be completed from the user interface and must be done through
Workbench by connecting to your organization:
- In Workbench, use this endpoint:(MD/ToolingAPI): /services/data/v58.0/tooling/sobjects/PaymentGatewayProvide
- Use this information as your payload:
ADDITIONAL INFORMATION
{ "ApexAdapterId":<ID of PTS_PaymentAdapter.cls apex class> "DeveloperName": "Cybersource_Provider", "MasterLabel": "Cybersource_Provider ", "IdempotencySupported": "Yes", "Comments": "Comments" }
Creating a Named Credentials Record
The package comes with a default named credential called
Payment
. It points to
Cybesource’s test endpoint: https://apitest.cybersource.com
If you cannot find the default named credential, create a new named credential with
these steps:
- ClickSetup.
- In the Quick Find box, enterNamed Credentials.
- ClickNew.
- In theLabelfield, enter eitherPayment_TESTorPayment_LIVE, whichever is appropriate.
- In theNamefield, enter the same value that you used in theLabelfield.
- In theURLfield, enter the URL of your endpoint.
ADDITIONAL INFORMATION
Production: https://api.cybersource.com/pts/v2/paymentsTest: https://apitest.cybersource.com/pts/v2/payments - Leave theCertificatefield blank.
- In theIdentity Typefield, selectAnonymous.
- In theAuthentication Protocolfield, selectNo Authentication.
- In theGenerate Authorization Headerfield, clear the checkbox.
- In theAllow Merge Fields in HTTP Headerfield, check the box.
- In theAllow Merge Fields in HTTP Bodyfield, check the box.
- Leave theOutbound Network Connectionfield blank.
- ClickSave.
Creating a Payment Gateway Record
You must create a payment gateway record for each payment processor that you use.
- Click theApp Launcher, and in the search box that appears, enterPayment Gateways.
- In the search results, click onPayment Gateways. The Payment Gateways page appears.
- ClickNew.
- On the New Payment Gateway page, in thePayment Gateway Namefield, enter the name of the payment gateway.
- In thePayment Gateway Providerfield, enter the name of the gateway provider.
- In theMerchant Credentialfield:
ADDITIONAL INFORMATION
- For a test environment, enterPayment_TEST.
- For a production/live environment, enterPayment_LIVEor the name of your Named Credential that points to theCybersourceproduction/live endpoint.
- In theStatusfield, selectActiveto activate the payment gateway.
- In theExternal Referencefield, enter the processor ID for your Salesforce commerce cloud instance. You can find your processor ID by going to your Salesforce Commerce Cloud instance and selecting .
- In theCommentsfield, enter a description or any comments about this payment gateway record.
- ClickSave.
Assigning the Permission Set to Admin User
You must assign the permissions to the Admin user that are required to access the
payment configuration settings.
- ClickSetup.
- In the Quick Find box, enterUsers.
- At the bottom of the Users list, clickUsers. The Users page that lists all of the users appears.
- In the list of users, find and click the Admin user.
- At the top of the page, clickPermission Set Assignment. The Permission Set Assignment section appears.
- ClickEdit Assignments. The Permission Sets page appears.
- In the Available Permissions Sets list, find thePayment Configuration Accesspermission set and select it.
- ClickAddto move the permission set to the Enabled Permission Sets list.
- ClickSave.
Activating the Create Invoice and Ensure Funds Flow
You must enable the flow process in Salesforce that creates invoices and allows funds
to be exchanged between your customers and your business.
- ClickSetup.
- In the Quick Find box, enterFlow. The All Flows page appears.
- In the list of flows, find and clickActivate Create Invoice and Ensure Funds.
- In theActivecolumn of the flow, check the box to enable the flow.
Creating a Payment Configuration Record
You must provide a REST API key and a shared key to authenticate the API
requests that you send to
Cybersource
. These authentication
credentials are created in the Business Center. You should register for a Business
Center account, get a sandbox account, and generate your security certificates so
that you can test your implementation before going live. For more information on how
to do this, see Getting Started with REST.Follow these steps to create a payment configuration record. If you have a
multi-site configuration with different merchant IDs, you must create a separate
payment configuration record for each merchant ID and for each sales channel.
- From the App Launcher, search forSet Payment Configuration.
- Click theSet Payment Configurationresult to open a tab.
- In theStore Namefield, from the drop-down menu, select the name of the store that needs keys to be set.
- In theMerchant IDfield, enter your merchant ID.
- In theEndpointfield, from the drop-down menu, selectTESTorPRODUCTION.
- In theREST Key IDfield, enter the key value generated in the Business Center.
- In theREST Shared Keyfield, enter the key value generated in the Business Center.
- In theDeveloper IDfield, enter the unique identifier generated byCybersourcefor a system integrator.
- ClickSave.
Testing Your Integration
Before you start accepting payments, test your integration in the testing sandbox
that is provided by
Cybersource
. The sandbox simulates the live
payment gateway and enables you to test your configuration and resolve issues before
going live. The sandbox never processes an actual payment. Sandbox transactions are not submitted
to financial institutions for processing. The sandbox environment is separate from the
live production environment, and it requires separate authentication credentials. If you
use your production credentials in the sandbox or vice versa, you get a 401 HTTP
error.
After testing your integration to confirm that everything works properly, you can
configure your production account to start processing live transactions.
Configuring a Custom Payment Method for Klarna
Create a payment method for Klarna as a custom payment method. The custom payment
method is normally configured as an Alternative Payment Method. The Alternative
Payment Method requires that you create a Gtwy Prov Payment Method Type record to
associate the custom payment method with a payment gateway. Currently, the
Salesforce user interface does not enable you to create a Gtwy Prov Payment Method
Type record, so you must use Workbench to create the record type.
- To configure a new integration with Salesforce for the custom payment method, follow the steps described in Integrating with Salesforce.
- After the new integration is created, open Workbench and go to this endpoint:(MD/ToolingAPI):/services/data/v58.0/sobjects/GtwyProvPaymentMethodType
- Create your payload using these fields:
ADDITIONAL INFORMATION
- Comments: This optional value can be used to describe the record.
- Developer Name: This value is the unique API name of the record.
- Master Label: This value is a human-readable name for the record.
- Gateway Provider Payment Method Type: This value is the name of the payment method in the storefront. This value must exactly match the payment method ID used in B2C Commerce.
- Payment Gateway Provider Id: This value is the ID assigned to the Payment Gateway Provider record associated with the payment processor for the payment method.
- Payment Method Type: This value can be one of these options:AlternativePaymentMethod,CardPaymentMethod, orDigitalWallet. (When usingAlternativePaymentMethod, you must first create a corresponding RecordType record.)
- Record Type Id: This value is a reference to the RecordType record of theAlternativePaymentMethod.
This example shows what your payload should look like:
{ "DeveloperName": "Klarna", "MasterLabel": "Klarna Payment", "GtwyProviderPaymentMethodType": "KLARNA", "PaymentGatewayProviderId": <Id of Payment Gateway Provider>, "PaymentMethodType": "DigitalWallet", "RecordTypeId": <ID of Record type in Alternate Payment Method> }
Going Live
When the sandbox testing of your Salesforce integration is complete and all issues
are resolved, you are ready to go live. You need to create a live version of your
test integration by changing any test settings to production. Follow these steps to
take your Salesforce Order Management integration live:
- Install the managed package in your production environment.
- Create a new Payment Gateway Provider record in your production environment by following the steps in Creating a Payment Gateway Provider.
- Create a new named credential calledPayment_LIVEin your production environment by following the steps in Creating a Named Credentials Record.
- Create a new payment gateway record in your production environment by following the steps in Creating a Payment Gateway Record.
- Create a new payment configuration custom setting record in your production environment by following the steps in Creating a Payment Configuration Record. If you support a multi-site configuration for different merchant IDs, you must create a separate record for each merchant ID and each sales channel. When creating the payment configuration record, be sure to selectPRODUCTIONas the endpoint field.
Upgrading the Salesforce Package
When upgrading your Salesforce package, follow the standard Salesforce process to upgrade
the
Cybersource
for Lightning Order Management package. For more
information about upgrading Salesforce software, go to the Salesforce documentation at
Upgrade Your Managed Package. Upgrading your
Salesforce software does not affect the payment gateway providers and records you
created earlier.