PaymentGatewayNotificationRequest Class

Contains the notification request data from the gateway.

Namespace

CommercePayments

Usage

When the payment gateway sends a notification for a payment request, the payments platform sends the notification request to the gateway adapter. If the notification payload contains an eventCode of CAPTURE, the adapter constructs a CaptureNotification. If the notification payload contains an eventCode of REFUND, the adapter constructs a ReferencedRefundNotification. If the notification payload contains eventCode of AUTHORISATION, the adapter constructs a GatewayNotificationResponse.

You can obtain a notification request from PaymentGatewayNotificationContext by invoking its getPaymentGatewayNotificationRequest method.

Example

global commercepayments.GatewayNotificationResponse 
    processNotification(commercepayments.PaymentGatewayNotificationContext gatewayNotificationContext) {
        commercepayments.PaymentGatewayNotificationRequest notificationRequest = gatewayNotificationContext.getPaymentGatewayNotificationRequest();
}

PaymentGatewayNotificationRequest Properties

The following are properties for PaymentGatewayNotificationRequest.

requestBody

Body of the notification request sent by the payment gateway.

Signature

global Blob requestBody {get; set;}

Property Value

Type: Blob

PaymentGatewayNotificationRequest Methods

The following are methods for PaymentGatewayNotificationRequest.

getHeaders()

Gets HTTP headers from the notification request sent by the payment gateway.

Signature

global Map<String,String> getHeaders()

Return Value

Type: Map<String,String>

getRequestBody()

Stores the notification request body information from the payment gateway’s notification request.

Signature

global Blob getRequestBody()

Return Value

Type: Blob