Skip to content

Commit

Permalink
Release 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adyen-git-manager committed Sep 27, 2017
1 parent 663f078 commit 5d97999
Show file tree
Hide file tree
Showing 83 changed files with 1,957 additions and 964 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0
44 changes: 26 additions & 18 deletions Adyen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -929,12 +929,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Adyen;
TargetAttributes = {
E20AD0081EFAB0310065B70E = {
CreatedOnToolsVersion = 8.3.3;
DevelopmentTeam = B2NYSS5932;
LastSwiftMigration = 0900;
ProvisioningStyle = Manual;
};
E20AD0111EFAB0310065B70E = {
Expand All @@ -943,11 +944,12 @@
};
E2BF6CC01F03952C0065E574 = {
CreatedOnToolsVersion = 8.3.3;
ProvisioningStyle = Automatic;
LastSwiftMigration = 0900;
TestTargetID = E2E9D01A1F0389C80056E0AC;
};
E2E9D01A1F0389C80056E0AC = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
ProvisioningStyle = Manual;
};
};
Expand Down Expand Up @@ -1341,21 +1343,27 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.8.0;
CURRENT_PROJECT_VERSION = 1.9.0;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -1396,21 +1404,27 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.8.0;
CURRENT_PROJECT_VERSION = 1.9.0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -1438,9 +1452,8 @@
baseConfigurationReference = 20191199750F47C401152B90 /* Pods-Adyen.debug.xcconfig */;
buildSettings = {
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1.8.0;
DYLIB_CURRENT_VERSION = 1.9.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Adyen/Info.plist;
Expand All @@ -1449,7 +1462,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.Adyen;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -1458,9 +1471,8 @@
baseConfigurationReference = 39B692648B2F9A2E64860876 /* Pods-Adyen.release.xcconfig */;
buildSettings = {
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1.8.0;
DYLIB_CURRENT_VERSION = 1.9.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Adyen/Info.plist;
Expand All @@ -1469,7 +1481,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.Adyen;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down Expand Up @@ -1504,7 +1516,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.AdyenUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = AdyenUIHost;
};
name = Debug;
Expand All @@ -1516,7 +1528,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.AdyenUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_TARGET_NAME = AdyenUIHost;
};
name = Release;
Expand All @@ -1527,13 +1539,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AdyenUIHost/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.AdyenUIHost;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -1543,13 +1553,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AdyenUIHost/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.adyen.AdyenUIHost;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
4 changes: 3 additions & 1 deletion Adyen.xcodeproj/xcshareddata/xcschemes/Adyen.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
30 changes: 20 additions & 10 deletions Adyen/Core/Extensions/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import Foundation

extension String {

// MARK: - Describing a String

func boolValue() -> Bool? {
switch lowercased() {
case "true":
Expand All @@ -18,23 +21,30 @@ extension String {
}
}

subscript(position: Int) -> String {
// MARK: - Getting Substrings

internal subscript(position: Int) -> String {
guard position >= 0 && position < characters.count else { return "" }

return String(self[index(startIndex, offsetBy: position)])
}

subscript(range: Range<Int>) -> String {
let lowerIndex = index(startIndex, offsetBy: max(0, range.lowerBound), limitedBy: endIndex) ?? endIndex
let lowerBound = range.lowerBound < 0 ? 0 : range.lowerBound
return substring(with: lowerIndex..<(index(lowerIndex, offsetBy: range.upperBound - lowerBound, limitedBy: endIndex) ?? endIndex))
internal subscript(range: Range<Int>) -> String {
let lowerBound = index(startIndex, offsetBy: range.lowerBound)
let upperBound = index(lowerBound, offsetBy: range.upperBound - range.lowerBound)

return String(self[lowerBound..<upperBound])
}

subscript(range: ClosedRange<Int>) -> String {
let lowerIndex = index(startIndex, offsetBy: max(0, range.lowerBound), limitedBy: endIndex) ?? endIndex
let lowerBound = range.lowerBound < 0 ? 0 : range.lowerBound
return substring(with: lowerIndex..<(index(lowerIndex, offsetBy: range.upperBound - lowerBound + 1, limitedBy: endIndex) ?? endIndex))
internal subscript(range: ClosedRange<Int>) -> String {
let lowerBound = index(startIndex, offsetBy: range.lowerBound)
let upperBound = index(lowerBound, offsetBy: range.upperBound - range.lowerBound)

return String(self[lowerBound...upperBound])
}

// MARK: - Grouping

/// Separates the string into groups of the given length.
///
/// - Parameters:
Expand All @@ -48,7 +58,7 @@ extension String {
let offset = min(length, self.distance(from: startIndex, to: self.endIndex))
let endIndex = self.index(startIndex, offsetBy: offset)

return self.substring(with: startIndex..<endIndex)
return String(self[startIndex..<endIndex])
}

return groups.joined(separator: " ")
Expand Down
26 changes: 14 additions & 12 deletions Adyen/Core/PaymentRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -329,24 +329,26 @@ public final class PaymentRequest {
}

private func requestRedirectURL(from url: URL, completion: @escaping URLCompletion) {
delegateQueue.async {
if let paymentMethod = self.paymentMethod,
let plugin = self.pluginManager?.plugin(for: paymentMethod) as? UniversalLinksPlugin,
plugin.supportsUniversalLinks {
if let paymentMethod = self.paymentMethod,
let plugin = self.pluginManager?.plugin(for: paymentMethod) as? UniversalLinksPlugin,
plugin.supportsUniversalLinks {

let session = URLSession(configuration: .default)
session.dataTask(with: url, completionHandler: { [weak self] data, response, error in
guard let strongSelf = self else {
return
}

let session = URLSession(configuration: .default)
session.dataTask(with: url, completionHandler: { [weak self] data, response, error in
guard let strongSelf = self else {
return
}

strongSelf.delegateQueue.async {
if let universalLink = response?.url {
strongSelf.delegate?.paymentRequest(strongSelf, requiresReturnURLFrom: universalLink, completion: completion)
} else {
strongSelf.delegate?.paymentRequest(strongSelf, requiresReturnURLFrom: url, completion: completion)
}
}).resume()
} else {
}
}).resume()
} else {
delegateQueue.async {
self.delegate?.paymentRequest(self, requiresReturnURLFrom: url, completion: completion)
}
}
Expand Down
39 changes: 31 additions & 8 deletions Adyen/CoreUI/Appearance/AppearanceConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,31 @@ public final class AppearanceConfiguration {
/// The preferred status bar style.
public var preferredStatusBarStyle = UIStatusBarStyle.default

// MARK: - Configuring the Navigation Bar
// MARK: - Configuring the Navigation Bar Title Text Appearance

/// The attributes used for the navigation bar's title.
public var navigationBarTitleTextAttributes: [String: Any]?
public var navigationBarTitleTextAttributes: [NSAttributedStringKey: Any]?

/// The attributes used for the navigation bar's large title. Only has an effect on iOS 11 and higher.
public var navigationBarLargeTitleTextAttributes: [NSAttributedStringKey: Any]?

/// Display modes for the large title in a navigation bar.
public enum NavigationBarLargeTitleDisplayMode {

/// Always display a large title.
case always

/// Only display a large title for the root view controller.
case root

/// Never display a large title.
case never
}

/// The display mode for the large title in the navigation bar. Only has an effect on iOS 11 and higher.
public var navigationBarLargeTitleDisplayMode = NavigationBarLargeTitleDisplayMode.root

// MARK: - Configuring the Navigation Bar Appearance

/// The navigation bar's tint color.
public var navigationBarTintColor: UIColor?
Expand All @@ -42,7 +63,7 @@ public final class AppearanceConfiguration {
// MARK: - Configuring the Checkout Button

/// The attributes used for the checkout button's title.
public var checkoutButtonTitleTextAttributes: [String: Any]?
public var checkoutButtonTitleTextAttributes: [NSAttributedStringKey: Any]?

/// The insets from the edges of the checkout button to the title.
public var checkoutButtonTitleEdgeInsets: UIEdgeInsets?
Expand All @@ -61,17 +82,15 @@ public final class AppearanceConfiguration {
public static var `default`: AppearanceConfiguration = {
let appearanceConfiguration = AppearanceConfiguration()
appearanceConfiguration.navigationBarTitleTextAttributes = [
NSFontAttributeName: UIFont.systemFont(ofSize: 18.0),
NSForegroundColorAttributeName: UIColor.checkoutDarkGray
.foregroundColor: UIColor.checkoutDarkGray
]
appearanceConfiguration.navigationBarTintColor = UIColor.checkoutDarkGray
appearanceConfiguration.navigationBarBackgroundColor = UIColor.white
appearanceConfiguration.isNavigationBarTranslucent = false
appearanceConfiguration.navigationBarCancelButtonImage = UIImage.bundleImage("close")

appearanceConfiguration.checkoutButtonTitleTextAttributes = [
NSFontAttributeName: UIFont.systemFont(ofSize: 18.0),
NSForegroundColorAttributeName: UIColor.white
.font: UIFont.systemFont(ofSize: 18.0),
.foregroundColor: UIColor.white
]
appearanceConfiguration.checkoutButtonTitleEdgeInsets = UIEdgeInsets(top: 16.0, left: 0.0, bottom: 16.0, right: 0.0)
appearanceConfiguration.checkoutButtonCornerRadius = 4.0
Expand All @@ -83,13 +102,17 @@ public final class AppearanceConfiguration {

}

// MARK: - NSCopying

extension AppearanceConfiguration: NSCopying {

/// :nodoc:
public func copy(with zone: NSZone? = nil) -> Any {
let appearanceConfiguration = AppearanceConfiguration()
appearanceConfiguration.preferredStatusBarStyle = preferredStatusBarStyle
appearanceConfiguration.navigationBarTitleTextAttributes = navigationBarTitleTextAttributes
appearanceConfiguration.navigationBarLargeTitleTextAttributes = navigationBarLargeTitleTextAttributes
appearanceConfiguration.navigationBarLargeTitleDisplayMode = navigationBarLargeTitleDisplayMode
appearanceConfiguration.navigationBarTintColor = navigationBarTintColor
appearanceConfiguration.navigationBarBackgroundColor = navigationBarBackgroundColor
appearanceConfiguration.isNavigationBarTranslucent = isNavigationBarTranslucent
Expand Down
Loading

0 comments on commit 5d97999

Please sign in to comment.