CaptureNotification Class

When a payment gateway sends a notification for a capture transaction, the payment gateway adapter creates the CaptureNotification object to store information about the notification.

CommercePayments

CaptureNotification 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.CaptureNotification crn = new CommercePayments.CaptureNotification();

The following are methods for CaptureNotification.

Sets the transaction amount. Must be a non-negative value.

global void setAmount(Double amount)

  • amount: Type: Double The amount to be debited or captured.

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 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 additional data that you can use for subsequent transactions. 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 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. Map this value to a Salesforce-specific result code.

Type: void

Sets a description of the gateway-specific result code that a 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 ID of a notification sent by the payment gateway.

global void setId(String id)

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)

Type: void

Sets the notification status to the same value that was sent by the gateway.

global void setStatus(commercepayments.NotificationStatus status)

  • status: Type: NotificationStatus 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.

Type: void