Newer Version Available
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 |
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.duplicateThe idempotency key can be fetched from the request object.
String idempotencyKey = request.idempotencyKey