BaseNotification Class
Abstract class for storing notification information sent from payment gateways.
An abstract class that contains the common fields from payment gateways. BaseNotification can’t be instantiated on its own.
The constructor of this class takes no arguments. For example:
CommercePayments.BaseNotification bnt = new CommercePayments.BaseNotification();
The following are methods for BaseNotification.
-
Sets the transaction amount. Must be a non-negative value.
-
setGatewayAvsCode(gatewayAvsCode)
Sets the AVS (address verification system) result code that the gateway returned. Maximum length of 64 characters.
-
Sets the date that the notification occurred. Some gateways don’t send this value.
-
setGatewayMessage(gatewayMessage)
Sets error messages that the gateway returned for the notification request. Maximum length of 255 characters.
-
setGatewayReferenceDetails(gatewayReferenceDetails)
Sets the payment gateway’s reference details.
-
setGatewayReferenceNumber(gatewayReferenceNumber)
Sets the payment gateway’s reference number.
-
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.
-
Sets the ID of the notification sent by the gateway.
-
setSalesforceResultCodeInfo(salesforceResultCodeInfo)
Sets the information about the Salesforce-specific result code used to match a result code from a payment gateway.
-
Sets the status of the notification sent by the gateway.
Sets the transaction amount. Must be a non-negative value.
global void setAmount(Double amount)
-
amount:
Type: Double
The amount of the transaction.
Type: void
Sets the AVS (address verification system) result code that the gateway returned. Maximum length of 64 characters.
public 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 notification occurred. Some gateways don’t send this value.
global void setGatewayDate(Datetime gatewayDate)
-
gatewayDate:
Type: Datetime
The date that the notification occurred.
Type: void
Sets error messages that the gateway returned for the notification request. Maximum length of 255 characters.
global void setGatewayMessage(String gatewayMessage)
-
gatewayMessage:
Type: String
The message that the gateway returned with the notification request. Contains additional information about the notification.
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 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
Provides additional information about
the result code and why the gateway returned the code. Descriptions vary between different gateways.
Type: void
Sets the ID of the notification sent by the gateway.
global void setId(String id)
-
id:
Type: String
Type: void
Sets the information about the Salesforce-specific result code used to match a result code from a payment gateway.
global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)
-
salesforceResultCodeInfo:
Type: commercepayments.SalesforceResultCodeInfo
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.
Type: void
Sets the status of the notification sent by the gateway.
global void setStatus(commercepayments.NotificationStatus status)
-
status:
Type: commercepayments.NotificationStatus
Shows
whether the payments platform successfully received the notification from the gateway.
Type: void