---
schema_version: "1"
id: 1f75081f45ffc8f2316ed9eac9a54960ec7481f139e4a09a03c3d3a49b0b37a8
title: CardPaymentMethodResponse Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercepayments_CardPaymentMethodResponse.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1f6df46041b9ddb46cf1600f1bdbb6bc8fe2c3ab42f3902d4c05c843268509f2
description: This class contains details about the card payment method.Sets the Salesforce payments account to which this payment method is linked.Sets whether a token for recurring payments is being requested or not.Sets the card Bank Identification Number (BIN).Sets the card category.Sets the first name of the card holder.Sets the last name of the card holder.Sets the name of the card holder.Sets the last four digits of the card.Specifies the type of the credit card issuer.Sets the credit card issuer.Sets the notes added by a user for card payment.Sets the display card number.Sets the email address of the card holder.Sets the month of expiry of the card.Sets the year of expiry of the card.Sets the nickname of the card.Sets the month the card becomes active.Sets the year the card becomes active.
---
# CardPaymentMethodResponse Class

This class contains details about the card payment method.

## 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.")

- **[CardPaymentMethodResponse Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_methods)**

## CardPaymentMethodResponse Methods

The following are methods for CardPaymentMethodResponse.

- **[setAccountId(accountId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setAccountId)**  
    Sets the Salesforce payments account to which this payment method is linked.
- **[setAutoPay(autoPay)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setAutoPay)**  
    Sets whether a token for recurring payments is being requested or not.
- **[setCardBin(cardBin)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardBin)**  
    Sets the card Bank Identification Number (BIN).
- **[setCardCategory(cardCategory)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardCategory)**  
    Sets the card category.
- **[setCardHolderFirstName(cardHolderFirstName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardHolderFirstName)**  
    Sets the first name of the card holder.
- **[setCardHolderLastName(cardHolderLastName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardHolderLastName)**  
    Sets the last name of the card holder.
- **[setCardHolderName(cardHolderName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardHolderName)**  
    Sets the name of the card holder.
- **[setCardLastFour(cardLastFour)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardLastFour)**  
    Sets the last four digits of the card.
- **[setCardType(cardType)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardType)**  
    Specifies the type of the credit card issuer.
- **[setCardTypeCategory(cardTypeCategory)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setCardTypeCategory)**  
    Sets the credit card issuer.
- **[setComments(comments)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setComments)**  
    Sets the notes added by a user for card payment.
- **[setDisplayCardNumber(displayCardNumber)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setDisplayCardNumber)**  
    Sets the display card number.
- **[setEmail(email)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setEmail)**  
    Sets the email address of the card holder.
- **[setExpiryMonth(expiryMonth)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setExpiryMonth)**  
    Sets the month of expiry of the card.
- **[setExpiryYear(expiryYear)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setExpiryYear)**  
    Sets the year of expiry of the card.
- **[setNickName(nickName)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setNickName)**  
    Sets the nickname of the card.
- **[setStartMonth(startMonth)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setStartMonth)**  
    Sets the month the card becomes active.
- **[setStartYear(startYear)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercepayments_CardPaymentMethodResponse.htm#apex_commercepayments_CardPaymentMethodResponse_setStartYear)**  
    Sets the year the card becomes active.

### setAccountId(accountId)

Sets the Salesforce payments account to which this payment method is linked.

#### Signature

public void setAccountId(Id accountId)

#### Parameters

- **accountId**: Type: [Id](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.") Salesforce Payments account to which this payment method is linked.

#### Return Value

Type: void

### setAutoPay(autoPay)

Sets whether a token for recurring payments is being requested or not.

#### Signature

public void setAutoPay(Boolean autoPay)

#### Parameters

- **autoPay**: Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.") Indicates whether a token for recurring payments is being requested (true) or not (false). The token lets the payment method be used for recurring payments.

#### Return Value

Type: void

### setCardBin(cardBin)

Sets the card Bank Identification Number (BIN).

#### Signature

public void setCardBin(String cardBin)

#### Parameters

- **cardBin**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Bank Identification Number (BIN). The BIN is the first 4-6 numbers on a payment card that identifies the card issuer.

#### Return Value

Type: void

### setCardCategory(cardCategory)

Sets the card category.

#### Signature

public void setCardCategory(commercepayments.CardCategory cardCategory)

#### Parameters

- **cardCategory**: Type: [CommercePayments.CardCategory](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_commercepayments_CardCategory.htm "Defines whether the payment method represents a credit card or a debit card.") Specifies whether it is a credit card or debit card.

#### Return Value

Type: void

### setCardHolderFirstName(cardHolderFirstName)

Sets the first name of the card holder.

#### Signature

public void setCardHolderFirstName(String cardHolderFirstName)

#### Parameters

- **cardHolderFirstName**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") First name of the card holder.

#### Return Value

Type: void

### setCardHolderLastName(cardHolderLastName)

Sets the last name of the card holder.

#### Signature

public void setCardHolderLastName(String cardHolderLastName)

#### Parameters

- **cardHolderLastName**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Last name of the card holder.

#### Return Value

Type: void

### setCardHolderName(cardHolderName)

Sets the name of the card holder.

#### Signature

public void setCardHolderName(String cardHolderName)

#### Parameters

- **cardHolderName**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Card holder name.

#### Return Value

Type: void

### setCardLastFour(cardLastFour)

Sets the last four digits of the card.

#### Signature

public void setCardLastFour(String cardLastFour)

#### Parameters

- **cardLastFour**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Last four digits of the card.

#### Return Value

Type: void

### setCardType(cardType)

Specifies the type of the credit card issuer.

#### Signature

public void setCardType(String cardType)

#### Parameters

- **cardType**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Type of the credit card issuer.

#### Return Value

Type: void

### setCardTypeCategory(cardTypeCategory)

Sets the credit card issuer.

#### Signature

public void setCardTypeCategory(commercepayments.CardType cardTypeCategory)

#### Parameters

- **cardTypeCategory**: Type: [CommercePayments.CardType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_commercepayments_CardType.htm "Specifies the credit card issuer.") Credit card issuer.

#### Return Value

Type: void

### setComments(comments)

Sets the notes added by a user for card payment.

#### Signature

public void setComments(String comments)

#### Parameters

- **comments**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Details about a record added by a user, maximum is 1000 characters.

#### Return Value

Type: void

### setDisplayCardNumber(displayCardNumber)

Sets the display card number.

#### Signature

public void setDisplayCardNumber(String displayCardNumber)

#### Parameters

- **displayCardNumber**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Displayed card number.

#### Return Value

Type: void

### setEmail(email)

Sets the email address of the card holder.

#### Signature

public void setEmail(String email)

#### Parameters

- **email**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Email address of the card holder.

#### Return Value

Type: void

### setExpiryMonth(expiryMonth)

Sets the month of expiry of the card.

#### Signature

public void setExpiryMonth(Integer expiryMonth)

#### Parameters

- **expiryMonth**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") Month of expiry of the card.

#### Return Value

Type: void

### setExpiryYear(expiryYear)

Sets the year of expiry of the card.

#### Signature

public void setExpiryYear(Integer expiryYear)

#### Parameters

- **expiryYear**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") Year of expiry of the card.

#### Return Value

Type: void

### setNickName(nickName)

Sets the nickname of the card.

#### Signature

public void setNickName(String nickName)

#### Parameters

- **nickName**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Card nickname.

#### Return Value

Type: void

### setStartMonth(startMonth)

Sets the month the card becomes active.

#### Signature

public void setStartMonth(Integer startMonth)

#### Parameters

- **startMonth**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") Determines from which month the card becomes active.

#### Return Value

Type: void

### setStartYear(startYear)

Sets the year the card becomes active.

#### Signature

public void setStartYear(Integer startYear)

#### Parameters

- **startYear**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") Determines from which year the card becomes active.

#### Return Value

Type: void