ReferencedRefundNotification Class

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

Namespace

CommercePayments

Usage

This class is used with asynchronous payments. When a payment gateway sends a notification for a refund transcation, the gateway adapter creates an object of type ReferencedRefundNotification to populate the respective values.

The constructor of this class takes no arguments. For example:

CommercePayments.ReferencedRefundNotification rrn = new CommercePayments.ReferencedRefundNotification();

Example

commercepayments.NotificationStatus notificationStatus = null;
        if (success) {
            notificationStatus = commercepayments.NotificationStatus.Success;
        } else {
            notificationStatus = commercepayments.NotificationStatus.Failed;
        }
        commercepayments.BaseNotification notification = null;
        if ('CAPTURE'.equals(eventCode)) {
            notification = new commercepayments.CaptureNotification();
        } else if ('REFUND'.equals(eventCode)) {
            notification = new commercepayments.ReferencedRefundNotification();
        }

ReferencedRefundNotification Methods

The following are methods for ReferencedRefundNotification.

setAmount(amount)

Sets the transaction amount. Can be positive, negative, or zero.

Signature

global void setAmount(Double amount)

Parameters

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

Return Value

Type: void

setGatewayDate(gatewayDate)

Sets the date that communication for the refund notification occurred with the payment gateway.

Signature

global void setGatewayDate(Datetime gatewayDate)

Parameters

gatewayDate
Type: Datetime
The date that communication happened with the gateway.

Return Value

Type: void

setGatewayMessage(gatewayMessage)

Sets information or messages that the gateway returned.

Signature

global void setGatewayMessage(String gatewayMessage)

Parameters

gatewayMessage
Type: String

Return Value

Type: void

setGatewayReferenceDetails(gatewayReferenceDetails)

Sets the payment gateway’s reference details.

Signature

global void setGatewayReferenceDetails(String gatewayReferenceDetails)

Parameters

gatewayReferenceDetails
Type: String
Provides information about the gateway communication.

Return Value

Type: void

setGatewayReferenceNumber(gatewayReferenceNumber)

Sets the payment gateway’s reference number.

Signature

global void setGatewayReferenceNumber(String gatewayReferenceNumber)

Parameters

gatewayReferenceNumber
Type: String
Unique transaction ID created by the payment gateway.

Return Value

Type: void

setGatewayResultCode(gatewayResultCode)

Sets the payment gateway’s result code.

Signature

global void setGatewayResultCode(String gatewayResultCode)

Parameters

gatewayResultCode
Type: String
The gateway result code. You must map this to a Salesforce-specific result code.

Return Value

Type: void

setGatewayResultCodeDescription(gatewayResultCodeDescription)

Sets the payment gateway’s result code description.

Signature

global void setGatewayResultCodeDescription(String gatewayResultCodeDescription)

Parameters

gatewayResultCodeDescription
Type: String
Description of the gateway result code. Provides additional context about the result code .

Return Value

Type: void

setId(id)

Sets the ID of a notification sent by the payment gateway.

Signature

global void setId(String id)

Parameters

id
Type: String

Return Value

Type: void

setSalesforceResultCodeInfo(salesforceResultCodeInfo)

Sets Salesforce result code information.

Signature

global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)

Parameters

salesforceResultCodeInfo
Type: SalesforceResultCodeInfo
Description of the Salesforce result code value.

Return Value

Type: void

setStatus(status)

Sets the notification status value on the notification object.

Signature

global void setStatus(commercepayments.NotificationStatus status)

Parameters

status
Type: NotificationStatus
Indicates whether the payments platform successfully received the notification from the payment gateway.

Return Value

Type: void