CardPaymentMethodRequest Class

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

CommercePayments

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.

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

The following are constructors for CardPaymentMethodRequest.

Sets the cardCategory value for the card payment method request.

global CardPaymentMethodRequest(commercepayments.CardCategory cardCategory)

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

The following are properties for CardPaymentMethodRequest.

  • accountId

    Customer account for this payment method.

  • autoPay

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

  • cardCategory

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

  • cardHolderFirstName

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

  • cardHolderLastName

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

  • cardHolderName

    Full name of the cardholder on the card payment method.

  • cardNumber

    System-defined unique ID for the card payment method.

  • cardType

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

  • cvv

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

  • email

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

  • expiryMonth

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

  • expiryYear

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

  • 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.

  • startMonth

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

  • startYear

    Year during which the credit or debit card becomes valid.

Customer account for this payment method.

global String accountId {get; set;}

Type: String

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

global Boolean autoPay {get; set;}

Type: Boolean

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

global commercepayments.CardCategory cardCategory {get; set;}

Type: CardCategory

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

global String cardHolderFirstName {get; set;}

Type: String

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

global String cardHolderLastName {get; set;}

Type: String

Full name of the cardholder on the card payment method.

global String cardHolderName {get; set;}

Type: String

System-defined unique ID for the card payment method.

global String cardNumber {get; set;}

Type: String

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

global commercepayments.CardType cardType {get; set;}

Type: CardType

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

global String cvv {get; set;}

Type: String

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

global String email {get; set;}

Type: String

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

global Integer expiryMonth {get; set;}

Type: Integer

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

global Integer expiryYear {get; set;}

Type: Integer

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.

global String inputCardType {get; set;}

Type: String

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

global Integer startMonth {get; set;}

Type: Integer

Year during which the credit or debit card becomes valid.

global Integer startYear {get; set;}

Type: Integer

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.

  • hashCode()

    Maintains the integrity of lists of type CardPaymentMethodRequest.

  • toString()

    Converts a date to a string.

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.

global Boolean equals(Object obj)

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

Type: Boolean

Maintains the integrity of lists of type CardPaymentMethodRequest.

global Integer hashCode()

Type: Integer

Converts a date to a string.

global String toString()

Type: String