Skip to content

Commit

Permalink
release version 2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mulp committed Sep 15, 2021
1 parent 3f9908e commit bbd641f
Show file tree
Hide file tree
Showing 23 changed files with 383 additions and 72 deletions.
8 changes: 4 additions & 4 deletions AptoUISDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

Pod::Spec.new do |s|
s.name = "AptoUISDK"
s.version = "2.13.0"
s.version = "2.14.0"
s.summary = "The Apto UI platform iOS SDK."
s.description = <<-DESC
Apto iOS UI SDK provides a UI flow that allows to easily integrate the platform in your app.
DESC
s.homepage = "https://github.com/AptoPayments/apto-ui-sdk-ios.git"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.authors = { "Ivan Oliver" => "ivan@aptopayments.com", "Takeichi Kanzaki" => "takeichi@aptopayments.com" }
s.source = { :git => "https://github.com/AptoPayments/apto-ui-sdk-ios.git", :tag => "2.13.0" }
s.source = { :git => "https://github.com/AptoPayments/apto-ui-sdk-ios.git", :tag => "2.14.0" }

s.platform = :ios
s.ios.deployment_target = '10.0'
Expand All @@ -32,8 +32,8 @@ Pod::Spec.new do |s|
s.resources = ["Pod/Assets/*.png", "Pod/Assets/*.css", "Pod/Localization/*.lproj", "Pod/Assets/*.xcassets", "Pod/Fonts/*.ttf", "Pod/CHANGELOG_ui.md"]

s.frameworks = 'UIKit', 'CoreLocation', 'Accelerate', 'AudioToolbox', 'AVFoundation', 'CoreGraphics', 'CoreMedia', 'CoreVideo', 'Foundation', 'MobileCoreServices', 'OpenGLES', 'QuartzCore', 'Security', 'LocalAuthentication', 'CallKit'
s.dependency 'AptoSDK', '3.5.0'
s.dependency 'AptoPCI', '2.1.0'
s.dependency 'AptoSDK', '3.6.0'
s.dependency 'AptoPCI', '3.0.0'
s.dependency 'SnapKit', '~> 5.0'
s.dependency 'Bond', '~> 7.6'
s.dependency 'GoogleKit', '~> 0.3'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_ui.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## CHANGELOG AptoUISDK

# 2021-09-15 Version 2.14.0
- improvement: improved In-App Provisioning
- improvement: allowed load funds to transfer cents

# 2021-07-09 Version 2.13.0
- feature: add alpha version of In App Card Provisioning. Add a card to Apple Wallet.
- improvement: added Load Funds Disclosure screen
Expand Down
3 changes: 0 additions & 3 deletions Example/Demo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
Expand Down
16 changes: 8 additions & 8 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PODS:
- Alamofire (~> 5.4.0)
- AptoObjCSDK (1.1.0):
- AptoSDK
- AptoPCI (2.1.0)
- AptoSDK (3.5.0):
- AptoPCI (3.0.0)
- AptoSDK (3.6.0):
- Alamofire (~> 5.4.3)
- AlamofireNetworkActivityIndicator (~> 3.1)
- Bond (~> 7.6)
Expand All @@ -17,9 +17,9 @@ PODS:
- PhoneNumberKit (~> 3.2)
- SwiftyJSON (~> 5.0)
- TrustKit (~> 1.6)
- AptoUISDK (2.12.0):
- AptoPCI (= 2.1.0)
- AptoSDK (= 3.5.0)
- AptoUISDK (2.13.0):
- AptoPCI (= 3.0.0)
- AptoSDK (= 3.6.0)
- Bond (~> 7.6)
- Down (~> 0.8.0)
- GoogleKit (~> 0.3)
Expand Down Expand Up @@ -114,9 +114,9 @@ SPEC CHECKSUMS:
AlamofireNetworkActivityIndicator: 6564782bd7b9e6c430ae67d9277af01907b01ca4
AlamofireNetworkActivityLogger: 162ab8aee00e6267a4304d7cc134e13ccfe3bcc5
AptoObjCSDK: 818ed46d0b6328d9ec76f32ab39e51d8ed8dffb1
AptoPCI: 8a85a014534b5d9036170e3698309de4fa51bc88
AptoSDK: 86f48d3afc08271b23261620f2728a4ec57960b6
AptoUISDK: e959de25e2b185f0f5b260fbb5c7e619b6ce4328
AptoPCI: 160923d718ada3991daf867ca7039a2f9801c357
AptoSDK: da16f150f8788a665a7ed8c8e86c28571f8a5427
AptoUISDK: 6aef29cb0e9395c12584396aa94eb163e78f7197
Bond: 87075c7f20f37ea3e73dc7057fce839787bf46eb
Branch: 65d05ffb137ef504777cff6bd4fb6f770f17145a
Differ: 3b6bd78e2b20cc795d9a86f7641d087524e4273e
Expand Down
26 changes: 14 additions & 12 deletions Example/ShiftSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@
D99BDFFC7AD558DB67D945B7 /* CardWaitListModuleTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D99BD37861B13BB4F50A836A /* CardWaitListModuleTest.swift */; };
E068F49835C36AE634935FEA /* Pods_UnitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C626AD8E822159591786DCC3 /* Pods_UnitTests.framework */; };
E5343E1C26341807001007D8 /* CardApplicationStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5343E1B26341807001007D8 /* CardApplicationStorageTests.swift */; };
E53D331926973C7F00A0BE87 /* IAPCardEnrolmentCheckerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E53D331826973C7F00A0BE87 /* IAPCardEnrolmentCheckerTests.swift */; };
E5567DED25C8BC42000E8048 /* AuthenticationTypeHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5567DEC25C8BC42000E8048 /* AuthenticationTypeHelperTests.swift */; };
E559808978340FABA714EBC0 /* Pods_SnapshotTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BA64FF7BC6649A5EE5D70C7 /* Pods_SnapshotTests.framework */; };
E571DB11260DE62600A5C533 /* UIButton+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = E571DB10260DE62600A5C533 /* UIButton+TestHelpers.swift */; };
E571DB16260DE64F00A5C533 /* UIControl+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = E571DB15260DE64F00A5C533 /* UIControl+TestHelpers.swift */; };
E57DF760265CECA000E2A9CC /* ImageCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57DF75F265CECA000E2A9CC /* ImageCacheTests.swift */; };
E5987A88262831D2008CFDBA /* ApplePayIAPStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5987A87262831D2008CFDBA /* ApplePayIAPStorageTests.swift */; };
E59879D426263412008CFDBA /* ApplePayRowItemViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E59879D326263412008CFDBA /* ApplePayRowItemViewTests.swift */; };
E5987A3D2627287E008CFDBA /* ApplePayButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5987A3C2627287E008CFDBA /* ApplePayButtonTests.swift */; };
E5987A88262831D2008CFDBA /* ApplePayIAPStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5987A87262831D2008CFDBA /* ApplePayIAPStorageTests.swift */; };
Expand Down Expand Up @@ -577,11 +577,11 @@
D99BDFB8083D731485D31770 /* SetPinInteractorTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetPinInteractorTest.swift; sourceTree = "<group>"; };
E50F539025D15C81002726C4 /* CardLoaderSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardLoaderSpy.swift; sourceTree = "<group>"; };
E5343E1B26341807001007D8 /* CardApplicationStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardApplicationStorageTests.swift; sourceTree = "<group>"; };
E53D331826973C7F00A0BE87 /* IAPCardEnrolmentCheckerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAPCardEnrolmentCheckerTests.swift; sourceTree = "<group>"; };
E5567DEC25C8BC42000E8048 /* AuthenticationTypeHelperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationTypeHelperTests.swift; sourceTree = "<group>"; };
E571DB10260DE62600A5C533 /* UIButton+TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+TestHelpers.swift"; sourceTree = "<group>"; };
E571DB15260DE64F00A5C533 /* UIControl+TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIControl+TestHelpers.swift"; sourceTree = "<group>"; };
E57DF75F265CECA000E2A9CC /* ImageCacheTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCacheTests.swift; sourceTree = "<group>"; };
E5987A87262831D2008CFDBA /* ApplePayIAPStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplePayIAPStorageTests.swift; sourceTree = "<group>"; };
E59879D326263412008CFDBA /* ApplePayRowItemViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplePayRowItemViewTests.swift; sourceTree = "<group>"; };
E5987A3C2627287E008CFDBA /* ApplePayButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplePayButtonTests.swift; sourceTree = "<group>"; };
E5987A87262831D2008CFDBA /* ApplePayIAPStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplePayIAPStorageTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1683,6 +1683,7 @@
isa = PBXGroup;
children = (
E5987BB32629C692008CFDBA /* ApplePayIAPViewControllerTests.swift */,
E53D331826973C7F00A0BE87 /* IAPCardEnrolmentCheckerTests.swift */,
);
path = ApplePay;
sourceTree = "<group>";
Expand Down Expand Up @@ -2309,6 +2310,7 @@
D99BD6D66DA5D930264CBC6A /* ConfigurationStorageTestDoubles.swift in Sources */,
D99BDD46695FD43EE8DA3570 /* UserTokenStorageTestDoubles.swift in Sources */,
33F840CC246A930B00D9DCB8 /* DataPointFormatterTest.swift in Sources */,
E53D331926973C7F00A0BE87 /* IAPCardEnrolmentCheckerTests.swift in Sources */,
3C13E531238FCEF200C9F0D3 /* Authenticator.swift in Sources */,
D99BD9F9C025FE53F050804E /* MonthlyStatementReportTest.swift in Sources */,
3C92D217234623D000C48D90 /* CardSettingsModuleTest.swift in Sources */,
Expand Down Expand Up @@ -2696,7 +2698,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = QWTPF9R98K;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -2722,7 +2724,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Local;
};
Expand Down Expand Up @@ -2800,7 +2802,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = "";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
Expand All @@ -2827,7 +2829,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Sbx;
};
Expand Down Expand Up @@ -2905,7 +2907,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -2933,7 +2935,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Dev;
};
Expand Down Expand Up @@ -3011,7 +3013,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = QWTPF9R98K;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
Expand All @@ -3037,7 +3039,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Stg;
};
Expand Down Expand Up @@ -3115,7 +3117,7 @@
CODE_SIGN_IDENTITY = "Apple Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = QWTPF9R98K;
ENABLE_TESTABILITY = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -3144,7 +3146,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = 1;
};
name = Prd;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//
// IAPCardEnrolmentCheckerTests.swift
// UnitTests
//
// Created by Fabio Cuomo on 8/7/21.
// Copyright © 2021 CocoaPods. All rights reserved.
//

import XCTest
import AptoUISDK

class IAPCardEnrolmentCheckerTests: XCTestCase {

let EnrolledCard = "1111"
let NotEnrolledCard = "4444"

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

func test_isCardEnrolledInPhoneWallet_returnsTrueIfTheCardIsEnrolled() {
let library = makePassLibrary(items: ["1111", "2222"])
let session = MockWatchConnectingSession(supported: true, paired: false)

let sut = makeSUT(passKitAvailable: true, library: library, session: session)

XCTAssertTrue(sut.isCardEnrolledInPhoneWallet(lastFourDigits: EnrolledCard))
}

func test_isCardEnrolledInPhoneWallet_returnsFalseIfTheCardIsNotEnrolled() {
let pass_1 = PassLibraryItem(cardLastFourDigits: "1111", deviceAccountIdentifier: "abc123")
let pass_2 = PassLibraryItem(cardLastFourDigits: "2222", deviceAccountIdentifier: "abc123")
let library = [pass_1, pass_2]
let manager = IAPCardEnrolmentCheckerStub(with: true, library: library)

let checker = IAPCardEnrolmentChecker(with: manager)

XCTAssertFalse(checker.isCardEnrolledInPhoneWallet(lastFourDigits: "4444"))
}

func test_isCardEnrolledInPairedWatchDevice_returnsTrueIfTheCardIsEnrolled() {
let pass_1 = PassLibraryItem(cardLastFourDigits: "1111", deviceAccountIdentifier: "abc123")
let pass_2 = PassLibraryItem(cardLastFourDigits: "2222", deviceAccountIdentifier: "abc123")
let library = [pass_1, pass_2]
let manager = IAPCardEnrolmentCheckerStub(with: true, library: library)
let session = MockWatchConnectingSession(supported: true, paired: true)

let checker = IAPCardEnrolmentChecker(with: manager, session: session)

XCTAssertTrue(checker.isCardEnrolledInPhoneWallet(lastFourDigits: "1111"))
}

func test_isCardEnrolledInPairedWatchDevice_returnsFalseIfTheCardIsNotEnrolled() {
let pass_1 = PassLibraryItem(cardLastFourDigits: "1111", deviceAccountIdentifier: "abc123")
let pass_2 = PassLibraryItem(cardLastFourDigits: "2222", deviceAccountIdentifier: "abc123")
let library = [pass_1, pass_2]
let manager = IAPCardEnrolmentCheckerStub(with: true, library: library)
let session = MockWatchConnectingSession(supported: true, paired: true)

let checker = IAPCardEnrolmentChecker(with: manager, session: session)

XCTAssertFalse(checker.isCardEnrolledInPhoneWallet(lastFourDigits: "4444"))
}

private func makeSUT(passKitAvailable: Bool, library: [PassLibraryItem], session: MockWatchConnectingSession) -> IAPCardEnrolmentChecker {
let manager = IAPCardEnrolmentCheckerStub(with: passKitAvailable, library: library)
return IAPCardEnrolmentChecker(with: manager, session: session)
}

private func makeItems(lastFourDigits: String) -> PassLibraryItem {
PassLibraryItem(cardLastFourDigits: lastFourDigits, deviceAccountIdentifier: "abc123")
}

private func makePassLibrary(items: [String]) -> [PassLibraryItem] {
items.map(makeItems(lastFourDigits:))
}
}


private class IAPCardEnrolmentCheckerStub: InAppPassLibrary {
private let passkitAvailable: Bool
private let library: [PassLibraryItem]

init(with available: Bool, library: [PassLibraryItem]) {
self.passkitAvailable = available
self.library = library
}

func isPassKitAvailable() -> Bool {
passkitAvailable
}

func passes() -> [PassLibraryItem] {
library
}

func remotePasses() -> [PassLibraryItem] {
library
}
}

private class MockWatchConnectingSession: WatchConnectingSession {
private let paired: Bool
private let supported: Bool

init(supported: Bool, paired: Bool) {
self.paired = paired
self.supported = supported
}

var isSupported: Bool {
supported
}

var isPaired: Bool {
paired
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CardSettingsPresenterTest: XCTestCase {
private let card = ModelDataProvider.provider.card
private let config = CardSettingsPresenterConfig(cardholderAgreement: nil, privacyPolicy: nil, termsAndCondition: nil,
faq: nil, exchangeRates: nil, showDetailedCardActivity: true,
showMonthlyStatements: true)
showMonthlyStatements: true, iapRowTitle: "")
private let emailRecipients = ["email@aptopayments.com"]
private let uiConfig = ModelDataProvider.provider.uiConfig
private let view = CardSettingsViewSpy()
Expand Down Expand Up @@ -146,7 +146,7 @@ class CardSettingsPresenterTest: XCTestCase {
func testViewLoadedWithoutShowDetailedCardActivityDoNotShowDetailedCardActivity() {
// Given
let config = CardSettingsPresenterConfig(cardholderAgreement: nil, privacyPolicy: nil, termsAndCondition: nil,
faq: nil, exchangeRates: nil, showDetailedCardActivity: false, showMonthlyStatements: true)
faq: nil, exchangeRates: nil, showDetailedCardActivity: false, showMonthlyStatements: true, iapRowTitle: "")
setUpSUT(card: card, config: config)

// When
Expand All @@ -167,7 +167,7 @@ class CardSettingsPresenterTest: XCTestCase {
func testViewLoadedWithoutShowMonthlyStatementsDoNotShowMonthlyStatements() {
// Given
let config = CardSettingsPresenterConfig(cardholderAgreement: nil, privacyPolicy: nil, termsAndCondition: nil,
faq: nil, exchangeRates: nil, showDetailedCardActivity: false, showMonthlyStatements: false)
faq: nil, exchangeRates: nil, showDetailedCardActivity: false, showMonthlyStatements: false, iapRowTitle: "")
setUpSUT(card: card, config: config)

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ class CardSettingsPresenterSpy: CardSettingsPresenterProtocol {
func monthlyStatementsTapped() {
monthlyStatementsTappedCalled = true
}

func iapRowTitle() -> String { return "" }
}

class CardSettingsViewSpy: ViewControllerSpy, CardSettingsViewProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import Foundation

import AptoSDK

final class ApplePayIAPUIComposer {
public final class ApplePayIAPUIComposer {
private init() {}
public typealias ContinueCompletion = (() -> Void)
public typealias IAPCompletion = (() -> Void)

public static func composedWith(cardId: String,
Expand Down

0 comments on commit bbd641f

Please sign in to comment.