Newer Version Available
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 }