---
schema_version: "1"
id: 2abbcc1cfb75b64ab5cfa82f67a1c39ea1a30c9949c0a278766cba6799e354fd
title: PaymentsHttp Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercepayments_PaymentsHttp.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentsHttp.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c6b5ee137d84f6c6562595318095ed5879d4052b6a2c4df9f6ca7cbb1ed3629e
description: Makes an HTTP request to start the interaction with the payment gateway.Sends an HttpRequest and returns the response.Initiates an HTTP request and response.
---
# PaymentsHttp Class

Makes an HTTP request to start the interaction with the payment 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

You must specify the CommercePayments namespace when creating an instance of this class. The constructor of this class takes no arguments. For example:

CommercePayments.PaymentsHttp payhttp = new CommercePayments.PaymentsHttp();

- **[PaymentsHttp Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentsHttp.htm#apex_commerce_payments_PaymentsHttp_methods)**
- **[PaymentsHttp Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentsHttp.htm#apex_commerce_payments_AuditParamsRequest_constructors)**

## PaymentsHttp Methods

The following are methods for PaymentsHttp. All methods are instance methods.

- **[send(Request)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentsHttp.htm#apex_commerce_payments_PaymentsHttp_send)**  
    Sends an HttpRequest and returns the response.

### send(Request)

Sends an HttpRequest and returns the response.

#### Signature

global HttpResponse send(HttpRequest request)

#### Parameters

- **request**:
    
    Type: [System.HttpRequest](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_classes_restful_http_httprequest.htm#apex_classes_restful_http_httprequest)

#### Return Value

Type: [System.HttpResponse](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_classes_restful_http_httpresponse.htm#apex_classes_restful_http_httpresponse)

## PaymentsHttp Constructors

The following are constructors for PaymentsHttp.

- **[PaymentsHttp()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_PaymentsHttp.htm#apex_commerce_payments_PaymentsHttp_ctor)**  
    Initiates an HTTP request and response.

### PaymentsHttp()

Initiates an HTTP request and response.

#### Signature

global PaymentsHttp()