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.luhnalgorithm. 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
nameStringobject, payment card model name.regexStringobject, should be valid regex expression.formatPatternStringobject, 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].checkSumAlgorithmCheckSumAlgorithmType?object, should be valid checkSumAlgorithm object, default is.luhn.brandIconUIImage?, card image icon.
View on GitHub