From 1d0d70a7700f1b091a5b66f29cbc66f0913bd1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20W=C4=99drychowski?= Date: Wed, 20 Apr 2022 11:37:29 +0200 Subject: [PATCH] MOB-4020 post release 1.6.1 [master] (#143) * Feature/MOB-4020 update network sdk to support versioning of payment related calls (#142) * Add `version` parameter to PaymentProvider model * Payment API Version added to payments interactors and endpints * force v68 api version for debug * Payment version added to path if differs from v51 * version path component fix * version string calculation improved * Test v68 version * update tests * version bump 1.5.5 => 1.5.6 * Change version number * MOB-4021 cherry pick * SPM updated * fetching payment provider api version fixed * Unit tests update * SPM update reverted due to CI issue * remove `version` parameter form PaymentProvider model * bumb version 1.6.0 => 1.6.1 --- KarhooSDK.podspec | 2 +- KarhooSDK.xcodeproj/project.pbxproj | 8 ++++---- KarhooSDK/Api/Response/PaymentProvider.swift | 5 ----- KarhooSDK/Api/Response/Provider.swift | 6 +++++- .../KarhooAdyenAPIVersionProvider.swift | 2 +- README.md | 4 ++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/KarhooSDK.podspec b/KarhooSDK.podspec index 5ac5b88e..40f36669 100644 --- a/KarhooSDK.podspec +++ b/KarhooSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "KarhooSDK" - s.version = "1.6.0" + s.version = "1.6.1" s.summary = "Karhoo Network SDK" s.homepage = "https://developer.karhoo.com/docs/build-apps-using-sdks" s.license = 'BSD 2-Clause' diff --git a/KarhooSDK.xcodeproj/project.pbxproj b/KarhooSDK.xcodeproj/project.pbxproj index 8f7cc399..65831296 100644 --- a/KarhooSDK.xcodeproj/project.pbxproj +++ b/KarhooSDK.xcodeproj/project.pbxproj @@ -4314,7 +4314,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = U7U4Q7YGDH; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4338,7 +4338,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.1; MODULEMAP_PRIVATE_FILE = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.karhoo.KarhooSDK; @@ -4359,7 +4359,7 @@ CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = U7U4Q7YGDH; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4383,7 +4383,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.1; MODULEMAP_PRIVATE_FILE = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.karhoo.KarhooSDK; diff --git a/KarhooSDK/Api/Response/PaymentProvider.swift b/KarhooSDK/Api/Response/PaymentProvider.swift index ebe9f5f6..3fd0e1ce 100644 --- a/KarhooSDK/Api/Response/PaymentProvider.swift +++ b/KarhooSDK/Api/Response/PaymentProvider.swift @@ -9,14 +9,11 @@ import Foundation public struct PaymentProvider : KarhooCodableModel { public let provider: Provider - public let version: String public let loyaltyProgamme: LoyaltyProgramme public init(provider: Provider = Provider(), - version: String = "v51", loyaltyProgamme: LoyaltyProgramme = LoyaltyProgramme()) { self.provider = provider - self.version = version self.loyaltyProgamme = loyaltyProgamme } @@ -24,13 +21,11 @@ public struct PaymentProvider : KarhooCodableModel { let container = try decoder.container(keyedBy: CodingKeys.self) self.provider = (try? container.decode(Provider.self, forKey: .provider)) ?? Provider() - self.version = (try? container.decodeIfPresent(String.self, forKey: .version)) ?? "v51" self.loyaltyProgamme = (try? container.decode(LoyaltyProgramme.self, forKey: .loyaltyProgamme)) ?? LoyaltyProgramme() } enum CodingKeys: String, CodingKey { case provider - case version case loyaltyProgamme = "loyalty_programme" } } diff --git a/KarhooSDK/Api/Response/Provider.swift b/KarhooSDK/Api/Response/Provider.swift index 559368f2..23a646bb 100644 --- a/KarhooSDK/Api/Response/Provider.swift +++ b/KarhooSDK/Api/Response/Provider.swift @@ -13,6 +13,7 @@ public enum PaymentProviderType { public struct Provider: KarhooCodableModel { public let id: String + public let version: String public var type: PaymentProviderType { switch self.id.lowercased() { @@ -22,17 +23,20 @@ public struct Provider: KarhooCodableModel { } } - public init(id: String = "") { + public init(id: String = "", version: String = "") { self.id = id + self.version = version } public init (from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = (try? container.decode(String.self, forKey: .id)) ?? "" + self.version = (try? container.decode(String.self, forKey: .version)) ?? "v51" } enum CodingKeys: String, CodingKey { case id + case version } } diff --git a/KarhooSDK/Service/Payment/AdyenAPIVersionProvider/KarhooAdyenAPIVersionProvider.swift b/KarhooSDK/Service/Payment/AdyenAPIVersionProvider/KarhooAdyenAPIVersionProvider.swift index eca54d91..ee6f257a 100644 --- a/KarhooSDK/Service/Payment/AdyenAPIVersionProvider/KarhooAdyenAPIVersionProvider.swift +++ b/KarhooSDK/Service/Payment/AdyenAPIVersionProvider/KarhooAdyenAPIVersionProvider.swift @@ -16,7 +16,7 @@ public struct KarhooAdyenAPIVersionProvider: AdyenAPIVersionProvider { } func getVersion() -> String { - let version = userDataStore.getCurrentUser()?.paymentProvider?.version + let version = userDataStore.getCurrentUser()?.paymentProvider?.provider.version switch version { case nil: return "" diff --git a/README.md b/README.md index ab28b7b1..7c1d0298 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ You can use [CocoaPods](http://cocoapods.org/) to install `KarhooSDK` by adding ```ruby use_frameworks! -pod 'KarhooSDK', '~> 1.6.0' +pod 'KarhooSDK', '~> 1.6.1' ``` then import `KarhooSDK` wherever you want to access Karhoo services @@ -52,7 +52,7 @@ Once you have your Swift package set up, adding Karhoo as a dependency is as eas ```swift dependencies: [ -.package(url: "https://github.com/Karhoo/karhoo-ios-sdk.git", .upToNextMajor(from: "1.6.0")) +.package(url: "https://github.com/Karhoo/karhoo-ios-sdk.git", .upToNextMajor(from: "1.6.1")) ] ```