Newer Version Available

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

CardPaymentMethod

References a credit card or debit card payment method. This entity implements the PaymentMethod entity interface. This object is available in API version 48.0 and later.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()

Special Access Rules

To access Commerce Payments entities, your org must have a Salesforce Order Management license with the Payment Platform org permission activated. Commerce Payments entities are available only in Lightning Experience.

Fields

Field Details
AccountId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Customer account for the payment method.
This is a relationship field.
Relationship Name
Account
Relationship Type
Lookup
Refers To
Account
AuditEmail
Type
email
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Email of the payment method holder.
This field is available in API v49.0 and later. It does not appear in the UI by default for Salesforce orgs that upgraded from v48.0. Users must add it to the CardPaymentMethod page layout on their own.
AutoCardType
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
Card network type, derived from the card number. This is a system field.
CardBin
Type
int
Properties
Create, Filter, Group, Nillable, Sort
Description
First six digits of the card number.
CardCategory
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort
Description
Defines whether the card is a credit card or debit card.
Possible values are:
  • CreditCard—Credit Card
  • DebitCard—Debit Card
CardHolderFirstName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
First name of the cardholder.
CardHolderLastName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Last name of the cardholder.
CardHolderName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Full name of the cardholder.
CardLastFour
Type
int
Properties
Create, Filter, Group, Nillable, Sort
Description
Last four digits of the credit card or debit card.
CardPaymentMethodNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
System-defined unique ID for the card payment method.
CardType
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort
Description
Defines the credit card bank.
Possible values are:
  • AmericanExpress
  • DinersClub
  • JCB
  • Maestro
  • MasterCard
  • Visa
CardTypeCategory
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Defines the credit card bank. Used for internal reference.
Possible values are:
  • AmericanExpress
  • DinersClub
  • JCB
  • Maestro
  • Master
  • Visa
Comments
Type
textarea
Properties
Create, Nillable, Update
Description
Users can add comments to provide additional details about a record. Maximum of 1000 characters.
CompanyName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Company of the cardholder.
DisplayCardNumber
Type
string
Properties
Filter, Group, Nillable, Sort
Description
Masked digits for the full credit card number except the last four digits.
Email
Type
email
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Email address of the card payment method holder.
ExpiryMonth
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The card’s expiration month.
ExpiryYear
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The card’s expiration year.
GatewayDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date that the card payment method interacted with the payment gateway.
GatewayResultCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The result of the card payment method’s interaction with the payment gateway during a transaction request.
GatewayResultCodeDescription
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Additional information about the gateway result code. Descriptions will vary between payment gateway providers.
GatewayToken
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Unique token ID generated by the payment gateway for the card payment method for future transactions. This version is not encrypted.
If you try to record a GatewayToken while the digital wallet already has a GatewayToken or GatewayTokenEncrypted value, Salesforce throws an error.
GatewayTokenDetails
Type
textarea
Properties
Create, Filter, Nillable, Sort, Update
Description
Additional information about the gateway token.
GatewayTokenEncrypted
Type
encryptedstring
Properties
Create, Nillable, Update
Description
Encrypted version of the unique token ID generated by the payment gateway to represent the card payment method for future transactions. Encrypted using Salesforce Classic Encryption.
Available in API v52.0 and later.
InputCardNumber
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
Field for users to enter a credit card number when storing an external-type card payment method. After entry, the credit card number doesn't persist in Salesforce, so the InputCardNumber value always appears blank. The credit card number will appear as a masked value in DisplayCardNumber, which shows only the last four digits.
IpAddress
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
IP address of the card payment method holder.
This field is available in API v49.0 and later. It does not appear in the UI by default for Salesforce orgs that upgraded from v48.0. Users must add it to the CardPaymentMethod page layout on their own.
InputCardNumber
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
Input field for the card number. This field doesn’t store the card number directly, but instead populates CardBin, LastFour, and DisplayCardNumber based on the value entered in InputCardNumber.
LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.
MacAddress
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
MAC address of the card payment method holder.
This field is available in API v49.0 and later. It does not appear in the UI by default for Salesforce orgs that upgraded from v48.0. Users must add it to the CardPaymentMethod page layout on their own.
NickName
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
User-defined nickname for the card payment method.
PaymentGatewayId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort
Description
The payment gateway used to create a gateway token. For transactions with a saved payment method in Salesforce, this field stores the payment gateway record used in the transaction.
This is a relationship field.
Relationship Name
PaymentGateway
Relationship Type
Lookup
Refers To
PaymentGateway
PaymentMethodAddress
Type
address
Properties
Filter, Nillable
Description
Full address related to the card payment method. Also known as the billing address.
PaymentMethodCity
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodCountry
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodGeocodeAccuracy
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Part of the address for the payment method.
Possible values are:
  • Address
  • Block
  • City
  • County
  • ExtendedZip
  • NearAddress
  • Neighborhood
  • State
  • Street
  • Unknown
  • Zip
PaymentMethodLatitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodLongitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodPostalCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodState
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Part of the address for the payment method.
PaymentMethodStreet
Type
textarea
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Part of the address for the payment method.
Phone
Type
phone
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Phone number of the card payment method holder.
This field is available in API v49.0 and later. It does not appear in the UI by default for Salesforce orgs that upgraded from v48.0. Users must add it to the CardPaymentMethod page layout on their own.
ProcessingMode
Type
picklist
Properties
Create, Filter, Group, Restricted picklist, Sort
Description
Defines whether the card payment method is used for transactions made inside or outside the payment platform.
Possible values are:
  • External—Transactions happened outside of the Salesforce payments platform.
  • Salesforce—Salesforce made and recorded an external call to the payment platform.
This field is available in API v49.0 and later. It does not appear in the UI by default for Salesforce orgs that upgraded from v48.0. Users must add it to the CardPaymentMethod page layout on their own.

ProcessingMode is required to create a CardPaymentMethod entity.

Important

SfResultCode
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Shows the results of the card payment method’s interaction with the payment gateway.
Possible values are:
  • Decline
  • Indeterminate
  • PermanentFail
  • RequiresReview
  • Success
  • SystemError
  • ValidationError
StartMonth
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Start month of the card.
StartYear
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Start year of the card.
Status
Type
picklist
Properties
Create, Filter, Group, Restricted picklist, Sort, Update
Description
Possible values are:
  • Active
  • Canceled
  • InActive

Usage

The following fields drop zeroes that appear at the beginning of the field value, and introduce commas for values with four or more digits:
  • CardLastFour
  • CardBin
  • ExpiryYear
For example, a CardLastFour entered value of 0004112233445566 would appear as 4,112,233,445,566 on the record.
As a workaround, create a String-type custom formula field with the same label as the field that you want to replace, then hide the original field. Here are some examples for replacing CardLastFour, CardBin, and ExpiryYear.
CardLastFour
IF(ISBLANK(CardLastFour), NULL,RIGHT("0000" & TEXT(CardLastFour) , 4))
CardBin
IF(ISBLANK(CardBin), NULL,RIGHT("000000" & TEXT(CardBin) , 6))
ExpiryYear
IF(ISBLANK(ExpiryYear), NULL,TEXT(ExpiryYear)))