Newer Version Available
CaptureNotification Class
Namespace
Usage
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();Example
1commercepayments.BaseNotification notification = null;
2 if ('CAPTURE'.equals(eventCode)) {
3 notification = new commercepayments.CaptureNotification();
4 } else if ('REFUND'.equals(eventCode)) {
5 notification = new commercepayments.ReferencedRefundNotification();
6 }CaptureNotification Methods
The following are methods for CaptureNotification.
setAmount(amount)
Signature
global void setAmount(Double amount)
Parameters
- amount
- Type: Double
- The amount to be debited or captured.
Return Value
Type: void
setGatewayAvsCode(gatewayAvsCode)
Signature
public void setGatewayAvsCode(String gatewayAvsCode)
Parameters
- gatewayAvsCode
- Type: String
- Used to verify the address mapped to a payment method when the payments platform requests tokenization from the payment gateway.
Return Value
Type: void
setGatewayDate(gatewayDate)
Signature
global void setGatewayDate(Datetime gatewayDate)
Parameters
- gatewayDate
- Type: Datetime
- Date and time of the gateway communication.
Return Value
Type: void
setGatewayMessage(gatewayMessage)
Signature
global void setGatewayMessage(String gatewayMessage)
Parameters
- gatewayMessage
- Type: String
- Information on error messages sent from the gateway.
Return Value
Type: void
setGatewayReferenceDetails(gatewayReferenceDetails)
Signature
global void setGatewayReferenceDetails(String gatewayReferenceDetails)
Parameters
- gatewayReferenceDetails
- Type: String
Return Value
Type: void
setGatewayReferenceNumber(gatewayReferenceNumber)
Signature
global void setGatewayReferenceNumber(String gatewayReferenceNumber)
Parameters
- gatewayReferenceNumber
- Type: String
- Unique transaction ID created by the payment gateway.
Return Value
Type: void
setGatewayResultCode(gatewayResultCode)
Signature
global void setGatewayResultCode(String gatewayResultCode)
Parameters
- gatewayResultCode
- Type: String
- Gateway-specific result code. Map this value to a Salesforce-specific result code.
Return Value
Type: void
setGatewayResultCodeDescription(gatewayResultCodeDescription)
Signature
global void setGatewayResultCodeDescription(String gatewayResultCodeDescription)
Parameters
- 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.
Return Value
Type: void
setSalesforceResultCodeInfo(salesforceResultCodeInfo)
Signature
global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)
Parameters
- salesforceResultCodeInfo
- Type: commercepayments.SalesforceResultCodeInfo
- Description of the Salesforce result code value.
Return Value
Type: void
setStatus(status)
Signature
global void setStatus(commercepayments.NotificationStatus status)
Parameters
- 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.
Return Value
Type: void