VGSCustomPaymentCardModel
public struct VGSCustomPaymentCardModel : VGSPaymentCardModelProtocol
Holds information for custom payment model.
-
Payment Card Brand
Declaration
Swift
public let brand: VGSPaymentCards.CardBrand
-
Payment Card Name
Declaration
Swift
public var name: String
-
Regex Pattern required to detect Payment Card Brand
Declaration
Swift
public var regex: String
-
Valid Card Number Lengths
Declaration
Swift
public var cardNumberLengths: [Int]
-
Valid Card CVC/CVV Lengths. For most brands valid cvc lengths is [3], while for Amex is [4]. For unknown brands can be set as [3, 4]
Declaration
Swift
public var cvcLengths: [Int]
-
Check sum validation algorithm. For most brands card number can be validated by
CheckSumAlgorithmType.luhn
algorithm. Ifnone
- result of Checksum Algorithm validation will betrue
.Declaration
Swift
public var checkSumAlgorithm: CheckSumAlgorithmType?
-
Payment Card Number visual format pattern.
Note
format pattern length limits input length.Declaration
Swift
public var formatPattern: String
-
Image, associated with Payment Card Brand.
Declaration
Swift
public var brandIcon: UIImage?
-
Image, associated with CVC for Payment Card Brand.
Declaration
Swift
public var cvcIcon: UIImage?
-
Initializer.
Declaration
Swift
public init(name: String, regex: String, formatPattern: String, cardNumberLengths: [Int], cvcLengths: [Int] = [3], checkSumAlgorithm: CheckSumAlgorithmType? = .luhn, brandIcon: UIImage?)
Parameters
name
String
object, payment card model name.regex
String
object, should be valid regex expression.formatPattern
String
object, should be valid format pattern.cardNumberLengths
[Int]
object, array of valid card number lengths.cvcLengths
[Int]
object, array of valid card number CVC. Default is[3]
.checkSumAlgorithm
CheckSumAlgorithmType?
object, should be valid checkSumAlgorithm object, default is.luhn
.brandIcon
UIImage?
, card image icon.