Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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

1commercepayments.NotificationStatus notificationStatus = null;
2        if (success) {
3            notificationStatus = commercepayments.NotificationStatus.Success;
4        } else {
5            notificationStatus = commercepayments.NotificationStatus.Failed;
6        }
7        commercepayments.BaseNotification notification = null;
8        if ('CAPTURE'.equals(eventCode)) {
9            notification = new commercepayments.CaptureNotification();
10        } else if ('REFUND'.equals(eventCode)) {
11            notification = new commercepayments.ReferencedRefundNotification();
12        }

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

setGatewayAvsCode(gatewayAvsCode)

Sets the AVS (address verification system) result code information that the gateway returned. Maximum length of 64 characters.

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)

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

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

Return Value

Type: void

setSalesforceResultCodeInfo(salesforceResultCodeInfo)

Sets Salesforce result code information.

Signature

global void setSalesforceResultCodeInfo(commercepayments.SalesforceResultCodeInfo salesforceResultCodeInfo)

Parameters

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