Skip to content

Commit

Permalink
MOB-4020 post release 1.6.1 [master] (#143)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
AleksanderWedrychowskiKarhoo authored Apr 20, 2022
1 parent 124528a commit 1d0d70a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion KarhooSDK.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
8 changes: 4 additions & 4 deletions KarhooSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions KarhooSDK/Api/Response/PaymentProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,23 @@ 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
}

public init (from decoder: Decoder) throws {
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"
}
}
6 changes: 5 additions & 1 deletion KarhooSDK/Api/Response/Provider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"))
]
```

Expand Down

0 comments on commit 1d0d70a

Please sign in to comment.