Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeStage committed Jan 9, 2017
2 parents 7d65042 + 386892a commit 5dbaee7
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 53 deletions.
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

1 change: 0 additions & 1 deletion Cartfile.resolved

This file was deleted.

34 changes: 7 additions & 27 deletions Figo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

/* Begin PBXBuildFile section */
83017B781C0A2FE80062FC08 /* TaskState.json in Resources */ = {isa = PBXBuildFile; fileRef = 83017B771C0A2FE80062FC08 /* TaskState.json */; };
830493581E202957005B5B30 /* Unbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830493571E202957005B5B30 /* Unbox.swift */; };
830E63D91C05A4050048F7BF /* TANScheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830E63D81C05A4050048F7BF /* TANScheme.swift */; };
830E63DC1C05A4960048F7BF /* TanScheme.json in Resources */ = {isa = PBXBuildFile; fileRef = 830E63DB1C05A4960048F7BF /* TanScheme.json */; };
830E63DE1C05A7070048F7BF /* SyncStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830E63DD1C05A7070048F7BF /* SyncStatus.swift */; };
830E63E11C05A7AE0048F7BF /* SyncStatus.json in Resources */ = {isa = PBXBuildFile; fileRef = 830E63E01C05A7AE0048F7BF /* SyncStatus.json */; };
830E63E31C05AB890048F7BF /* PaymentParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830E63E21C05AB890048F7BF /* PaymentParameters.swift */; };
832CABA91E242BAF00D48895 /* XCGLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 832CABA81E242BAF00D48895 /* XCGLogger.framework */; };
832CABAE1E242F8700D48895 /* Unbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 832CABAD1E242F8700D48895 /* Unbox.swift */; };
833285EF1C04D45900A9FE73 /* Balance.json in Resources */ = {isa = PBXBuildFile; fileRef = 833285EE1C04D45900A9FE73 /* Balance.json */; };
8346AABF1C0A03A700F9F0DE /* TaskEndpoints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8346AABE1C0A03A700F9F0DE /* TaskEndpoints.swift */; };
83648D571C0A42B700286FFB /* LoginSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83648D561C0A42B700286FFB /* LoginSettings.swift */; };
Expand Down Expand Up @@ -105,13 +104,12 @@

/* Begin PBXFileReference section */
83017B771C0A2FE80062FC08 /* TaskState.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = TaskState.json; path = Resources/TaskState.json; sourceTree = "<group>"; };
830493571E202957005B5B30 /* Unbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unbox.swift; sourceTree = "<group>"; };
830E63D81C05A4050048F7BF /* TANScheme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TANScheme.swift; path = Types/TANScheme.swift; sourceTree = "<group>"; };
830E63DB1C05A4960048F7BF /* TanScheme.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = TanScheme.json; path = Resources/TanScheme.json; sourceTree = "<group>"; };
830E63DD1C05A7070048F7BF /* SyncStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SyncStatus.swift; path = Types/SyncStatus.swift; sourceTree = "<group>"; };
830E63E01C05A7AE0048F7BF /* SyncStatus.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = SyncStatus.json; path = Resources/SyncStatus.json; sourceTree = "<group>"; };
830E63E21C05AB890048F7BF /* PaymentParameters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PaymentParameters.swift; path = Types/PaymentParameters.swift; sourceTree = "<group>"; };
832CABA81E242BAF00D48895 /* XCGLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCGLogger.framework; path = Carthage/Build/iOS/XCGLogger.framework; sourceTree = "<group>"; };
832CABAD1E242F8700D48895 /* Unbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unbox.swift; sourceTree = "<group>"; };
833285EE1C04D45900A9FE73 /* Balance.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = Balance.json; path = Resources/Balance.json; sourceTree = "<group>"; };
833285F01C04D48E00A9FE73 /* Resources.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Resources.swift; sourceTree = "<group>"; };
8346AABE1C0A03A700F9F0DE /* TaskEndpoints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskEndpoints.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -197,19 +195,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
832CABA91E242BAF00D48895 /* XCGLogger.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
832CABA71E242BAE00D48895 /* Frameworks */ = {
832CABAA1E242F3F00D48895 /* Dependencies */ = {
isa = PBXGroup;
children = (
832CABA81E242BAF00D48895 /* XCGLogger.framework */,
832CABAD1E242F8700D48895 /* Unbox.swift */,
);
name = Frameworks;
path = Dependencies;
sourceTree = "<group>";
};
837B520F1C10C97E00D3CB25 /* Core */ = {
Expand Down Expand Up @@ -240,7 +237,6 @@
83D3A67F1BFF2953003EDE45 /* Source */ = {
isa = PBXGroup;
children = (
830493571E202957005B5B30 /* Unbox.swift */,
83F0E46B1C08A91400FB3709 /* FigoClient.swift */,
837B520C1C10C95500D3CB25 /* Alias.swift */,
838FDA041C0DF90100525E1D /* FigoError.swift */,
Expand All @@ -250,6 +246,7 @@
83F0E4721C08D9EA00FB3709 /* Endpoints */,
838FD9F31C0DF8D900525E1D /* Parameters */,
83D3A6FA1BFF684C003EDE45 /* Types */,
832CABAA1E242F3F00D48895 /* Dependencies */,
83D3A6801BFF2953003EDE45 /* Supporting Files */,
);
path = Source;
Expand Down Expand Up @@ -356,7 +353,6 @@
83D3A67F1BFF2953003EDE45 /* Source */,
83D3A7081BFFB6A7003EDE45 /* Tests */,
83F3AF231BFF28D900767D77 /* Products */,
832CABA71E242BAE00D48895 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -512,6 +508,7 @@
files = (
8346AABF1C0A03A700F9F0DE /* TaskEndpoints.swift in Sources */,
83648D5A1C0C32BE00286FFB /* ServiceEndpoints.swift in Sources */,
832CABAE1E242F8700D48895 /* Unbox.swift in Sources */,
838FD9EE1C0DEEFD00525E1D /* PaymentType.swift in Sources */,
830E63E31C05AB890048F7BF /* PaymentParameters.swift in Sources */,
838FD9E31C0DACBE00525E1D /* Transaction.swift in Sources */,
Expand All @@ -522,7 +519,6 @@
83F0E4781C08DA2800FB3709 /* Address.swift in Sources */,
838FDA221C0EE54000525E1D /* StandingOrder.swift in Sources */,
83648D661C0C75E600286FFB /* SupportedService.swift in Sources */,
830493581E202957005B5B30 /* Unbox.swift in Sources */,
838FD9F91C0DF8D900525E1D /* CreateAccountParameters.swift in Sources */,
83648D631C0C705700286FFB /* SupportedBank.swift in Sources */,
838FDA361C0EFC0300525E1D /* Payment.swift in Sources */,
Expand Down Expand Up @@ -574,10 +570,6 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "de.chriskoenig.Figo-iOS-Tests";
Expand All @@ -591,10 +583,6 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "de.chriskoenig.Figo-iOS-Tests";
Expand Down Expand Up @@ -719,10 +707,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SKIP_INSTALL = YES;
Expand All @@ -738,10 +722,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SKIP_INSTALL = YES;
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ Applications that would like to access the figo Connect have to register with us
Website: [http://figo.io](http://figo.io)


## Development

If you want to run the included tests to see how the SDK works or submit a pull request, you need to bootstrap the project by running

`carthage bootstrap`

You can find a demo account in the API reference, which you can use without registering an application.

## Installation

### Manually
Expand All @@ -47,7 +39,6 @@ You can find a demo account in the API reference, which you can use without regi
* Open the new folder and drag the Figo.xcodeproj into the Project Navigator of your application's Xcode project.
* Select the Figo.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.
* Add the Figo.framework to your target(s) in the "Embedded Binaries" sections
* Add [DaveWoodCom/XCGLogger](https://github.com/DaveWoodCom/XCGLogger) to your project

### Carthage

Expand Down Expand Up @@ -228,7 +219,6 @@ Bank accounts can have standing orders associated with it if supported by the re

The Figo Framework uses the following 3rd-party utilities:

- [DaveWoodCom/XCGLogger](https://github.com/DaveWoodCom/XCGLogger) for logging
- [JohnSundell/Unbox](https://github.com/JohnSundell/Unbox) for unboxing of JSON responses


42 changes: 38 additions & 4 deletions Source/Core/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,44 @@
//

import Foundation
import XCGLogger


// Internal logger instance
internal var log = XCGLogger.default
internal var log: Logger = VoidLogger()


public protocol Logger {
var debug: (String) -> Void { get }
var verbose: (String) -> Void { get }
var error: (String) -> Void { get }
}

public struct VoidLogger: Logger {
public var debug: (String) -> Void = { message in

}
public var verbose: (String) -> Void = { message in

}
public var error: (String) -> Void = { message in

}
}

public struct ConsoleLogger: Logger {
public init() {

}
public var debug: (String) -> Void = { message in
print(message)
}
public var verbose: (String) -> Void = { message in
print(message)
}
public var error: (String) -> Void = { message in
print(message)
}
}


func debugPrintRequest(_ request: URLRequest) {
Expand All @@ -22,8 +55,9 @@ func debugPrintRequest(_ request: URLRequest) {
}
}
if let data = request.httpBody {
let string = String(data: data, encoding: String.Encoding.utf8)
log.verbose(string)
if let string = String(data: data, encoding: String.Encoding.utf8) {
log.verbose(string)
}
}
}

Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions Source/FigoClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Foundation
import XCGLogger


// Server's SHA1 fingerprints
Expand Down Expand Up @@ -60,17 +59,14 @@ open class FigoClient {

- Note: SSL pinning is implemented in the NSURLSessionDelegate. So if you provide your own NSURLSession, make sure to use FigoClient.dispositionForChallenge(:) in your own NSURLSessionDelegate to enable SSL pinning.
*/
public init(session: URLSession? = nil, logger: XCGLogger? = nil) {
public init(session: URLSession? = nil, logger: Logger? = nil) {
if let session = session {
self.session = session
} else {
self.session = URLSession(configuration: URLSessionConfiguration.default, delegate: sessionDelegate, delegateQueue: nil)
}
if let logger = logger {
log = logger
} else {
log = XCGLogger.default
log.setup(level: .error, showFunctionName: false, showThreadName: false, showLevel: false, showFileNames: false, showLineNumbers: false, showDate: false, writeToFile: nil, fileLevel: .none)
}
}

Expand Down
6 changes: 1 addition & 5 deletions Tests/BaseTestCaseWithLogin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
import Foundation
import XCTest
import Figo
import XCGLogger


let logger = XCGLogger.default
let figo = FigoClient(logger: logger)
let figo = FigoClient(logger: ConsoleLogger())


class BaseTestCaseWithLogin: XCTestCase {
Expand All @@ -32,8 +30,6 @@ class BaseTestCaseWithLogin: XCTestCase {

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

logger.setup(level: .verbose, showFunctionName: false, showThreadName: false, showLevel: false, showFileNames: false, showLineNumbers: false, showDate: false, writeToFile: nil, fileLevel: .none)
}

func login(_ completionHandler: @escaping () -> Void) {
Expand Down

0 comments on commit 5dbaee7

Please sign in to comment.