Skip to content

Commit

Permalink
Merge pull request #348 from verygoodsecurity/canary
Browse files Browse the repository at this point in the history
Public release 1.13.0
  • Loading branch information
DonaldRG committed Jun 12, 2023
2 parents a05fa24 + 7cfe846 commit 5206e5b
Show file tree
Hide file tree
Showing 261 changed files with 44,694 additions and 22,256 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ version: 2
jobs:
build-and-test-sdk:
macos:
xcode: "14.0"
xcode: "14.2"
steps:
- checkout
- run:
name: Run Tests iOS 16
command: >
cd Tests/FrameworkTests/Resources && plutil -insert tokenization_vaultId -string ${tokenization_vaultId} MockedData.plist && cd .. && cd .. && cd .. && xcodebuild test -project VGSCollectSDK.xcodeproj -scheme FrameworkTests -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.0' -testPlan FrameworkTests
cd Tests/FrameworkTests/Resources && plutil -insert tokenization_vaultId -string ${tokenization_vaultId} MockedData.plist && plutil -insert vaultID -string ${vaultID} MockedData.plist && cd .. && cd .. && cd .. && xcodebuild test -project VGSCollectSDK.xcodeproj -scheme FrameworkTests -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -testPlan FrameworkTests
build-and-ui-test-demo-app-ios-16-iphone14:
macos:
xcode: "14.0"
xcode: "14.2"
steps:
- checkout
- run:
name: Run UI Tests on iPhone 14 iOS 16.0
name: Run UI Tests on iPhone 14 iOS 16.2
command: >
cd demoapp &&
cd demoapp &&
plutil -insert vaultID -string ${vaultID} UITestsMockedData.plist &&
cd .. &&
pod install &&
xcrun instruments -w "iPhone 14 (16.0) [" || true &&
xcrun instruments -w "iPhone 14 (16.2) [" || true &&
xcodebuild test -workspace demoapp.xcworkspace
-scheme demoappUITests
-sdk iphonesimulator
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.0'
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2'
workflows:
version: 2
Expand Down
31 changes: 30 additions & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,37 @@ custom_categories:
- VGSTextField
- VGSCardTextField
- VGSExpDateTextField
- VGSDateTextField
- VGSCVCTextField
- VGSTextFieldDelegate
- VGSConfiguration
- VGSExpDateConfiguration
- VGSDateConfiguration
- VGSCardHolderNameTokenizationConfiguration
- VGSCardNumberTokenizationConfiguration
- VGSCVCTokenizationConfiguration
- VGSDateTokenizationConfiguration
- VGSExpDateTokenizationConfiguration
- VGSSSNTokenizationConfiguration
- VGSTokenizationConfiguration
- VGSDateConfigurationProtocol
- VGSExpDateConfigurationProtocol
- FieldType
- VGSDateFormat
- VGSDate
- VGSTextFieldInputSource
- name: Tokenization Parameters
children:
- VGSTokenizationParametersProtocol
- VGSCVCTokenizationParameters
- VGSCardHolderNameTokenizationParameters
- VGSCardNumberTokenizationParameters
- VGSDateTokenizationParameters
- VGSExpDateTokenizationParameters
- VGSSSNTokenizationParameters
- VGSTokenizationParameters
- VGSVaultAliasFormat
- VGSVaultStorageType
- name: Card Scan
children:
- VGSCardIOScanController
Expand All @@ -54,10 +80,12 @@ custom_categories:
- State
- SSNState
- CardState
- VGSTextFieldStatePublisher
- VGSResponse
- VGSTokenizationResponse
- VGSCollectRequestOptions
- JsonData
- HTTPMethod
- VGSCollectHTTPMethod
- HTTPHeaders
- name: Payment Cards
children:
Expand All @@ -78,6 +106,7 @@ custom_categories:
- VGSValidationRulePaymentCard
- VGSValidationRuleLuhnCheck
- VGSValidationRuleCardExpirationDate
- VGSValidationRuleDateRange
- CheckSumAlgorithmType
- CardExpDateFormat
- name: Errors
Expand Down
2 changes: 0 additions & 2 deletions Cartfile

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ Use vgsCollect.cleanFiles() to unassign file from associated VGSCollect instance
## Demo Application
Demo application for collecting card data on iOS is <a href="https://github.com/vgs-samples/very-spacy-food-iOS">here</a>.

Also you can check our [payment optimization demo](./demoapp/demoapp/UseCases/PayOptIntegration/) with Payment Orchestration integration.

### Documentation
- SDK Documentation: https://www.verygoodsecurity.com/docs/vgs-collect/ios-sdk
Expand All @@ -451,7 +450,7 @@ VGSAnalyticsClient.shared.shouldCollectAnalytics = false
```

## Dependencies
- iOS 10+
- iOS 12+
- Swift 5
- Optional 3rd party libraries:
- [CardIO](https://github.com/card-io/card.io-iOS-SDK)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import Foundation
#if !COCOAPODS
import VGSCollectSDK
Expand Down
6 changes: 3 additions & 3 deletions Sources/VGSBlinkCardCollector/VGSBlinkCardController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public class VGSBlinkCardController {

/// `VGSBlinkCardControllerDelegate` - handle user interaction with `BlinkCard` scanner.
public var delegate: VGSBlinkCardControllerDelegate? {
set {
scanHandler?.delegate = newValue
}
get {
return scanHandler?.delegate
}
set {
scanHandler?.delegate = newValue
}
}

// MARK: - Initialization
Expand Down
16 changes: 9 additions & 7 deletions Sources/VGSBlinkCardCollector/VGSBlinkCardHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
// VGSBlinkCardCollector
//


import Foundation
#if os(iOS)
import UIKit
#endif

#if canImport(BlinkCard)
import BlinkCard
#if !COCOAPODS
import VGSCollectSDK
#endif
#if os(iOS)
import UIKit
#endif

/// BlinkCard wrapper, manages communication between public API and BlinkCard.
@available(iOS 13.0, *)
Expand Down Expand Up @@ -40,15 +41,15 @@ internal class VGSBlinkCardHandler: NSObject, VGSScanHandlerProtocol {
/// Setup BlinlCard params and present scanner.
func presentScanVC(on viewController: UIViewController, animated: Bool, modalPresentationStyle: UIModalPresentationStyle, completion: (() -> Void)?) {
// Create BlinkCard settings
let settings : MBCBlinkCardOverlaySettings = MBCBlinkCardOverlaySettings()
let settings: MBCBlinkCardOverlaySettings = MBCBlinkCardOverlaySettings()
settings.enableEditScreen = false
// Crate recognizer collection
let recognizerList = [cardRecognizer]
let recognizerCollection : MBCRecognizerCollection = MBCRecognizerCollection(recognizers: recognizerList)
let recognizerCollection: MBCRecognizerCollection = MBCRecognizerCollection(recognizers: recognizerList)
// Create overlay view controller
let blinkCardOverlayViewController = MBCBlinkCardOverlayViewController(settings: settings, recognizerCollection: recognizerCollection, delegate: self)
// Create recognizer view controller with wanted overlay view controller
let recognizerRunneViewController : UIViewController = MBCViewControllerFactory.recognizerRunnerViewController(withOverlayViewController: blinkCardOverlayViewController)!
let recognizerRunneViewController: UIViewController = MBCViewControllerFactory.recognizerRunnerViewController(withOverlayViewController: blinkCardOverlayViewController)!
recognizerRunneViewController.modalPresentationStyle = modalPresentationStyle
self.view = recognizerRunneViewController
// Present the recognizer runner view controller
Expand Down Expand Up @@ -135,3 +136,4 @@ extension VGSBlinkCardHandler: MBCBlinkCardOverlayViewControllerDelegate {
delegate?.userDidCancelScan()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ internal final class VGSCardIODataMapUtils {
/// - scannedDataType: `CradIODataType` object, CardIO data type.
/// - Returns: `String?`, formatted string or `nil`.
internal static func mapCardExpirationData(_ data: VGSCardIOExpirationDate, scannedDataType: CradIODataType) -> String? {
switch scannedDataType {
case .cardNumber, .cvc:
return nil
case .expirationDate:
return mapDefaultExpirationDate(data.month, scannedExpYear: data.year)
case .expirationDateLong:
return mapLongExpirationDate(data.month, scannedExpYear: data.year)
case .expirationMonth:
return mapMonth(data.month)
case .expirationYear:
return mapYear(data.year)
case .expirationYearLong:
return mapYearLong(data.year)
switch scannedDataType {
case .cardNumber, .cvc:
return nil
case .expirationDate:
return mapDefaultExpirationDate(data.month, scannedExpYear: data.year)
case .expirationDateLong:
return mapLongExpirationDate(data.month, scannedExpYear: data.year)
case .expirationMonth:
return mapMonth(data.month)
case .expirationYear:
return mapYear(data.year)
case .expirationYearLong:
return mapYearLong(data.year)
case .expirationDateShortYearThenMonth:
return mapExpirationDateWithShortYearFirst(data.month, scannedExpYear: data.year)
case .expirationDateLongYearThenMonth:
return mapLongExpirationDateWithLongYearFirst(data.month, scannedExpYear: data.year)
}
}
}

// MARK: - Helpers
Expand Down
8 changes: 4 additions & 4 deletions Sources/VGSCardIOCollector/VGSCardIOScanController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public class VGSCardIOScanController {

/// `VGSCardIOScanControllerDelegate` - handle user interaction with `Card.io` scanner
public var delegate: VGSCardIOScanControllerDelegate? {
set {
scanHandler?.delegate = newValue
}
get {
return scanHandler?.delegate
}
set {
scanHandler?.delegate = newValue
}
}

/// Defines preferred `AVCaptureDevice.Position`. Deault is `AVCaptureDevice.Position.unspecified`
Expand All @@ -50,7 +50,7 @@ public class VGSCardIOScanController {

/// Defines preferred language for all strings appearing in the CardIO user interface.
/// If not set, or if set to nil, defaults to the device's current language setting.
public var languageOrLocale: String? = nil {
public var languageOrLocale: String? {
didSet {
scanHandler?.languageOrLocale = languageOrLocale
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/VGSCollectSDK/Core/API/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class APIClient {
}

// Check if routeId is set and should be attached to request url
if case .vaultURL(_) = self.hostURLPolicy,
if case .vaultURL = self.hostURLPolicy,
let routeId = routeId {

guard let newUrl = APIClient.buildVaultURL(tenantId: self.vaultId, regionalEnvironment: self.environment, routeId: routeId) else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

///:nodoc: VGSCollect Form Analytics Details
/// :nodoc: VGSCollect Form Analytics Details
public struct VGSFormAnanlyticsDetails {
public let formId: String
public let tenantId: String
Expand Down
Loading

0 comments on commit 5206e5b

Please sign in to comment.