BaseNotification Class
Namespace
Usage
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();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 }BaseNotification Methods
The following are methods for BaseNotification.
setAmount(amount)
Signature
global void setAmount(Double amount)
Parameters
-
amount:
Type: Double
The amount of the transaction.
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
The date that the notification occurred.
Return Value
Type: void
setGatewayMessage(gatewayMessage)
Signature
global void setGatewayMessage(String gatewayMessage)
Parameters
-
gatewayMessage:
Type: String
The message that the gateway returned with the notification request. Contains additional information about the notification.
Return Value
Type: void
setGatewayReferenceDetails(gatewayReferenceDetails)
Signature
global void setGatewayReferenceDetails(String gatewayReferenceDetails)
Parameters
-
gatewayReferenceDetails:
Type: String
Provides information about
the gateway communication.
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.
Must be used to map a Salesforce-specific result code.
Return Value
Type: void
setGatewayResultCodeDescription(gatewayResultCodeDescription)
Signature
global void setGatewayResultCodeDescription(String gatewayResultCodeDescription)
Parameters
-
gatewayResultCodeDescription:
Type: String
Provides additional information about
the result code and why the gateway returned the code. Descriptions vary between different gateways.
Return Value
Type: void
setSalesforceResultCodeInfo(salesforceResultCodeInfo)
Signature
global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)
Parameters
-
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.
Return Value
Type: void
setStatus(status)
Signature
global void setStatus(commercepayments.NotificationStatus status)
Parameters
-
status:
Type: commercepayments.NotificationStatus
Shows
whether the payments platform successfully received the notification from the gateway.
Return Value
Type: void