On This Page
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.