CardComponent

public final class CardComponent : PaymentComponent, PresentableComponent, Localizable

A component that provides a form for card payments.

  • Describes the component’s UI style.

    Declaration

    Swift

    public let style: FormComponentStyle
  • The card payment method.

    Declaration

    Swift

    public let paymentMethod: PaymentMethod
  • The delegate of the component.

    Declaration

    Swift

    public weak var delegate: PaymentComponentDelegate?
  • The supported card types. The getter is O(n), since it filters out all the excludedCardTypes before returning.

    Declaration

    Swift

    public var supportedCardTypes: [CardType] { get set }
  • Indicates if the field for entering the holder name should be displayed in the form. Defaults to false.

    Declaration

    Swift

    public var showsHolderNameField: Bool
  • Indicates if the field for storing the card payment method should be displayed in the form. Defaults to true.

    Declaration

    Swift

    public var showsStorePaymentMethodField: Bool
  • Indicates if form will show a large header title. True - show title; False - assign title to a view controller’s title. Defaults to true.

    Declaration

    Swift

    public var showsLargeTitle: Bool
  • Initializes the card component.

    Declaration

    Swift

    public init(paymentMethod: AnyCardPaymentMethod,
                publicKey: String,
                style: FormComponentStyle = FormComponentStyle())

    Parameters

    paymentMethod

    The card payment method.

    publicKey

    The key used for encrypting card data.

    style

    The Component’s UI style.

  • Initializes the card component for stored cards.

    Declaration

    Swift

    public init(paymentMethod: StoredCardPaymentMethod,
                publicKey: String,
                style: FormComponentStyle = FormComponentStyle())

    Parameters

    paymentMethod

    The stored card payment method.

    publicKey

    The key used for encrypting card data.

    style

    The Component’s UI style.