Skip to content

Commit

Permalink
Public release 1.16.1 (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrokhl committed Apr 16, 2024
2 parents 8086379 + 490152d commit 774bbb7
Show file tree
Hide file tree
Showing 46 changed files with 150 additions and 2,384 deletions.
25 changes: 0 additions & 25 deletions Package.resolved

This file was deleted.

7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "VGSCollectSDK",
platforms: [
.iOS(.v11),
.iOS(.v12),
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
Expand All @@ -29,7 +29,7 @@ let package = Package(
.package(
name: "BlinkCard",
url: "https://github.com/blinkcard/blinkcard-swift-package",
.exact("2.7.0")
.exact("2.9.1")
)
],
targets: [
Expand All @@ -40,7 +40,8 @@ let package = Package(
exclude: [
"Info.plist",
"VGSCollectSDK.h"
]),
],
resources: [.copy("PrivacyInfo.xcprivacy")]),
.testTarget(
name: "FrameworkTests",
dependencies: ["VGSCollectSDK"],
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '10.0'
platform :ios, '12.0'

workspace 'VGSCollectSDK'

Expand Down
25 changes: 24 additions & 1 deletion Sources/VGSBlinkCardCollector/VGSBlinkCardController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ public class VGSBlinkCardController {
}
}

// MARK: - MBCBlinkCardRecognizer params
/// https://blinkcard.github.io/blinkcard-ios/Classes/MBCBlinkCardRecognizer.html

/// Should extract the card owner information.
public var extractOwner: Bool = true {
didSet {scanHandler?.cardRecognizer.extractOwner = extractOwner }
}
/// Should extract the payment card’s month of expiry.
public var extractExpiryDate: Bool = true {
didSet {scanHandler?.cardRecognizer.extractExpiryDate = extractExpiryDate }
}
/// Should extract CVV.
public var extractCvv: Bool = true {
didSet {scanHandler?.cardRecognizer.extractCvv = extractCvv }
}
/// Should extract the payment card’s IBAN.
public var extractIban: Bool = true {
didSet {scanHandler?.cardRecognizer.extractIban = extractIban }
}
/// Whether invalid card number is accepted.
public var allowInvalidCardNumber: Bool = false {
didSet {scanHandler?.cardRecognizer.allowInvalidCardNumber = allowInvalidCardNumber }
}

// MARK: - Initialization

/// Initialization
Expand All @@ -40,7 +64,6 @@ public class VGSBlinkCardController {
public required init(licenseKey: String, delegate: VGSBlinkCardControllerDelegate? = nil, onError errorCallback: @escaping ((NSInteger) -> Void)) {
self.scanHandler = VGSBlinkCardHandler(licenseKey: licenseKey, errorCallback: errorCallback)
self.delegate = delegate

}

// MARK: - Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct VGSCardIOViewControllerRepresentable: UIViewControllerRepresentabl

public var onCardScanned: (() -> Void)?

public init(fieldMappingPolicy: [CradIODataType : VGSTextField] = [CradIODataType: VGSTextField]()) {
public init(fieldMappingPolicy: [CradIODataType: VGSTextField] = [CradIODataType: VGSTextField]()) {
self.fieldMappingPolicy = fieldMappingPolicy
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ extension VGSCollect {
*/
public func sendData(path: String, method: VGSCollectHTTPMethod = .post, routeId: String? = nil, extraData: [String: Any]? = nil, requestOptions: VGSCollectRequestOptions = VGSCollectRequestOptions()) async -> VGSResponse {
return await withCheckedContinuation { continuation in
//NOTE: We need to use main thread since data will be collected from UI elements
// NOTE: We need to use main thread since data will be collected from UI elements
DispatchQueue.main.async {
self.sendData(path: path, method: method, routeId: routeId, extraData: extraData, requestOptions: requestOptions) { response in
continuation.resume(returning: response)
Expand Down
5 changes: 2 additions & 3 deletions Sources/VGSCollectSDK/Core/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,12 @@ internal extension FieldType {
case .cardHolderName:
return "^([a-zA-Z0-9\\ \\,\\.\\-\\']{2,})$"
case .ssn:
return
"^(?!\\b(\\d)\\1+\\b)(?!(123456789|219099999|078051120|457555462))(?!(000|666|9))(\\d{3}-?(?!(00))\\d{2}-?(?!(0000))\\d{4})$"
return "^(?!(000|666|9))(\\d{3}(-|\\s)?(?!(00))\\d{2}(-|\\s)?(?!(0000))\\d{4})$"
case .cvc:
return "\\d*$"
case .none:
return ""
}
}
}

var keyboardType: UIKeyboardType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ public enum VGSVaultAliasFormat: String {

/// no:doc
case UUID = "UUID"

/// no:doc
case GENERIC_T_FOUR = "GENERIC_T_FOUR"

/// no:doc
case ALPHANUMERIC_SIX_T_FOUR = "ALPHANUMERIC_SIX_T_FOUR"

/// no:doc
case ALPHANUMERIC_LENGTH_PRESERVING = "ALPHANUMERIC_LENGTH_PRESERVING"

/// no:doc
case ALPHANUMERIC_LENGTH_PRESERVING_T_FOUR = "ALPHANUMERIC_LENGTH_PRESERVING_T_FOUR"

/// no:doc
case ALPHANUMERIC_SSN_T_FOUR = "ALPHANUMERIC_SSN_T_FOUR"

/// no:doc
case ALPHANUMERIC_LENGTH_PRESERVING_SIX_T_FOUR = "ALPHANUMERIC_LENGTH_PRESERVING_SIX_T_FOUR"

}

internal protocol VGSTextFieldTokenizationConfigurationProtocol {
Expand Down
22 changes: 22 additions & 0 deletions Sources/VGSCollectSDK/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeProductInteraction</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,3 @@ public struct VGSCVCTextFieldRepresentable: UIViewRepresentable, VGSCVCTextField
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,3 @@ public struct VGSDateTextFieldRepresentable: UIViewRepresentable, VGSDateTextFie
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

import Foundation
import UIKit

// MARK: - VGSCardTextFieldRepresentable.
internal protocol VGSTextFieldRepresentableProtocol {
Expand All @@ -20,7 +21,7 @@ internal protocol VGSTextFieldRepresentableProtocol {
/// Textfield spell checking type.
var spellCheckingType: UITextSpellCheckingType {get set}
/// `UIEdgeInsets` for text and placeholder inside `VGSTextField`.
var textFieldPadding: UIEdgeInsets {get set}
var textFieldPadding: UIEdgeInsets {get set}
/// The technique to use for aligning the text.
var textAlignment: NSTextAlignment {get set}
/// Sets when the clear button shows up.
Expand Down
2 changes: 1 addition & 1 deletion Sources/VGSCollectSDK/Utils/Extensions/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class Utils {

/// VGS Collect SDK Version.
/// Necessary since SPM doesn't track info plist correctly: https://forums.swift.org/t/add-info-plist-on-spm-bundle/40274/5
static let vgsCollectVersion: String = "1.16.0"
static let vgsCollectVersion: String = "1.16.1"
}

extension Dictionary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class SSNTextFieldTests: VGSCollectBaseTestCase {
ssnTextField.configuration = config

let notValidSSN = [
"111111111", "222222222", "555555555",
"666666666", "999999999", "000000000",
"000123456", "143004563", "235230000",
"923423423", "666123456", "123456789",
"219099999", "078051120", "457555462",
"22334455", "3434343", "11111111222"
"000345567",
"666467547",
"456005634",
"573650000",
"000000000",
"900567444"
]

for ssn in notValidSSN {
Expand All @@ -81,12 +81,23 @@ class SSNTextFieldTests: VGSCollectBaseTestCase {
ssnTextField.configuration = config

let validSSN = [
"111111112", "222232222", "455555555",
"166666666", "899999999", "001010001",
"100123456", "143104563", "235231000",
"823423423", "665123455", "123456780",
"219099998", "078051125", "457555465",
/// mask should cut extra symbols
"111111112",
"222232222",
"112111112",
"221232222",
"455555555",
"166666666",
"899999999",
"001010001",
"100123456",
"143104563",
"235231000",
"823423423",
"665123455",
"123456780",
"219099998",
"078051125",
"457555465",
"234567890123456789"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,42 +120,42 @@ class ValidationRulesTest: VGSCollectBaseTestCase {
config.formatPattern = ""

textfield.configuration = config
textfield.textField.secureText = "1024"
textfield.textField.secureText = "1027"
XCTAssertTrue(textfield.state.isValid)
XCTAssertTrue(textfield.state.validationErrors.count == 0)

textfield.textField.secureText = "102024"
textfield.textField.secureText = "102027"
XCTAssertTrue(textfield.state.isValid == false)
XCTAssertTrue(textfield.state.validationErrors.count == 1)

config.validationRules = VGSValidationRuleSet(rules: [
VGSValidationRuleCardExpirationDate(dateFormat: .shortYear, error: error)
])
textfield.configuration = config
textfield.textField.secureText = "1024"
textfield.textField.secureText = "1027"
XCTAssertTrue(textfield.state.isValid)
XCTAssertTrue(textfield.state.validationErrors.count == 0)

textfield.textField.secureText = "102024"
textfield.textField.secureText = "102027"
XCTAssertTrue(textfield.state.isValid == false)
XCTAssertTrue(textfield.state.validationErrors.count == 1)
XCTAssertTrue(textfield.state.validationErrors.first == error)

/// Test month in valid range
textfield.textField.secureText = "1324"
textfield.textField.secureText = "1327"
XCTAssertTrue(textfield.state.isValid == false)
XCTAssertTrue(textfield.state.validationErrors.count == 1)
XCTAssertTrue(textfield.state.validationErrors.first == error)

textfield.textField.secureText = "0124"
textfield.textField.secureText = "0127"
XCTAssertTrue(textfield.state.isValid == true)
XCTAssertTrue(textfield.state.validationErrors.count == 0)

textfield.textField.secureText = "1224"
textfield.textField.secureText = "1227"
XCTAssertTrue(textfield.state.isValid == true)
XCTAssertTrue(textfield.state.validationErrors.count == 0)

textfield.textField.secureText = "0024"
textfield.textField.secureText = "0027"
XCTAssertTrue(textfield.state.isValid == false)
XCTAssertTrue(textfield.state.validationErrors.count == 1)
XCTAssertTrue(textfield.state.validationErrors.first == error)
Expand All @@ -164,12 +164,12 @@ class ValidationRulesTest: VGSCollectBaseTestCase {
VGSValidationRuleCardExpirationDate(dateFormat: .longYear, error: error)
])
textfield.configuration = config
textfield.textField.secureText = "1024"
textfield.textField.secureText = "1027"
XCTAssertTrue(textfield.state.isValid == false)
XCTAssertTrue(textfield.state.validationErrors.count == 1)
XCTAssertTrue(textfield.state.validationErrors.first == error)

textfield.textField.secureText = "102024"
textfield.textField.secureText = "102027"
XCTAssertTrue(textfield.state.isValid)
XCTAssertTrue(textfield.state.validationErrors.count == 0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ class VGSExpirationDateTextFieldUtilsTests: VGSCollectBaseTestCase {
TestDateFormatItem(month: 3, year: 2026, format: .longYearThenMonth, expectedOutput: "202603")
]

// MARK: - Override

override func setUp() {
super.setUp()
}

override func tearDown() {
super.tearDown()
}

// MARK: - Tests

/// Test date mapping utils.
Expand Down
6 changes: 3 additions & 3 deletions VGSCollectSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'VGSCollectSDK'
spec.version = '1.16.0'
spec.version = '1.16.1'
spec.summary = 'VGS Collect - is a product suite that allows customers to collect information securely without possession of it.'
spec.swift_version = '5.0'
spec.description = <<-DESC
Expand All @@ -22,7 +22,7 @@ Pod::Spec.new do |spec|

spec.subspec 'Core' do |core|
#set as default podspec to prevent from downloading additional modules
core.source_files = "Sources/VGSCollectSDK", "Sources/VGSCollectSDK/**/*.{swift}", "Sources/VGSCollectSDK/**/*.{h, m}"
core.source_files = "Sources/VGSCollectSDK", "Sources/VGSCollectSDK/**/*.{swift}", "Sources/VGSCollectSDK/**/*.{h, m}", "Sources/VGSCollectSDK/PrivacyInfo.xcprivacy"
core.resource_bundles = {
'CardIcon' => ['Sources/VGSCollectSDK/Resources/*']
}
Expand All @@ -31,7 +31,7 @@ Pod::Spec.new do |spec|
spec.subspec 'BlinkCard' do |blinkcard|
blinkcard.source_files = "Sources/VGSBlinkCardCollector", "Sources/VGSBlinkCardCollector/**/*.{swift}"
blinkcard.dependency "VGSCollectSDK/Core"
blinkcard.dependency "MBBlinkCard", "2.7.0"
blinkcard.dependency "MBBlinkCard", "2.9.1"
blinkcard.ios.deployment_target = "13.0"
end

Expand Down
Loading

0 comments on commit 774bbb7

Please sign in to comment.