---
schema_version: "1"
id: e77785b716000f64e3f95a273791a87632c5f4a9fc20108241bf7491f22b2830
title: PaymentGatewayNotificationContext Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercepayments_PaymentGatewayNotificationContext.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationContext.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 54c78f8d0f44c6ceee92038088401b17b1377d766cf5c28440ac1f9910366b49
description: Wraps the information related to a gateway notification.Returns the payment gateway’s notification request.
---
# PaymentGatewayNotificationContext Class

Wraps the information related to a gateway notification.

## 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

This class is used with asynchronous payments. It wraps all of the information related to a notification from the payment gateway. The payments platform provides its context to the payment gateway adapters.

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

CommercePayments.PaymentGatewayNotificationContext pgnc = new CommercePayments.PaymentGatewayNotificationContext();

## Example

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

- **[PaymentGatewayNotificationContext Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationContext.htm#apex_commercepayments_PaymentGatewayNotificationContext_methods)**

## PaymentGatewayNotificationContext Methods

The following are methods for PaymentGatewayNotificationContext.

- **[getPaymentGatewayNotificationRequest()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationContext.htm#apex_commercepayments_PaymentGatewayNotificationContext_getPaymentGatewayNotificationRequest)**  
    Returns the payment gateway’s notification request.

### getPaymentGatewayNotificationRequest()

Returns the payment gateway’s notification request.

#### Signature

global commercepayments.PaymentGatewayNotificationRequest getPaymentGatewayNotificationRequest()

#### Return Value

Type: [PaymentGatewayNotificationRequest](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentGatewayNotificationRequest.htm#apex_class_commercepayments_PaymentGatewayNotificationRequest "Contains the notification request data from the gateway.")