Skip to content

Commit

Permalink
Public release 1.9.7
Browse files Browse the repository at this point in the history
Public release 1.9.7
  • Loading branch information
EugeneIOs authored Mar 18, 2022
2 parents cab6a1c + 37c1cdf commit 84c136c
Show file tree
Hide file tree
Showing 240 changed files with 12,237 additions and 932 deletions.
6 changes: 3 additions & 3 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## Migration Guides

### Migrating from versions < v1.8.0
### Migrating from versions < v1.9.7
#### Swift PM modules updates.
`VGSPaymentCards` moved to separate module. For SDK integration with Swift Package Manager you need to import `VGSPaymentCards` module to each source file where you edit card brands.
For SDK integration with Swift Package Manager you don't need to import `VGSPaymentCards` module.

Before:

```
import VGSCollectSDK
import VGSPaymentCards
...
VGSPaymentCards.visa.regex = "\\d*$"
Expand All @@ -16,7 +17,6 @@ VGSPaymentCards.visa.regex = "\\d*$"
Now:
```
import VGSCollectSDK
import VGSPaymentCards
...
VGSPaymentCards.visa.regex = "\\d*$"
Expand Down
6 changes: 1 addition & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "VGSCollectSDK",
targets: ["VGSCollectSDK", "VGSPaymentCards"]),
targets: ["VGSCollectSDK"]),
.library(
name: "VGSCardScanCollector",
targets: ["VGSCardScanCollector"]
Expand All @@ -38,14 +38,10 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "VGSCollectSDK",
dependencies: ["VGSPaymentCards"],
exclude: [
"Info.plist",
"VGSCollectSDK.h"
]),
.target(name: "VGSPaymentCards",
path: "Sources/VGSPaymentCards/"
),
.testTarget(
name: "FrameworkTests",
dependencies: ["VGSCollectSDK"],
Expand Down
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Use your `<vaultId>` to initialize VGSCollect instance. You can get it in your [


### Scan Credit Card Data
VGS Collect SDK provides several card scan solutions for the Payment Card Industry to help protect your businesses and the sensitive information of your consumers. It's required to use only Scan modules provided by VGS, which are audited by VGS PCI requirements.
VGS Collect SDK provides optional card scan solution. It's required to use only Scan modules provided by VGS, which are audited by VGS PCI requirements.

#### Integrate with Cocoapods

Expand All @@ -215,33 +215,13 @@ pod 'VGSCollectSDK'

# Add CardIO module to use Card.io as scan provider
pod 'VGSCollectSDK/CardIO'

# Add CardScan module to use CardScan(Bouncer) as scan provider
pod 'VGSCollectSDK/CardScan'
```
#### Integrate with Swift Package Manager

Starting with the 1.7.4 release, `VGSCollectSDK` also supports [CardScan](https://github.com/getbouncer/cardscan-ios) integration via Swift PM.

To use **CardScan** add `VGSCollectSDK`, `VGSCardScanCollector` packages to your target.

Starting with the 1.7.11 release, `VGSCollectSDK` supports [CardIO](https://github.com/verygoodsecurity/card.io-iOS-source) integration via Swift PM.

To use **CardIO** add `VGSCollectSDK`, `VGSCardIOCollector` packages to your target.

#### Integrate with Carthage

Carthage users should point to `VGSCollectSDK` repository and use next generated framework:

- To use **Card.io**: `VGSCollectSDK`, `VGSCardIOCollector`, and `CardIO`. In your file add `import VGSCardIOCollector`.
- To use **Card Scan**: `VGSCollectSDK`, `VGSCardScanCollector`, and `CardScan`. In your file add `import VGSCardScanCollector`.

Other submodules can safely be deleted from Carthage Build folder.

> NOTE: At this time, **Carthage** does not provide a way to build only specific repository submodules. All submodules and their dependencies will be built by default. However you can include into your project only submodules that you need.
> NOTE: For **Carthage** users CardScan available only with version 1.0.5048. Use **CocoaPods** or **Swift Package Manager** integration for the latest CardScan version. CardScan supports only **CocoaPods** or **Swift Package Manager** now.
#### Code Example

<table>
Expand Down Expand Up @@ -473,7 +453,6 @@ VGSAnalyticsClient.shared.shouldCollectAnalytics = false
- Swift 5
- Optional 3rd party libraries:
- [CardIO](https://github.com/card-io/card.io-iOS-SDK)
- [Card Scan(Bouncer)](https://github.com/getbouncer/cardscan-ios)

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ extension VGSPaymentCards.CardBrand {
return [3]
}
}


/// no:doc
public var cvcFormatPattern: String {
var maxLength = 0
if let cardBrand = VGSPaymentCards.availableCardBrands.first(where: { $0.brand == self }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ import Foundation
import UIKit
#endif

/// no:doc
extension VGSPaymentCards.CardBrand {
static var defaultUnknownBrandIcon = UIImage(named: "unknown", in: AssetsBundle.main.iconBundle, compatibleWith: nil)

static var defaultCVCIcon3Digits = UIImage(named: "cvc3", in: AssetsBundle.main.iconBundle, compatibleWith: nil)

static var defaultCVCIcon4Digits = UIImage(named: "cvc4", in: AssetsBundle.main.iconBundle, compatibleWith: nil)


/// no:doc
public var brandIcon: UIImage? {
return VGSPaymentCards.availableCardBrands.first(where: { $0.brand == self })?.brandIcon ?? VGSPaymentCards.unknown.brandIcon
}


/// no:doc
public var cvcIcon: UIImage? {
return VGSPaymentCards.availableCardBrands.first(where: { $0.brand == self })?.cvcIcon ?? VGSPaymentCards.unknown.cvcIcon
}

/// no:doc
var defaultBrandIcon: UIImage? {
let bundle = AssetsBundle.main.iconBundle

Expand Down Expand Up @@ -64,7 +68,8 @@ extension VGSPaymentCards.CardBrand {
}
return resultIcon
}


/// no:doc
var defaultCVCIcon: UIImage? {
var resultIcon: UIImage?
switch self {
Expand All @@ -77,10 +82,12 @@ extension VGSPaymentCards.CardBrand {
}
}

/// no:doc
internal class AssetsBundle {
static var main = AssetsBundle()
var iconBundle: Bundle?


/// no:doc
init() {
// Identify bundle for SPM.
#if SWIFT_PACKAGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import Foundation
/// - Allows to add Custom Payment Cards Models
/// - Allows to edit Unknown Payment Cards Models(brands not defined by SDK and Developer)
public class VGSPaymentCards {


/// no:doc
private init() {}

// MARK: - CardBrand Enum Cases
Expand Down Expand Up @@ -128,6 +129,8 @@ public class VGSPaymentCards {
}

// MARK: - Attributes

/// no:doc
public extension VGSPaymentCards.CardBrand {

/// String representation of `VGSPaymentCards.CardBrand` enum values.
Expand Down Expand Up @@ -165,12 +168,15 @@ public extension VGSPaymentCards.CardBrand {
}
}

/// no:doc
public extension VGSPaymentCards {


/// no:doc
static func getCardModelFromAvailableModels(brand: VGSPaymentCards.CardBrand) -> VGSPaymentCardModelProtocol? {
return Self.availableCardBrands.first(where: { $0.brand == brand})
}

/// no:doc
static func detectCardBrandFromAvailableCards(input: String) -> VGSPaymentCards.CardBrand {
for cardModel in Self.availableCardBrands {
let predicate = NSPredicate(format: "SELF MATCHES %@", cardModel.regex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "automatic"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import Foundation
#if os(iOS)
import UIKit
#endif
#if !COCOAPODS
import VGSPaymentCards
#endif


/// An object that describes `VGSTextField` state. State attributes are read-only.
public class State {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#if os(iOS)
import UIKit
#endif
#if !COCOAPODS
import VGSPaymentCards
#endif

/// An object that displays an editable text area. Can be use instead of a `VGSTextField` when need to show CVC/CVV images for credit card brands.
public final class VGSCVCTextField: VGSTextField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#if os(iOS)
import UIKit
#endif
#if !COCOAPODS
import VGSPaymentCards
#endif

/// An object that displays an editable text area. Can be use instead of a `VGSTextField` when need to detect and show credit card brand images.
public final class VGSCardTextField: VGSTextField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
//

import Foundation
#if !COCOAPODS
import VGSPaymentCards
#endif

/// Handle cvc field type
internal extension VGSTextField {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#if os(iOS)
import UIKit
#endif
#if !COCOAPODS
import VGSPaymentCards
#endif

/// An object that displays an editable text area in user interface.
public class VGSTextField: UIView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
//

import Foundation
#if !COCOAPODS
import VGSPaymentCards
#endif

/**
Validate input in scope of matching Luhn algorithm.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
//

import Foundation
#if !COCOAPODS
import VGSPaymentCards
#endif

/**
Validate input in scope of matching supported card brands, available lengths and checkSum algorithms.
Supports optional validation of cards that are not defined in SDK - `CardBrand.unknown`.
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.9.6"
static let vgsCollectVersion: String = "1.9.7"
}

extension Dictionary {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion Tests/FrameworkTests/Card Brand Tests/CardBrandTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import VGSCollectSDK
@testable import VGSPaymentCards

class CardBrandTest: VGSCollectBaseTestCase {
var storage: VGSCollect!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import VGSCollectSDK
@testable import VGSPaymentCards

class PaymentCardsTest: VGSCollectBaseTestCase {
var collector: VGSCollect!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
//

import Foundation
@testable import VGSPaymentCards
import XCTest
@testable import VGSCollectSDK

extension VGSPaymentCards.CardBrand {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import XCTest
@testable import VGSCollectSDK
@testable import VGSPaymentCards

class FilePickerTests: VGSCollectBaseTestCase {
var vgsForm: VGSCollect!
var filePicker: VGSFilePickerController!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import VGSCollectSDK
@testable import VGSPaymentCards

class CardTextFieldTests: VGSCollectBaseTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import XCTest
@testable import VGSCollectSDK
@testable import VGSPaymentCards

class LuhnTests: VGSCollectBaseTestCase {
var textField: VGSTextField!
Expand Down
15 changes: 5 additions & 10 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.9.6'
spec.version = '1.9.7'
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 @@ -19,18 +19,13 @@ Pod::Spec.new do |spec|
spec.requires_arc = true

spec.default_subspec = 'Core'

spec.subspec 'PaymentCards' do |pc|
pc.source_files = "Sources/VGSPaymentCards", "Sources/VGSPaymentCards/**/*.{swift}", "Sources/VGSPaymentCards/**/*.{h, m}"
pc.resource_bundles = {
'CardIcon' => ['Sources/VGSPaymentCards/Resources/*']
}
end


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.dependency "VGSCollectSDK/PaymentCards"
core.resource_bundles = {
'CardIcon' => ['Sources/VGSCollectSDK/Resources/*']
}
end

spec.subspec 'CardScan' do |cardscan|
Expand Down
Loading

0 comments on commit 84c136c

Please sign in to comment.