Skip to content

Commit 1d89019

Browse files
authored
Development (#82)
- Enhancements to Add Transfer Method - Added support to the following: * List Prepaid Card Receipts * List User Receipts
1 parent d85708d commit 1d89019

File tree

124 files changed

+14682
-2318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+14682
-2318
lines changed

.slather.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
coverage_service: coveralls
2+
xcodeproj: HyperwalletUISDK.xcodeproj
3+
scheme: HyperwalletUISDK
4+
ignore:
5+
- Tests/*
6+
- UITests/*
7+
- Demo/*
8+
- Sources/Resources/*
9+
- Sources/Extensions/*
10+
- Sources/Generics/*
11+
- Sources/Localization/*
12+
- Sources/Helper/*
13+
- Sources/View/*
14+
- Sources/TransferMethod/*Controller.swift
15+
- Sources/TransferMethod/*Cell.swift
16+
- Sources/TransferMethod/AddTransferMethodSectionData.swift
17+
- Sources/Receipt/*Controller.swift
18+
- Sources/Receipt/*Cell.swift
19+
- Sources/HyperwalletUI.swift

.travis.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: swift
2-
osx_image: xcode10.1
2+
osx_image: xcode10.2
33
os: osx
44
branches:
55
only:
@@ -16,9 +16,10 @@ env:
1616
- IOS_UI_TESTS_SCHEME="Demo"
1717

1818
matrix:
19-
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_FRAMEWORK_SCHEME" platform='iOS Simulator' configuration="DEBUG" code_coverage="YES"
20-
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO"
21-
- ios_version='11.1' ios_device='iPhone 7' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO"
19+
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_FRAMEWORK_SCHEME" platform='iOS Simulator' configuration="Debug" code_coverage="YES" only_active_arch="YES"
20+
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO" only_active_arch="NO"
21+
- ios_version='11.1' ios_device='iPhone 7' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO" only_active_arch="NO"
22+
2223
before_install:
2324
# Boot the emulator by ID
2425
- |
@@ -28,7 +29,8 @@ before_install:
2829
- xcrun simctl list
2930
# Update the brew and build dependencies tools
3031
- brew outdated carthage || brew upgrade carthage
31-
- Carthage update --use-submodules --platform iOS
32+
- Carthage update --platform iOS --cache-builds
33+
- gem i slather
3234
# Force to update the Swiftlint to the last stable version
3335
- brew outdated swiftlint || brew upgrade swiftlint
3436
# Print the booted emulator
@@ -43,12 +45,14 @@ script: |
4345
destination="platform=$platform,OS=$ios_version,name=$ios_device"
4446
4547
# Build and test Framework in Debug
46-
xcodebuild clean build test -project "$PROJECT" \
48+
xcodebuild -enableCodeCoverage "$code_coverage" clean build test -project "$PROJECT" \
4749
-scheme "$scheme" \
4850
-destination "$destination" \
49-
-derivedDataPath Build/ \
50-
-enableCodeCoverage "$code_coverage" \
51-
-configuration "$configuration" ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
51+
-configuration "$configuration" ONLY_ACTIVE_ARCH="$only_active_arch" ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
5252
5353
# Lint - Add `--strict` to fail for warning and violation
5454
swiftlint lint --reporter json
55+
after_success:
56+
if [ "$code_coverage" == "YES" ]; then
57+
slather;
58+
fi

CHANGELOG.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
Changelog
22
=========
33

4-
1.0.0-beta01
4+
[1.0.0-beta01](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta01)
55
-------------------
66
- Initial beta release of Hyperwallet UI SDK for iOS. This beta release has the following functionality:
7-
* UI components to create Bank Account and Bank Card for United States (USD)
8-
* UI components to list and deactivate accounts
7+
* UI components to create Bank Account and Bank Card for United States (USD)
8+
* UI components to list and deactivate accounts
99

1010

11-
1.0.0-beta02
11+
[1.0.0-beta02](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta02)
1212
-------------------
13-
* Added PayPal as a Transfer method
14-
* Defaulted in Transfer Method selection to country of User
13+
- Added PayPal as a Transfer method
14+
- Defaulted in Transfer Method selection to country of User
15+
16+
17+
[1.0.0-beta03](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta03)
18+
-------------------
19+
- Enhancements to Add Transfer Method
20+
- Added support to the following:
21+
* List Prepaid Card Receipts
22+
* List User Receipts

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta02"
1+
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta03"

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github "JanGorman/Hippolyte" "0.6.0"
2-
github "httpswift/swifter" ~> 1.4.6
2+
github "httpswift/swifter" "1.4.6"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "JanGorman/Hippolyte" "0.6.0"
22
github "httpswift/swifter" "1.4.6"
3-
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta02"
3+
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta03"

Demo/AppDelegate.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2727
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2828
// Override point for customization after application launch.
2929

30-
// Set the default tint color
31-
window?.tintColor = Theme.Button.color
30+
//ThemeManager.applyWhiteTheme()
31+
ThemeManager.applyTheme()
32+
3233
// Avoid to display a black area during the view transaction in the UINavigationBar.
3334
window?.backgroundColor = Theme.ViewController.backgroundColor
34-
ThemeManager.applyTheme()
35+
// Set the default tint color
36+
window?.tintColor = Theme.Button.color
37+
3538
return true
3639
}
3740
}

Demo/Info.plist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0.0-beta02</string>
20+
<string>1.0.0-beta03</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.0.0-beta02</string>
22+
<string>1.0.0-beta03</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>NSAppTransportSecurity</key>
@@ -29,6 +29,8 @@
2929
<key>NSAllowsLocalNetworking</key>
3030
<true/>
3131
</dict>
32+
<key>PREPAID_CARD_TOKEN</key>
33+
<string>$(PREPAID_CARD_TOKEN)</string>
3234
<key>UILaunchStoryboardName</key>
3335
<string>LaunchScreen</string>
3436
<key>UIMainStoryboardFile</key>

Demo/IntegratorAuthenticationProvider.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public struct IntegratorAuthenticationProvider: HyperwalletAuthenticationTokenPr
2929
url = "\(baseUrl)/rest/v3/users/\(userToken)/authentication-token"
3030
self.session = IntegratorAuthenticationProvider.createUrlSession(username: user, password: password)
3131
}
32+
3233
public func retrieveAuthenticationToken(completionHandler: @escaping
3334
HyperwalletAuthenticationTokenProvider.CompletionHandler) {
3435
var request = URLRequest(url: URL(string: url)!)

Demo/ViewController.swift

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@ enum HyperwalletConstants {
4040

4141
//swiftlint:disable force_cast
4242
class ViewController: UITableViewController {
43-
enum Example: Int {
44-
static let count = 5
43+
enum Example: Int, CaseIterable {
4544
case paymentDetails
4645
case listTransferMethod
46+
case selectTransferMethod
4747
case addTransferMethod
48+
case userReceipts
49+
case prepaidCardReceipts
4850
case transferFunds
4951

5052
var title: String {
5153
switch self {
5254
case .paymentDetails: return "Payment Details"
5355
case .listTransferMethod: return "List Transfer Methods"
56+
case .selectTransferMethod: return "Select Transfer Method"
5457
case .addTransferMethod: return "Add Transfer Method"
58+
case .userReceipts: return "List User Receipts"
59+
case .prepaidCardReceipts: return "List Prepaid Card Receipts"
5560
case .transferFunds: return "Transfer Funds"
5661
}
5762
}
@@ -60,7 +65,10 @@ class ViewController: UITableViewController {
6065
switch self {
6166
case .paymentDetails: return "Configure how you want to get paid"
6267
case .listTransferMethod: return "List all the Transfer Methods"
63-
case .addTransferMethod: return "Add Transfer Methods"
68+
case .selectTransferMethod: return "Select the Transfer Method you want to add"
69+
case .addTransferMethod: return "Add the default Transfer Method"
70+
case .userReceipts: return "List User Receipts"
71+
case .prepaidCardReceipts: return "List Prepaid Card Receipts"
6472
case .transferFunds: return "Transfer Funds"
6573
}
6674
}
@@ -123,7 +131,7 @@ class ViewController: UITableViewController {
123131
}
124132

125133
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
126-
return Example.count
134+
return Example.allCases.count
127135
}
128136

129137
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
@@ -137,19 +145,44 @@ class ViewController: UITableViewController {
137145

138146
switch example {
139147
case .listTransferMethod:
140-
let viewController = HyperwalletUI.shared.listTransferMethodViewController()
148+
let viewController = HyperwalletUI.shared.listTransferMethodTableViewController()
141149
navigationController?.pushViewController(viewController, animated: true)
142150

143-
case .addTransferMethod:
144-
let viewController = HyperwalletUI.shared.selectTransferMethodTypeViewController()
151+
case .selectTransferMethod:
152+
let viewController = HyperwalletUI.shared.selectTransferMethodTypeTableViewController()
145153
viewController.createTransferMethodHandler = {
146154
(transferMethod: HyperwalletTransferMethod) -> Void in
147155
self.didCreateTransferMethod(transferMethod: transferMethod)
148156
}
149157
navigationController?.pushViewController(viewController, animated: true)
150158

159+
case .addTransferMethod:
160+
if let country = ProcessInfo.processInfo.environment["COUNTRY"],
161+
let currency = ProcessInfo.processInfo.environment["CURRENCY"],
162+
let accountType = ProcessInfo.processInfo.environment["ACCOUNT_TYPE"],
163+
let profileType = ProcessInfo.processInfo.environment["PROFILE_TYPE"] {
164+
let viewController = HyperwalletUI.shared.addTransferMethodTableViewController(
165+
country, currency, profileType, accountType)
166+
navigationController?.pushViewController(viewController, animated: true)
167+
} else {
168+
let viewController = HyperwalletUI.shared.addTransferMethodTableViewController(
169+
"US", "USD", "INDIVIDUAL", "BANK_ACCOUNT")
170+
navigationController?.pushViewController(viewController, animated: true)
171+
}
172+
173+
case .userReceipts:
174+
let viewController = HyperwalletUI.shared.listUserReceiptTableViewController()
175+
navigationController?.pushViewController(viewController, animated: true)
176+
177+
case .prepaidCardReceipts:
178+
let prepaidCardToken = Bundle.main.infoDictionary!["PREPAID_CARD_TOKEN"] as! String
179+
let viewController = HyperwalletUI.shared.listPrepaidCardReceiptTableViewController(
180+
prepaidCardToken)
181+
182+
navigationController?.pushViewController(viewController, animated: true)
183+
151184
default:
152-
let viewController = HyperwalletUI.shared.listTransferMethodViewController()
185+
let viewController = HyperwalletUI.shared.listTransferMethodTableViewController()
153186
navigationController?.pushViewController(viewController, animated: true)
154187
}
155188
}

0 commit comments

Comments
 (0)