Skip to content

Commit

Permalink
Merge pull request #6 from Mastercard-Gateway/release/1.1.2
Browse files Browse the repository at this point in the history
Release/1.1.2
  • Loading branch information
jmonroe authored Nov 12, 2019
2 parents d951ef8 + a520d69 commit 2eeb4e4
Show file tree
Hide file tree
Showing 53 changed files with 226 additions and 210 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
language: objective-c

branches:
only:
- master

xcode_project: MPGSDK.xcodeproj
xcode_scheme: MPGSDK-iOS
osx_image: xcode10.1
xcode_sdk: iphonesimulator10.1
osx_image: xcode11.1
xcode_sdk: iphonesimulator13.1

script:
- xcodebuild clean build test -workspace MPGSDK.xcworkspace -scheme MPGSDK-iOS -destination "platform=iOS Simulator,name=iPhone X"
- xcodebuild clean build test -workspace MPGSDK.xcworkspace -scheme MPGSDK-iOS -destination "platform=iOS Simulator,name=iPhone 11"
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes

## [Unreleased]

## [1.1.1]
### Changed
- Updated the project and source code to Swift 5
- Updated podspec file

## [1.1.1]
### Changed
- Updated the update session call to support Gateway API versions 50 and up
Expand Down
2 changes: 1 addition & 1 deletion Configs/MPGSDK.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.1</string>
<string>1.1.2</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Mastercard Payment Gateway Services. All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Configs/MPGSDKTests.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.1</string>
<string>1.1.2</string>
</dict>
</plist>
82 changes: 41 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
CFPropertyList (3.0.1)
activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
babosa (1.0.2)
claide (1.0.2)
babosa (1.0.3)
claide (1.0.3)
cocoapods (1.5.3)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
Expand Down Expand Up @@ -53,21 +53,21 @@ GEM
declarative (0.0.10)
declarative-option (0.1.0)
digest-crc (0.4.1)
domain_name (0.5.20180417)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.6.0)
dotenv (2.7.5)
emoji_regex (1.0.1)
escape (0.0.4)
excon (0.62.0)
faraday (0.15.4)
excon (0.68.0)
faraday (0.17.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.13.0)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.114.0)
fastimage (2.1.7)
fastlane (2.134.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand All @@ -77,31 +77,31 @@ GEM
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday (~> 0.17)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
faraday_middleware (~> 0.13.1)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.21.2, < 0.24.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
mini_magick (~> 4.5.1)
multi_json
jwt (~> 2.1.0)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.2.2, < 2.0.0)
rubyzip (>= 1.3.0, < 2.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.6.0, < 2.0.0)
xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
ffi (1.10.0)
Expand All @@ -116,15 +116,15 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
google-cloud-core (1.2.7)
google-cloud-core (1.4.0)
google-cloud-env (~> 1.0)
google-cloud-env (1.0.5)
google-cloud-env (1.3.0)
faraday (~> 0.11)
google-cloud-storage (1.15.0)
google-cloud-storage (1.16.0)
digest-crc (~> 0.4)
google-api-client (~> 0.23)
google-cloud-core (~> 1.2)
googleauth (~> 0.6.2)
googleauth (>= 0.6.2, < 0.10.0)
googleauth (0.6.7)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
Expand All @@ -147,17 +147,17 @@ GEM
sass (~> 3.4)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.1.0)
json (2.2.0)
jwt (2.1.0)
liferaft (0.0.6)
memoist (0.16.0)
mime-types (3.2.2)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_magick (4.5.1)
mime-types-data (3.2019.1009)
mini_magick (4.9.5)
minitest (5.11.3)
molinillo (0.6.6)
multi_json (1.13.1)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
mustache (0.99.8)
Expand All @@ -166,7 +166,7 @@ GEM
naturally (2.2.0)
netrc (0.11.0)
open4 (1.3.4)
os (1.0.0)
os (1.0.1)
plist (3.5.0)
public_suffix (2.0.5)
rb-fsevent (0.10.3)
Expand All @@ -180,45 +180,45 @@ GEM
retriable (3.1.2)
rouge (2.0.7)
ruby-macho (1.3.1)
rubyzip (1.2.2)
rubyzip (1.3.0)
sass (3.7.3)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
security (0.1.3)
signet (0.11.0)
signet (0.12.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.5)
simctl (1.6.6)
CFPropertyList
naturally
slack-notifier (2.3.2)
sqlite3 (1.3.13)
terminal-notifier (1.8.0)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-cursor (0.6.0)
tty-screen (0.6.5)
tty-spinner (0.9.0)
tty-cursor (~> 0.6.0)
tty-cursor (0.7.0)
tty-screen (0.7.0)
tty-spinner (0.9.1)
tty-cursor (~> 0.7)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.1)
unf_ext (0.0.7.6)
unicode-display_width (1.6.0)
word_wrap (1.0.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcode-install (2.5.0)
claide (>= 0.9.1, < 1.1.0)
fastlane (>= 2.1.0, < 3.0.0)
xcodeproj (1.7.0)
xcodeproj (1.13.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand Down Expand Up @@ -246,4 +246,4 @@ DEPENDENCIES
xcpretty

BUNDLED WITH
1.16.1
1.17.3
16 changes: 10 additions & 6 deletions MGPSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
Pod::Spec.new do |s|
s.name = "MGPSDK"
s.version = "0.1"
s.summary = ""
s.version = "1.1.1"
s.summary = "Gateway iOS SDK"
s.description = <<-DESC
Your description here.
Our iOS SDK allows you to easily integrate payments into your Swift iOS app. By updating a hosted session directly with the Gateway, you avoid the risk of handling sensitive card details on your server.
DESC
s.homepage = "https://github.com/Mastercard/gateway-merchant-swift"
s.license = { :type => "MIT", :file => "LICENSE" }
s.homepage = "https://github.com/Mastercard-Gateway/gateway-ios-sdk"
s.license = { :type => "Apache-2.0", :file => "LICENSE" }
s.author = { "Mastercard Payment Gateway Services" => "" }
s.social_media_url = ""
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
s.source = { :git => "https://github.com/Mastercard/gateway-merchant-swift.git", :tag => s.version.to_s }
s.swift_version = '5.0'
s.source = { :git => "https://github.com/Mastercard-Gateway/gateway-ios-sdk.git", :tag => s.version.to_s }
s.source_files = "Sources/**/*"
s.frameworks = "Foundation"
s.pod_target_xcconfig = {
'APPLICATION_EXTENSION_API_ONLY' => 'YES'
}
end
5 changes: 3 additions & 2 deletions MPGSDK-iOS-Sample/MPGSDK-iOS-Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
TargetAttributes = {
6F5F70351F7C006E0048F591 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1110;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.ApplePay = {
Expand Down Expand Up @@ -356,7 +357,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.mastercard.MPGSDK-iOS-Sample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -372,7 +373,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.mastercard.MPGSDK-iOS-Sample";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion MPGSDK-iOS-Sample/MPGSDK-iOS-Sample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// setup the merchant API with the url for your sample merchant server. Information on the sample merchant server can be found at https://github.com/Mastercard/gateway-test-merchant-server
window?.tintColor = brandColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ class MerchantAPI {

request.httpMethod = method

let encoder = JSONEncoder()
request.httpBody = try? encoder.encode(body)
if let body = body {
let encoder = JSONEncoder()
request.httpBody = try? encoder.encode(body)
}

let task = urlSession.dataTask(with: request, completionHandler: responseHandler(completion))
task.resume()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ import UIKit
extension UIViewController {

func startAvoidingKeyboard() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: UIResponder.keyboardWillChangeFrameNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardFrameWillChangeNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}

func stopAvoidingKeyboard() {
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillChangeFrameNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
}

@objc private func keyboardFrameWillChangeNotification(_ notification: Notification) {
guard let userInfo = notification.userInfo, let keyboardFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue else {
guard let userInfo = notification.userInfo, let keyboardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue else {
return
}

let keyboardFrameInView = view.convert(keyboardFrame, from: nil)
let safeAreaFrame = view.safeAreaLayoutGuide.layoutFrame.insetBy(dx: 0, dy: -additionalSafeAreaInsets.bottom)
let intersection = safeAreaFrame.intersection(keyboardFrameInView)

let animationDuration: TimeInterval = (notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0.3
let animationCurveRawNSN = notification.userInfo?[UIKeyboardAnimationCurveUserInfoKey] as? NSNumber
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIViewAnimationOptions.curveEaseInOut.rawValue
let animationCurve = UIViewAnimationOptions(rawValue: animationCurveRaw)
let animationDuration: TimeInterval = (notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0.3
let animationCurveRawNSN = notification.userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber
let animationCurveRaw = animationCurveRawNSN?.uintValue ?? UIView.AnimationOptions.curveEaseInOut.rawValue
let animationCurve = UIView.AnimationOptions(rawValue: animationCurveRaw)

UIView.animate(withDuration: animationDuration, delay: 0, options: animationCurve, animations: {
self.additionalSafeAreaInsets.bottom = intersection.height
Expand Down
Loading

0 comments on commit 2eeb4e4

Please sign in to comment.