CaptureResponse Class

The payment gateway adapter sends this response for the capture request type. This class extends AbstractResponse and inherits its methods.

CommercePayments

You must specify the CommercePayments namespace when creating an instance of this class. The constructor of this class takes no arguments. For example:

CommercePayments.Capture Response ctr = new CommercePayments.CaptureResponse();

The following are methods for CaptureResponse.

Sets the transaction amount.

global void setAmount(Double amount)

  • amount:

    Type: Double

    The amount to be debited or captured.

Type: void

Indicates whether the payment gateway adapter used in the payment capture was asynchronous (True) or synchronous (False).

global void setAsync(Boolean async)

Type: void

Sets the payment gateway’s AVS (address verification system) code.

global void setGatewayAvsCode(String gatewayAvsCode)

  • gatewayAvsCode:

    Type: String

    Payment gateways that use

    an AVS system return this code.

Type: void

Sets the payment gateway’s date.

global void setGatewayDate(Datetime gatewayDate)

  • gatewayDate:

    Type: Datetime

    The date that communication happened with the gateway.

Type: void

Sets information or messages that the gateway returned.

global void setGatewayMessage(String gatewayMessage)

  • gatewayMessage:

    Type: String

    Information or error messages returned by the gateway.

Type: void

Sets the payment gateway’s reference details.

global void setGatewayReferenceDetails(String gatewayReferenceDetails)

  • gatewayReferenceDetails:

    Type: String

    Provides information about

    the gateway communication.

Type: void

Sets the payment gateway’s reference number.

global void setGatewayReferenceNumber(String gatewayReferenceNumber)

  • gatewayReferenceNumber:

    Type: String

    Unique transaction ID created by the payment gateway.

Type: void

Sets the payment gateway’s result code.

global void setGatewayResultCode(String gatewayResultCode)

  • gatewayResultCode:

    Type: String

    The gateway result code. You must map this to a Salesforce result code.

Type: void

Sets the payment gateway’s result code description.

global void setGatewayResultCodeDescription(String gatewayResultCodeDescription)

  • gatewayResultCodeDescription:

    Type: String

    Description of the GatewayResultCode. Provides additional context about the result code that the gateway returned.

Type: void

Sets Salesforce result code information.

global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)

  • salesforceResultCodeInfo:

    SalesforceResultCodeInfoType: commercepayments.SalesforceResultCodeInfo Description of the Salesforce result code value.

Type: void