---
schema_version: "1"
id: 4e5797145c2908a5fa42b0d60d53ff2aab4abb9cf0013c39d5152798b4fef8ec
title: PaymentGatewayNotificationRequest Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 68a3285617f5033f9904b7a78a24d97cc7a968dc00d69536fa35dee29a383247
description: Contains the notification request data from the gateway.Body of the notification request sent by the payment gateway.Gets HTTP headers from the notification request sent by the payment gateway.Stores the notification request body information from the payment gateway’s notification request.
---
# PaymentGatewayNotificationRequest Class

Contains the notification request data from the gateway.

## Namespace

[CommercePayments](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_commercepayments.htm "Use the CommercePayments namespace to provide a safe and customizable platform for managing customer payments and refunds.")

## 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationContext.htm#apex_class_commercepayments_PaymentGatewayNotificationContext "Wraps the information related to a gateway notification.") by invoking its getPaymentGatewayNotificationRequest method.

## Example

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

- **[PaymentGatewayNotificationRequest Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_commercepayments_PaymentGatewayNotificationRequest_properties)**
- **[PaymentGatewayNotificationRequest Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_commercepayments_PaymentGatewayNotificationRequest_methods)**

## PaymentGatewayNotificationRequest Properties

The following are properties for PaymentGatewayNotificationRequest.

- **[requestBody](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_commercepayments_PaymentGatewayNotificationRequest_requestBody)**  
    Body of the notification request sent by the payment gateway.

### requestBody

Body of the notification request sent by the payment gateway.

#### Signature

global Blob requestBody {get; set;}

#### Property Value

Type: [Blob](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_blob.htm#apex_methods_system_blob "Contains methods for the Blob primitive data type.")

## PaymentGatewayNotificationRequest Methods

The following are methods for PaymentGatewayNotificationRequest.

- **[getHeaders()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_commercepayments_PaymentGatewayNotificationRequest_getHeaders)**  
    Gets HTTP headers from the notification request sent by the payment gateway.
- **[getRequestBody()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_commercepayments_PaymentGatewayNotificationRequest_getRequestBody)**  
    Stores the notification request body information from the payment gateway’s notification request.

### 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_blob.htm#apex_methods_system_blob "Contains methods for the Blob primitive data type.")