AbstractResponse Class
Contains the normalized response fields from payment gateways that are common to all the other gateway responses.
You must specify the CommercePayments namespace when creating an instance of this class. The constructor of this class takes no arguments. For example:
CommercePayments.AbstractResponse abr = new CommercePayments.AbstractResponse();
This class can’t be instantiated on its own. This class implements the GatewayResponse class. Other GatewayResponse classes extend this class to inherit common properties.
The following are methods for AbstractResponse.
-
setGatewayAvsCode(gatewayAvsCode)
Sets the AVS (address verification system) result code information that the gateway returned. Maximum length of 64 characters.
-
Sets the date that the transaction occurred. Some gateways don’t send this value.
-
setGatewayMessage(gatewayMessage)
Sets error messages that the gateway returned for the payment request. Maximum length of 255 characters.
-
setGatewayResultCode(gatewayResultCode)
Sets a gateway-specific result code. The code may be mapped to a Salesforce-specific result code. Maximum length of 64 characters.
-
setGatewayResultCodeDescription(gatewayResultCodeDescription)
Sets a description of the gateway-specific result code that a payment gateway returned. Maximum length of 1000 characters.
-
setSalesforceResultCodeInfo(salesforceResultCodeInfo)
Sets the Salesforce-specific result code information. Payment gateways have many response codes for payment calls. Salesforce uses the result code information to map payment gateway codes to a predefined set of standard Salesforce result codes.
-
setRetryCategory(retryCategory)
Sets the retry category returned by the payment gateway for the failed payment in a batch flow.
-
setRetryDecision(retryDecision)
Sets the retry decision.
Sets the AVS (address verification system) result code information that the gateway returned. Maximum length of 64 characters.
global void setGatewayAvsCode(String gatewayAvsCode)
-
gatewayAvsCode:
Type: String
Code sent by gateways that use
an address verification system.
Type: void
Sets the date that the transaction occurred. Some gateways don’t send this value.
global void setGatewayDate(Datetime gatewayDate)
-
gatewayDate:
Type: Datetime
Date and time of the gateway communication.
Type: void
Sets error messages that the gateway returned for the payment request. Maximum length of 255 characters.
global void setGatewayMessage(String gatewayMessage)
-
gatewayMessage:
Type: String
Information on error messages sent from
the gateway.
Type: void
Sets a gateway-specific result code. The code may be mapped to a Salesforce-specific result code. Maximum length of 64 characters.
global void setGatewayResultCode(String gatewayResultCode)
- gatewayResultCode: Type: String Gateway-specific result code. Must be used to map a Salesforce-specific result code.
Type: void
Sets a description of the gateway-specific result code that a payment gateway returned. Maximum length of 1000 characters.
global void setGatewayResultCodeDescription(String gatewayResultCodeDescription)
- gatewayResultCodeDescription: Type: String Description of the gateway’s result code. Use this field to learn more about why the gateway returned a certain result code.
Type: void
Sets the Salesforce-specific result code information. Payment gateways have many response codes for payment calls. Salesforce uses the result code information to map payment gateway codes to a predefined set of standard Salesforce result codes.
global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)
- salesforceResultCodeInfo: Type: commercepayments.SalesforceResultCodeInfo Description of the Salesforce result code value.
Type: void
Sets the retry category returned by the payment gateway for the failed payment in a batch flow.
public void setRetryCategory(commercepayments.RetryCategory retryCategory)
- retryCategory: Type: commercepayments.RetryCategory Specifies the payment failure category used to determine retry eligibility. Indicates the classification of the payment failure and whether the transaction is eligible for retry.
Type: void
Sets the retry decision.
public void setRetryDecision(commercepayments.RetryDecision retryDecision)
- retryDecision: Type: commercepayments.RetryDecision Determines whether the payment operation can be retried based on the retry category.
Type: void