Newer Version Available
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.
- Create your payment gateway adapter Apex classes. For more information on building synchronous gateway adapters in Apex, review Building a Synchronous Gateway Adapter.
-
Create a Named Credential in Salesforce UI.
- From Setup, in the Quick Find box, enter NamedCredential, and then select New Named Credential.
- Enter the username, password, and URL for your payment gateway, and then save your changes.
-
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.
- Log in to Workbench, and then select REST Explorer.
-
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
-
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",
-
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