Scheme
public enum Scheme : CaseIterable, Equatable, Hashable
Enum representing card scheme.
We only support the following schemes:
- American Express
- Diner’s Club
- Discover
- JCB
- Mada
- Maestro
- Mastercard
- Visa
-
Declaration
Swift
public static var allCases: [Card.Scheme] -
Declaration
Swift
case unknown -
Declaration
Swift
case mada -
Declaration
Swift
case visa -
Declaration
Swift
case mastercard -
Declaration
Swift
case maestro(length: Int = 0) -
Declaration
Swift
case americanExpress -
Declaration
Swift
case discover -
Declaration
Swift
case dinersClub -
Declaration
Swift
case jcb -
Declaration
Swift
public init?(rawValue: String, length: Int? = nil) -
Declaration
Swift
public var rawValue: String { get } -
map of card scheme to indexes of spaces in formatted card number string eg. a visa card has gaps at 4, 8 and 12. 4242424242424242 becomes 4242 4242 4242 4242
Declaration
Swift
public var cardGaps: [Int] { get } -
Declaration
Swift
public var description: String { get }
View on GitHub
Scheme