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.
CaptureRequest Class
Represents a capture request. This class extends the BaseRequest class and inherits all its
methods.
Namespace
Usage
The CaptureRequest class’s buildCaptureRequest method creates a CaptureRequest object to store payment information, such as value and currency, as JSON strings.
Example
Builds a CaptureRequest object for a multicurrency
org.
1private String buildCaptureRequest(commercepayments.CaptureRequest captureRequest) {
2 Boolean IS_MULTICURRENCY_ORG = UserInfo.isMultiCurrencyOrganization();
3 QueryUtils qBuilderForAuth = new QueryUtils(PaymentAuthorization.SObjectType);
4 // Add required fields
5 qBuilderForAuth.getSelectClause().addField('GatewayRefNumber', false);
6 if (IS_MULTICURRENCY_ORG) {
7 // addField also takes a boolean to enable translation (uses label instead of actual value)
8 qBuilderForAuth.getSelectClause().addField('CurrencyIsoCode', false);
9 }