Skip to content

Commit

Permalink
Development (#82)
Browse files Browse the repository at this point in the history
- Enhancements to Add Transfer Method
- Added support to the following:
    * List Prepaid Card Receipts
    * List User Receipts
  • Loading branch information
jsaini-hw authored Jul 11, 2019
1 parent d85708d commit 1d89019
Show file tree
Hide file tree
Showing 124 changed files with 14,682 additions and 2,318 deletions.
19 changes: 19 additions & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
coverage_service: coveralls
xcodeproj: HyperwalletUISDK.xcodeproj
scheme: HyperwalletUISDK
ignore:
- Tests/*
- UITests/*
- Demo/*
- Sources/Resources/*
- Sources/Extensions/*
- Sources/Generics/*
- Sources/Localization/*
- Sources/Helper/*
- Sources/View/*
- Sources/TransferMethod/*Controller.swift
- Sources/TransferMethod/*Cell.swift
- Sources/TransferMethod/AddTransferMethodSectionData.swift
- Sources/Receipt/*Controller.swift
- Sources/Receipt/*Cell.swift
- Sources/HyperwalletUI.swift
22 changes: 13 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: swift
osx_image: xcode10.1
osx_image: xcode10.2
os: osx
branches:
only:
Expand All @@ -16,9 +16,10 @@ env:
- IOS_UI_TESTS_SCHEME="Demo"

matrix:
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_FRAMEWORK_SCHEME" platform='iOS Simulator' configuration="DEBUG" code_coverage="YES"
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO"
- ios_version='11.1' ios_device='iPhone 7' scheme="$IOS_UI_TESTS_SCHEME" platform='iOS Simulator' configuration="XCUITest" code_coverage="NO"
- ios_version='12.1' ios_device='iPhone XR' scheme="$IOS_FRAMEWORK_SCHEME" platform='iOS Simulator' configuration="Debug" code_coverage="YES" only_active_arch="YES"
- 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"
- 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"

before_install:
# Boot the emulator by ID
- |
Expand All @@ -28,7 +29,8 @@ before_install:
- xcrun simctl list
# Update the brew and build dependencies tools
- brew outdated carthage || brew upgrade carthage
- Carthage update --use-submodules --platform iOS
- Carthage update --platform iOS --cache-builds
- gem i slather
# Force to update the Swiftlint to the last stable version
- brew outdated swiftlint || brew upgrade swiftlint
# Print the booted emulator
Expand All @@ -43,12 +45,14 @@ script: |
destination="platform=$platform,OS=$ios_version,name=$ios_device"
# Build and test Framework in Debug
xcodebuild clean build test -project "$PROJECT" \
xcodebuild -enableCodeCoverage "$code_coverage" clean build test -project "$PROJECT" \
-scheme "$scheme" \
-destination "$destination" \
-derivedDataPath Build/ \
-enableCodeCoverage "$code_coverage" \
-configuration "$configuration" ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
-configuration "$configuration" ONLY_ACTIVE_ARCH="$only_active_arch" ENABLE_TESTABILITY=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
# Lint - Add `--strict` to fail for warning and violation
swiftlint lint --reporter json
after_success:
if [ "$code_coverage" == "YES" ]; then
slather;
fi
20 changes: 14 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
Changelog
=========

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


1.0.0-beta02
[1.0.0-beta02](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta02)
-------------------
* Added PayPal as a Transfer method
* Defaulted in Transfer Method selection to country of User
- Added PayPal as a Transfer method
- Defaulted in Transfer Method selection to country of User


[1.0.0-beta03](https://github.com/hyperwallet/hyperwallet-ios-ui-sdk/releases/tag/1.0.0-beta03)
-------------------
- Enhancements to Add Transfer Method
- Added support to the following:
* List Prepaid Card Receipts
* List User Receipts
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta02"
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta03"
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "JanGorman/Hippolyte" "0.6.0"
github "httpswift/swifter" ~> 1.4.6
github "httpswift/swifter" "1.4.6"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "JanGorman/Hippolyte" "0.6.0"
github "httpswift/swifter" "1.4.6"
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta02"
github "hyperwallet/hyperwallet-ios-sdk" "1.0.0-beta03"
9 changes: 6 additions & 3 deletions Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

// Set the default tint color
window?.tintColor = Theme.Button.color
//ThemeManager.applyWhiteTheme()
ThemeManager.applyTheme()

// Avoid to display a black area during the view transaction in the UINavigationBar.
window?.backgroundColor = Theme.ViewController.backgroundColor
ThemeManager.applyTheme()
// Set the default tint color
window?.tintColor = Theme.Button.color

return true
}
}
6 changes: 4 additions & 2 deletions Demo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0-beta02</string>
<string>1.0.0-beta03</string>
<key>CFBundleVersion</key>
<string>1.0.0-beta02</string>
<string>1.0.0-beta03</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand All @@ -29,6 +29,8 @@
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>PREPAID_CARD_TOKEN</key>
<string>$(PREPAID_CARD_TOKEN)</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
1 change: 1 addition & 0 deletions Demo/IntegratorAuthenticationProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public struct IntegratorAuthenticationProvider: HyperwalletAuthenticationTokenPr
url = "\(baseUrl)/rest/v3/users/\(userToken)/authentication-token"
self.session = IntegratorAuthenticationProvider.createUrlSession(username: user, password: password)
}

public func retrieveAuthenticationToken(completionHandler: @escaping
HyperwalletAuthenticationTokenProvider.CompletionHandler) {
var request = URLRequest(url: URL(string: url)!)
Expand Down
49 changes: 41 additions & 8 deletions Demo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,23 @@ enum HyperwalletConstants {

//swiftlint:disable force_cast
class ViewController: UITableViewController {
enum Example: Int {
static let count = 5
enum Example: Int, CaseIterable {
case paymentDetails
case listTransferMethod
case selectTransferMethod
case addTransferMethod
case userReceipts
case prepaidCardReceipts
case transferFunds

var title: String {
switch self {
case .paymentDetails: return "Payment Details"
case .listTransferMethod: return "List Transfer Methods"
case .selectTransferMethod: return "Select Transfer Method"
case .addTransferMethod: return "Add Transfer Method"
case .userReceipts: return "List User Receipts"
case .prepaidCardReceipts: return "List Prepaid Card Receipts"
case .transferFunds: return "Transfer Funds"
}
}
Expand All @@ -60,7 +65,10 @@ class ViewController: UITableViewController {
switch self {
case .paymentDetails: return "Configure how you want to get paid"
case .listTransferMethod: return "List all the Transfer Methods"
case .addTransferMethod: return "Add Transfer Methods"
case .selectTransferMethod: return "Select the Transfer Method you want to add"
case .addTransferMethod: return "Add the default Transfer Method"
case .userReceipts: return "List User Receipts"
case .prepaidCardReceipts: return "List Prepaid Card Receipts"
case .transferFunds: return "Transfer Funds"
}
}
Expand Down Expand Up @@ -123,7 +131,7 @@ class ViewController: UITableViewController {
}

override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Example.count
return Example.allCases.count
}

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

switch example {
case .listTransferMethod:
let viewController = HyperwalletUI.shared.listTransferMethodViewController()
let viewController = HyperwalletUI.shared.listTransferMethodTableViewController()
navigationController?.pushViewController(viewController, animated: true)

case .addTransferMethod:
let viewController = HyperwalletUI.shared.selectTransferMethodTypeViewController()
case .selectTransferMethod:
let viewController = HyperwalletUI.shared.selectTransferMethodTypeTableViewController()
viewController.createTransferMethodHandler = {
(transferMethod: HyperwalletTransferMethod) -> Void in
self.didCreateTransferMethod(transferMethod: transferMethod)
}
navigationController?.pushViewController(viewController, animated: true)

case .addTransferMethod:
if let country = ProcessInfo.processInfo.environment["COUNTRY"],
let currency = ProcessInfo.processInfo.environment["CURRENCY"],
let accountType = ProcessInfo.processInfo.environment["ACCOUNT_TYPE"],
let profileType = ProcessInfo.processInfo.environment["PROFILE_TYPE"] {
let viewController = HyperwalletUI.shared.addTransferMethodTableViewController(
country, currency, profileType, accountType)
navigationController?.pushViewController(viewController, animated: true)
} else {
let viewController = HyperwalletUI.shared.addTransferMethodTableViewController(
"US", "USD", "INDIVIDUAL", "BANK_ACCOUNT")
navigationController?.pushViewController(viewController, animated: true)
}

case .userReceipts:
let viewController = HyperwalletUI.shared.listUserReceiptTableViewController()
navigationController?.pushViewController(viewController, animated: true)

case .prepaidCardReceipts:
let prepaidCardToken = Bundle.main.infoDictionary!["PREPAID_CARD_TOKEN"] as! String
let viewController = HyperwalletUI.shared.listPrepaidCardReceiptTableViewController(
prepaidCardToken)

navigationController?.pushViewController(viewController, animated: true)

default:
let viewController = HyperwalletUI.shared.listTransferMethodViewController()
let viewController = HyperwalletUI.shared.listTransferMethodTableViewController()
navigationController?.pushViewController(viewController, animated: true)
}
}
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'slather'
6 changes: 3 additions & 3 deletions HyperwalletUISDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'HyperwalletUISDK'
spec.version = '1.0.0-beta02'
spec.version = '1.0.0-beta03'
spec.summary = 'Hyperwallet UI SDK for iOS to integrate with Hyperwallet Platform'
spec.homepage = 'https://github.com/hyperwallet/hyperwallet-ios-ui-sdk'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
Expand All @@ -10,10 +10,10 @@ Pod::Spec.new do |spec|
spec.source = { :git => 'https://github.com/hyperwallet/hyperwallet-ios-ui-sdk.git', :tag => "#{spec.version}"}
spec.source_files = 'Sources/**/*.{swift,h,strings,xib}'
spec.requires_arc = true
spec.swift_version = '4.2'
spec.swift_version = '5.0'
spec.resources = ['Sources/**/*.xcassets', 'Sources/**/*.ttf']

spec.dependency 'HyperwalletSDK', '1.0.0-beta02'
spec.dependency 'HyperwalletSDK', '1.0.0-beta03'

spec.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'Tests/**/*.swift'
Expand Down
Loading

0 comments on commit 1d89019

Please sign in to comment.