Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Idempotency Guidelines

Idempotency represents the ability of a payment gateway to recognize duplicate requests submitted either in error or maliciously, and then process the duplicate requests accordingly. When working with an idempotent gateway, consider these important guidelines.
Available in: Salesforce Spring ’20

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

The payment gateway adapter class is linked to a paymentGatewayProvider object record. CCS Payments provides its own layer of idempotency for its own service request. Each payment gateway can also specify their idempotencySupported value in the paymentGatewayProvider object record. If Salesforce CCS Payment APIs detects a duplicate request and the gateway provider supports idempotency, the request body’s duplicate parameter becomes True.

1commercepayments.CaptureRequest request = 
2(commercepayments.CaptureRequest)paymentGatewayContext.getPaymentRequest();
3Boolean isDuplicate = requestObject.duplicate

The idempotency key can be fetched from the request object.

String idempotencyKey = request.idempotencyKey