Configuration

public struct Configuration

Card.Configuration

Card Configuration consists of a Card Network and a given length

  • The network of the configuration

    Declaration

    Swift

    public let cardNetwork: CardNetwork
  • The length of the card for this configuration

    Declaration

    Swift

    public let cardLength: Int
  • Designated initializer for a card configuration

    Declaration

    Swift

    public init(_ cardNetwork: CardNetwork, _ cardLength: Int)

    Parameters

    cardNetwork

    the card network (eg. Visa, MasterCard or AMEX)

    cardLength

    the length of the card number (eg. 16 or 19 for Maestro cards)

    Return Value

    a Card.Configuration object

  • Helper method to get a pattern string for a certain configuration

    Returns

    a given String with the correct pattern

    Declaration

    Swift

    public func patternString() -> String?

    Return Value

    a given String with the correct pattern

  • Helper method to get a placeholder string for a certain configuration

    Returns

    a given String as a placeholder

    Declaration

    Swift

    public func placeholderString() -> String?

    Return Value

    a given String as a placeholder