CreditCard

@Serializable
data class CreditCard : PaymentMethod(source)

A data class representing a credit card.

Constructors

Link copied to clipboard
constructor(nameOnCard: String?, cardNumber: String?, lastFourDigits: String?, cardType: String?, expiration: ExpirationDate?, cvv: String?, requireCvv: Boolean?, billingAddress: Address?, isDefault: Boolean?)

Constructor for creating a CreditCard with primary details and billing address.

constructor(nameOnCard: String?, lastFourDigits: String?, cardType: String?, expiration: ExpirationDate?, cvv: String? = null, requireCvv: Boolean? = null, token: String?, gatewayToken: String? = null)

Constructor for creating a CreditCard using tokens.

Properties

Link copied to clipboard

The billing address associated with the card.

Link copied to clipboard

The type of the card (e.g., Visa, Mastercard).

Link copied to clipboard

The expiration date of the card.

Link copied to clipboard

A token from the payment gateway representing the credit card.

Link copied to clipboard

Indicates if the card is the default payment method.

Link copied to clipboard

The last four digits of the card number.

Link copied to clipboard

The name on the card.

Link copied to clipboard
Link copied to clipboard

A token representing the credit card.

Functions

Link copied to clipboard
open override fun toJson(): JsonObject

Converts the CreditCard object to a JsonObject representation. By default, sensitive information like cardNumber and cvv are excluded.