SavedCard

@objc(DTSavedCard)
@objcMembers
public class SavedCard : 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.

  • Expiry date

    Declaration

    Swift

    public private(set) var cardExpiryDate: CardExpiryDate? { get }
  • 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.

    Declaration

    Swift

    public private(set) var maskedCardNumber: String? { get }
  • Cardholder’s name

    Declaration

    Swift

    public var cardholder: String?
  • Additional card metadata of the saved card.

    Declaration

    Swift

    public var cardInfo: CardInfo?
  • Initializes a SavedCard object with the given card data.

    Declaration

    Swift

    public init(type: PaymentMethodType, alias: String, cardExpiryDate: CardExpiryDate?, maskedCardNumber: String?, cardholder: String?, cardInfo: CardInfo? = nil)

    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

    Card info

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

    Declaration

    Swift

    override public func isValid() -> Bool