Newer Version Available

This content describes an older version of this product. View Latest

CardPaymentMethodRequest Class

Sends data related to a card payment method to a gateway adapter during a service call.

Namespace

CommercePayments

Usage

This class contains details about the card used as a payment method for authorization, sale, or tokenization transaction requests. The gateway adapter reads the fields of this class object while constructing a transaction JSON request to send to the payment gateway. The object of this class is available as the cardPaymentMethod field in the SaleApiPaymentMethodRequest Class, AuthApiPaymentMethodRequest Class, and PaymentMethodTokenizationRequest Class.

Example

This code sample retrieves the cardPaymentMethodRequest object from the paymentMethod class.

1commercepayments.CardPaymentMethodRequest cardPaymentMethod = paymentMethod.cardPaymentMethod;

CardPaymentMethodRequest Constructors

The following are constructors for CardPaymentMethodRequest.

CardPaymentMethodRequest(cardCategory)

Sets the cardCategory value for the card payment method request.

Signature

global CardPaymentMethodRequest(commercepayments.CardCategory cardCategory)

Parameters

cardCategory
Type: CardCategory
Defines whether the card payment method is a credit card or a debit card.

CardPaymentMethodRequest Properties

The following are properties for CardPaymentMethodRequest.

accountId

Customer account for this payment method.

Signature

global String accountId {get; set;}

Property Value

Type: String

autoPay

Indicates whether a token is being requested so that the payment method can be used for recurring payments.

Signature

global Boolean autoPay {get; set;}

Property Value

Type: Boolean

cardCategory

Indicates whether a card payment method is for a credit card or debit card.

Signature

global commercepayments.CardCategory cardCategory {get; set;}

Property Value

Type: CardCategory

cardHolderFirstName

The first name of the cardholder for the card payment method.

Signature

global String cardHolderFirstName {get; set;}

Property Value

Type: String

cardHolderLastName

The last name of the cardholder for the card payment method.

Signature

global String cardHolderLastName {get; set;}

Property Value

Type: String

cardHolderName

Full name of the cardholder on the card payment method.

Signature

global String cardHolderName {get; set;}

Property Value

Type: String

cardNumber

System-defined unique ID for the card payment method.

Signature

global String cardNumber {get; set;}

Property Value

Type: String

cardType

Defines the credit card bank. Possible values are AmericanExpress, DinersClub, JCB, Maestro, MasterCard, andVisa.

Signature

global commercepayments.CardType cardType {get; set;}

Property Value

Type: CardType

cvv

The card security code for the credit or debit card on a card payment method.

Signature

global String cvv {get; set;}

Property Value

Type: String

email

Email address of the cardholder for the credit or debit card on a card payment method.

Signature

global String email {get; set;}

Property Value

Type: String

expiryMonth

Expiration month for the credit or debit card on a card payment method.

Signature

global Integer expiryMonth {get; set;}

Property Value

Type: Integer

expiryYear

Expiration year of the credit or debit card for the card payment method.

Signature

global Integer expiryYear {get; set;}

Property Value

Type: Integer

inputCardType

Input field for the card type. This field doesn’t store the card type directly, but instead populates CardBin, LastFour, and DisplayCardNumber based on the value entered in inputCardType.

Signature

global String inputCardType {get; set;}

Property Value

Type: String

startMonth

The credit or debit card becomes valid on the first day of the startMonth in the startYear

Signature

global Integer startMonth {get; set;}

Property Value

Type: Integer

startYear

Year during which the credit or debit card becomes valid.

Signature

global Integer startYear {get; set;}

Property Value

Type: Integer

CardPaymentMethodRequest Methods

The following are methods for CardPaymentMethodRequest.

equals(obj)

Maintains the integrity of lists of type CardPaymentMethodRequest by determining the equality of external objects in a list. This method is dynamic and based on the equals method in Java.

Signature

global Boolean equals(Object obj)

Parameters

obj
Type: Object
External object whose key is to be validated.

Return Value

Type: Boolean

hashCode()

Maintains the integrity of lists of type CardPaymentMethodRequest.

Signature

global Integer hashCode()

Return Value

Type: Integer

toString()

Converts a date to a string.

Signature

global String toString()

Return Value

Type: String