Newer Version Available

This content describes an older version of this product. View Latest

Set Up a Synchronous Payment Gateway Adapter in Salesforce

Configure Salesforce to interface with a synchronous payment gateway adapter.
Available in: Salesforce Summer ’20 and later
Available in: API 49.0 and later

To access the commercepayments API, you need the PaymentPlatform org permission.

  1. Create your payment gateway adapter Apex classes. For more information on building synchronous gateway adapters in Apex, review Building a Synchronous Gateway Adapter.
  2. Create a Named Credential in Salesforce UI.
    1. From Setup, in the Quick Find box, enter NamedCredential, and then select New Named Credential.
    2. Enter the username, password, and URL for your payment gateway, and then save your changes.
  3. Create a payment gateway provider. The payment gateway provider is an object that stores details about the payment gateway that Salesforce communicates with when processing a transaction. As of Salesforce Summer ’20, you can create a payment gateway provider record only through Workbench.
    1. Log in to Workbench, and then select REST Explorer.
    2. Set the method to Post, and then enter the following URL, replacing [version] with your desired API version. The payment gateway provider entity is available in Salesforce API v48.0 and later.
      services/data/[version]/tooling/sobjects/PaymentGatewayProvider
    3. Enter your payload, replacing VALUE with your desired value.
      1{
      2 "ApexAdapterId": "{{VALUE}}",
      3 "DeveloperName": "{{VALUE}}",
      4 "MasterLabel": "VALUE",
      5 "IdempotencySupported": "VALUE",
      6 "Comments": "VALUE",
  4. Create a payment gateway record. This object stores information that Salesforce uses to communicate with the payment gateway. The record requires the following field values.
    • Name: We recommend using the same name as the external payment gateway that will be communicating with Salesforce.
    • Merchant Credential ID: Enter the ID of the named credential that you created in Step 2.
    • Payment Gateway Provider: Enter the ID of the payment gateway provider that you created in Step 3.
    • Status: Active