AuthorizationResponse Class
Response sent by the payment gateway adapter for an authorization service.
The constructor of this class takes no arguments. For example:
CommercePayments.AuthorizationResponse authr = new CommercePayments.AuthorizationResponse();
Contains information about the payment gateway’s response following an authorization transaction. The gateway adapter uses the payment gateway’s response to populate the AuthorizationResponse fields. The payments platform uses the information from this class to construct the authorization gateway response shown to the user.
The following are methods for AuthorizationResponse.
-
Sets the amount of the authorization. Must be a non-zero value.
-
Indicates whether the gateway response is received asynchronously (
true) or not (false). When set totrue, the authorize payment method remains in a pending state until the async notification is received. -
setAuthorizationExpirationDate(authExpDate)
Sets the expiration date of the authorization request.
-
setGatewayAuthCode(gatewayAuthCode)
Sets the authorization code that the gateway returned. Maximum length of 64 characters.
-
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 authorization occurred. Some gateways don’t send this value.
-
setGatewayMessage(gatewayMessage)
Sets error messages that the gateway returned for the authorization request. Maximum length of 255 characters.
-
setGatewayReferenceDetails(gatewayReferenceDetails)
Stores data that you can use for subsequent authorizations. You can use any data that isn’t normalized in financial entities. This field has a maximum length of 1000 characters and can store data as JSON or XML.
-
setGatewayReferenceNumber(gatewayReferenceNumber)
Sets the unique gateway reference number for the transaction that the gateway returned. Maximum length of 255 characters.
-
setGatewayResultCode(gatewayResultCode)
Sets a gateway-specific result code. The code can 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.
-
setPaymentMethodTokenizationResponse(paymentMethodTokenizationResponse)
Sets information from the gateway about the tokenized payment method.
-
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.
Sets the amount of the authorization. Must be a non-zero value.
global void setAmount(Double amount)
-
amount:
Type: Double
Type: void
Indicates whether the gateway response is received asynchronously (true) or not (false). When set to true, the authorize payment method remains in a pending state until the async notification is received.
public void setAsync(Boolean async)
-
async:
Type: Boolean
Type: void
Sets the expiration date of the authorization request.
global void setAuthorizationExpirationDate(Datetime authExpDate)
-
authExpDate:
Type: Datetime
Type: void
Sets the authorization code that the gateway returned. Maximum length of 64 characters.
global void setGatewayAuthCode(String gatewayAuthCode)
-
gatewayAuthCode:
Type: String
The authorization code returned by the gateway.
Type: void
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
Used to verify
the address mapped to a payment method when the payments platform requests tokenization from the payment gateway.
Type: void
Sets the date that the authorization occurred. Some gateways don’t send this value.
global void setGatewayDate(Datetime gatewayDate)
-
gatewayDate:
Type: Datetime
Type: void
Sets error messages that the gateway returned for the authorization request. Maximum length of 255 characters.
global void setGatewayMessage(String gatewayMessage)
-
gatewayMessage:
Type: String
Type: void
Stores data that you can use for subsequent authorizations. You can use any data that isn’t normalized in financial entities. This field has a maximum length of 1000 characters and can store data as JSON or XML.
global void setGatewayReferenceDetails(String gatewayReferenceDetails)
-
gatewayReferenceDetails:
Type: String
Type: void
Sets the unique gateway reference number for the transaction that the gateway returned. Maximum length of 255 characters.
global void setGatewayReferenceNumber(String gatewayReferenceNumber)
-
gatewayReferenceNumber:
Type: String
Unique authorization ID created by the payment gateway.
Type: void
Sets a gateway-specific result code. The code can 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 information from the gateway about the tokenized payment method.
global void setPaymentMethodTokenizationResponse(commercepayments.PaymentMethodTokenizationResponse paymentMethodTokenizationResponse)
- paymentMethodTokenizationResponse: PaymentMethodTokenizationResponse Gateway response sent by payment gateway adapters for the payment method tokenization request.
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: SalesforceResultCodeInfo
Description of the Salesforce result code value.
Type: void