Represents the payment details of a card to be used for payments. These details are determined by the payment token generated by Web Payments SDK.
Card
Name | Type | Tags | Description | Getter | Setter |
---|---|---|---|---|---|
id |
?string |
Optional | Unique ID for this card. Generated by Square. Constraints: Maximum Length: 64 |
getId(): ?string | setId(?string id): void |
cardBrand |
?string(CardBrand) |
Optional | Indicates a card's brand, such as VISA or MASTERCARD . |
getCardBrand(): ?string | setCardBrand(?string cardBrand): void |
last4 |
?string |
Optional | The last 4 digits of the card number. Constraints: Maximum Length: 4 |
getLast4(): ?string | setLast4(?string last4): void |
expMonth |
?int |
Optional | The expiration month of the associated card as an integer between 1 and 12. | getExpMonth(): ?int | setExpMonth(?int expMonth): void |
expYear |
?int |
Optional | The four-digit year of the card's expiration date. | getExpYear(): ?int | setExpYear(?int expYear): void |
cardholderName |
?string |
Optional | The name of the cardholder. Constraints: Maximum Length: 96 |
getCardholderName(): ?string | setCardholderName(?string cardholderName): void |
billingAddress |
?Address |
Optional | Represents a postal address in a country. For more information, see Working with Addresses. |
getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void |
fingerprint |
?string |
Optional | Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. Constraints: Maximum Length: 255 |
getFingerprint(): ?string | setFingerprint(?string fingerprint): void |
customerId |
?string |
Optional | Required The ID of a customer created using the Customers API to be associated with the card. | getCustomerId(): ?string | setCustomerId(?string customerId): void |
merchantId |
?string |
Optional | The ID of the merchant associated with the card. | getMerchantId(): ?string | setMerchantId(?string merchantId): void |
referenceId |
?string |
Optional | An optional user-defined reference ID that associates this card with another entity in an external system. For example, a customer ID from an external customer management system. Constraints: Maximum Length: 128 |
getReferenceId(): ?string | setReferenceId(?string referenceId): void |
enabled |
?bool |
Optional | Indicates whether or not a card can be used for payments. | getEnabled(): ?bool | setEnabled(?bool enabled): void |
cardType |
?string(CardType) |
Optional | Indicates a card's type, such as CREDIT or DEBIT . |
getCardType(): ?string | setCardType(?string cardType): void |
prepaidType |
?string(CardPrepaidType) |
Optional | Indicates a card's prepaid type, such as NOT_PREPAID or PREPAID . |
getPrepaidType(): ?string | setPrepaidType(?string prepaidType): void |
bin |
?string |
Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. Constraints: Maximum Length: 6 |
getBin(): ?string | setBin(?string bin): void |
version |
?int |
Optional | Current version number of the card. Increments with each card update. Requests to update an existing Card object will be rejected unless the version in the request matches the current version for the Card. |
getVersion(): ?int | setVersion(?int version): void |
cardCoBrand |
?string(CardCoBrand) |
Optional | Indicates the brand for a co-branded card. | getCardCoBrand(): ?string | setCardCoBrand(?string cardCoBrand): void |
{
"id": "id0",
"card_brand": "INTERAC",
"last_4": "last_42",
"exp_month": 240,
"exp_year": 56
}