Skip to content

Commit b25a8fa

Browse files
Merge pull request #35 from dojo-engineering/develop
Develop->Master
2 parents a2d7174 + f63f7f2 commit b25a8fa

38 files changed

+127
-108
lines changed

Sources/dojo-ios-sdk/Classes/DojoSDK.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ protocol DojoSDKProtocol {
4343

4444
/// DojoSDK interface
4545
@objc public class DojoSDK: NSObject, DojoSDKProtocol {
46+
47+
public static override func version() -> Int {
48+
141
49+
}
50+
4651
/// Execute card payment
4752
/// - Parameters:
4853
/// - token: Payment secret obtained from a paymentIIntent object.

Sources/dojo-ios-sdk/Classes/Entities/CardPaymentPayload/DojoCardPaymentPayload.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Foundation
2828
self.userPhoneNumber = userPhoneNumber
2929
self.billingAddress = billingAddress
3030
self.shippingDetails = shippingDetails
31-
self.metaData = metaData
31+
self.metaData = metaData == nil ? [:] : metaData
3232
self.savePaymentMethod = savePaymentMethod
3333
}
3434

@@ -43,14 +43,15 @@ import Foundation
4343
/// The address where to send the order.
4444
public let shippingDetails: DojoShippingDetails?
4545
/// A set of key-value pairs that you can use for storing additional information.
46-
public let metaData: [String: String]?
46+
public var metaData: [String: String]?
4747
/// Set if you want to save this payment method on user's account
4848
public let savePaymentMethod: Bool
4949
}
5050

5151
extension DojoCardPaymentPayload {
5252
func getRequestBody() -> Data? {
5353
let encoder = JSONEncoder()
54+
self.metaData?[getMetadataSDKVersionKey()] = getMetadataSDKVersion()
5455
guard let bodyData = try? encoder.encode(CardPaymentDataRequest(payload: self)) else {
5556
return nil
5657
}

Sources/dojo-ios-sdk/Classes/Entities/CardPaymentPayload/DojoCardPaymentPayloadProtocol.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,16 @@ import Foundation
99

1010
protocol DojoCardPaymentPayloadProtocol: Codable {
1111
func getRequestBody() -> Data?
12+
func getMetadataSDKVersion() -> String
13+
func getMetadataSDKVersionKey() -> String
14+
}
15+
16+
extension DojoCardPaymentPayloadProtocol {
17+
func getMetadataSDKVersion() -> String {
18+
"ios-\(DojoSDK.version())"
19+
}
20+
21+
func getMetadataSDKVersionKey() -> String {
22+
"dojo-sdk-core-version"
23+
}
1224
}

Sources/dojo-ios-sdk/Classes/Entities/CardPaymentPayload/DojoSavedCardPaymentPayload.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Foundation
2626
self.userPhoneNumber = userPhoneNumber
2727
self.userEmailAddress = userEmailAddress
2828
self.shippingDetails = shippingDetails
29-
self.metaData = metaData
29+
self.metaData = metaData == nil ? [:] : metaData
3030
}
3131

3232
/// CVV, CVC or CVC2 of a card.
@@ -40,10 +40,11 @@ import Foundation
4040
/// The address where to send the order.
4141
public let shippingDetails: DojoShippingDetails?
4242
/// A set of key-value pairs that you can use for storing additional information.
43-
public let metaData: [String: String]?
43+
public var metaData: [String: String]?
4444

4545
func getRequestBody() -> Data? {
4646
let encoder = JSONEncoder()
47+
self.metaData?[getMetadataSDKVersionKey()] = getMetadataSDKVersion()
4748
guard let bodyData = try? encoder.encode(CardPaymentDataRequest(payload: self)) else {
4849
return nil
4950
}

Sources/dojo-ios-sdk/Libs/CardinalMobile.xcframework/ios-arm64/CardinalMobile.framework/Headers/ButtonCustomization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Copyright © 2018 Cardinal Commerce. All rights reserved.
66
//
77

8-
#import "Customization.h"
8+
#import <CardinalMobile/Customization.h>
99

1010
/**
1111
* The ButtonCustomization class provides methods for the 3DS Requestor App to pass button customization parameters to the 3DS SDK.

Sources/dojo-ios-sdk/Libs/CardinalMobile.xcframework/ios-arm64/CardinalMobile.framework/Headers/CardinalSession.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77

88
#import <Foundation/Foundation.h>
9-
#import "Warning.h"
10-
#import "DirectoryServerIDConst.h"
9+
#import <CardinalMobile/Warning.h>
10+
#import <CardinalMobile/DirectoryServerIDConst.h>
1111

1212
NS_ASSUME_NONNULL_BEGIN
1313

Sources/dojo-ios-sdk/Libs/CardinalMobile.xcframework/ios-arm64/CardinalMobile.framework/Headers/CardinalSessionConfiguration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#import <Foundation/Foundation.h>
9-
#import "UiCustomization.h"
9+
#import <CardinalMobile/UiCustomization.h>
1010
NS_ASSUME_NONNULL_BEGIN
1111

1212
/*!

Sources/dojo-ios-sdk/Libs/CardinalMobile.xcframework/ios-arm64/CardinalMobile.framework/Headers/CardinalThreeDS2ServiceImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#import <Foundation/Foundation.h>
9-
#import "ThreeDS2Service.h"
9+
#import <CardinalMobile/ThreeDS2Service.h>
1010

1111
@class ConfigParameters;
1212
@class UiCustomization;

0 commit comments

Comments
 (0)