SavedCard

data class SavedCard(val type: PaymentMethodType, var alias: String, val cardExpiryDate: CardExpiryDate?, val maskedCardNumber: String?, val cardholder: String?, val cardInfo: SavedCardInfo?) : SavedPaymentMethod

This class contains saved credit or debit card payment method details.

Just like any other SavedPaymentMethod subclass, this class can be used to finalize a payment without user interaction or to display a selection of saved payment methods to the user for fast checkouts.

A SavedCard can be created by successfully completing a card payment or with a dedicated registration.

Parameters

type

Payment method type, e.g. Visa

alias

This is the alias for the card, also known as token. This can be used to debit the card without further customer interaction.

cardExpiryDate

Expiry date

maskedCardNumber

The masked card number you can use to display that specific card in your app. The masked card number shows the first 6 digits and the last 4 digits of the card, e.g. 432930xxxxxx6095.

cardholder

Cardholder's name

cardInfo

Additional card metadata of the saved card.

Constructors

Link copied to clipboard
constructor(type: PaymentMethodType, alias: String, cardExpiryDate: CardExpiryDate?, maskedCardNumber: String?, cardholder: String?, cardInfo: SavedCardInfo?)

Properties

Link copied to clipboard
open override var alias: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val isValid: Boolean

Checks if the expiration date is in the future or not.

Link copied to clipboard
Link copied to clipboard
open override val type: PaymentMethodType

Functions

Link copied to clipboard
open override fun clone(): SavedCard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getAccessibilityTitle(context: Context): String

For TalkBack this title is used instead of getDisplayTitle.

Link copied to clipboard
open fun getDisplayTitle(context: Context): String

A human readable title.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun toJson(): String

Returns a JSON string representation of this saved payment method object to be deserialized with create.

Link copied to clipboard
open override fun toString(): String