---
schema_version: "1"
id: 4585a28bb209fa8f9870a46a8026baa273210e92f5054925d64d7a0192034dc3
title: AuthApiPaymentMethodRequest Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 853d6cc77be61af4a95e06f6743dfedeae43f56717db51c32d425f6d8f1e7b92
description: Sends information about a payment method to a gateway adapter during an authorization service call.Constructs a sample cardPaymentMethodRequest. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.Constructor for AuthApiPaymentMethodRequest.The card payment method object used in a payment method request.
---
# AuthApiPaymentMethodRequest Class

Sends information about a payment method to a gateway adapter during an authorization service call.

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

Contains information about the payment method that is used for an authorization request. It contains all available payment methods as fields, but populates only one field for each request. The gateway adapter uses this class when constructing an authorization request. An object of this class is available through the paymentMethod field on the [AuthorizationRequest Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthorizationRequest.htm#apex_class_commercepayments_AuthorizationRequest "Sends information about an authorization request to a gateway adapter during a service call. This class extends the BaseRequest class and inherits all its methods.") object.

- **[AuthApiPaymentMethodRequest Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm#apex_commercepayments_AuthApiPaymentMethodRequest_constructors)**
- **[AuthApiPaymentMethodRequest Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm#apex_commercepayments_AuthApiPaymentMethodRequest_properties)**

## AuthApiPaymentMethodRequest Constructors

The following are constructors for AuthApiPaymentMethodRequest.

- **[AuthApiPaymentMethodRequest(cardPaymentMethodRequest)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm#apex_commercepayments_AuthApiPaymentMethodRequest_ctor)**  
    Constructs a sample cardPaymentMethodRequest. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
- **[AuthApiPaymentMethodRequest()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm#apex_commercepayments_AuthApiPaymentMethodRequest_ctor_2)**  
    Constructor for AuthApiPaymentMethodRequest.

### AuthApiPaymentMethodRequest(cardPaymentMethodRequest)

Constructs a sample cardPaymentMethodRequest. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

#### Signature

global AuthApiPaymentMethodRequest(commercepayments.CardPaymentMethodRequest cardPaymentMethodRequest)

#### Parameters

- **cardPaymentMethodRequest**: Type: [commercepayments.CardPaymentMethodRequest](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodRequest.htm#apex_class_commercepayments_CardPaymentMethodRequest "Sends data related to a card payment method to a gateway adapter during a service call.") Contains information about the card payment method. Used to send information to a gateway adapter during a service call.

### AuthApiPaymentMethodRequest()

Constructor for AuthApiPaymentMethodRequest.

#### Signature

global AuthApiPaymentMethodRequest()

## AuthApiPaymentMethodRequest Properties

The following are properties for AuthApiPaymentMethodRequest.

- **[cardPaymentMethod](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_AuthApiPaymentMethodRequest.htm#apex_commercepayments_AuthApiPaymentMethodRequest_cardPaymentMethod)**  
    The card payment method object used in a payment method request.

### cardPaymentMethod

The card payment method object used in a payment method request.

#### Signature

global commercepayments.CardPaymentMethodRequest cardPaymentMethod {get; set;}

#### Property Value

Type: [commercepayments.CardPaymentMethodRequest](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodRequest.htm#apex_class_commercepayments_CardPaymentMethodRequest "Sends data related to a card payment method to a gateway adapter during a service call.")