SaleNotification Class
When a payment gateway sends a notification for a sale payment, the payment gateway adapter creates the SaleNotification object to store information about notification.
SaleNotification is used in asynchronous payment gateway adapters. Specify the CommercePayments namespace when creating an instance of this class. The constructor of this class takes no arguments. For example: commercePayments.SaleNotification saleNotification = new commercepayments.SaleNotification();
The following are methods for SaleNotification.
-
Sets the amount for the sale payment.
-
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 sale occurred. Some gateways don’t send this value.
-
setGatewayMessage(gatewayMessage)
Sets error messages that the gateway returned for the sale request. Maximum length of 255 characters.
-
setGatewayReferenceDetails(gatewayReferenceDetails)
Sets additional data that you can use for the sale payment. 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 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.
-
Sets the ID of a notification sent by the payment gateway.
-
setRetryCategory(retryCategory)
Sets the retry category returned by the payment gateway for the failed payment.
-
setRetryDecision(retryDecision)
Sets the retry decision.
-
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 notification status value on the notification object.
Sets the amount for the sale payment.
public void setAmount(Double amount)
- amount: Type: Double
Type: void
Sets the AVS (address verification system) result code information 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 sale occurred. Some gateways don’t send this value.
public void setGatewayDate(Datetime gatewayDate)
- gatewayDate: Type: Datetime
Type: void
Sets error messages that the gateway returned for the sale request. Maximum length of 255 characters.
public void setGatewayMessage(String gatewayMessage)
- gatewayMessage: Type: String
Type: void
Sets additional data that you can use for the sale payment. 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.
public 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.
public void setGatewayReferenceNumber(String gatewayReferenceNumber)
- gatewayReferenceNumber: Type: String
Type: void
Sets a gateway-specific result code. The code may be mapped to a Salesforce-specific result code. Maximum length of 64 characters.
public void setGatewayResultCode(String gatewayResultCode)
- gatewayResultCode: Type: String
Type: void
Sets a description of the gateway-specific result code that a payment gateway returned. Maximum length of 1000 characters.
public 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 ID of a notification sent by the payment gateway.
public void setId(String id)
- id: Type: String
Type: void
Sets the retry category returned by the payment gateway for the failed payment.
public void setRetryCategory(commercepayments.RetryCategory retryCategory)
- retryCategory: Type: commercepayments.RetryCategory Specifies the payment failure category used to determine retry eligibility.
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
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.
public void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)
- salesforceResultCodeInfo: Type: commercepayments.SalesforceResultCodeInfo
Type: void
Sets the notification status value on the notification object.
public void setStatus(commercepayments.NotificationStatus status)
- status: Type: commercepayments.NotificationStatus
Type: void