diff --git a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTTemplates.swift b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTTemplates.swift index bdeebe6..e5b72a0 100644 --- a/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTTemplates.swift +++ b/WultraMobileTokenSDK/Operations/Model/UserOperation/WMTTemplates.swift @@ -318,6 +318,9 @@ public class WMTTemplates: Codable { /// Define if the cell should be collapsable public let collapsable: Collapsable? + /// If value should be centered + public let centered: Bool? + public enum Collapsable: String, Codable { /// The cell should not be collapsable case no = "NO" @@ -332,7 +335,7 @@ public class WMTTemplates: Codable { // MARK: - Internals private enum Keys: String, CodingKey { - case style, name, visibleTitle, canCopy, collapsable + case style, name, visibleTitle, canCopy, collapsable, centered } public required init(from decoder: Decoder) throws { @@ -382,14 +385,26 @@ public class WMTTemplates: Codable { } else { collapsable = nil } + + if c.contains(.centered) { + do { + centered = try c.decode(Bool.self, forKey: .centered) + } catch { + D.error("Failed to decode \(Keys.centered) - \(error), setting to null") + centered = nil + } + } else { + centered = nil + } } - public init(style: String?, name: AttributeId, visibleTitle: Bool?, canCopy: Bool?, collapsable: Collapsable?) { + public init(style: String?, name: AttributeId, visibleTitle: Bool?, canCopy: Bool?, collapsable: Collapsable?, centered: Bool?) { self.name = name self.style = style self.visibleTitle = visibleTitle self.canCopy = canCopy self.collapsable = collapsable + self.centered = centered } } } diff --git a/WultraMobileTokenSDKTests/IntegrationProxy.swift b/WultraMobileTokenSDKTests/IntegrationProxy.swift index b0497df..e8bffc5 100644 --- a/WultraMobileTokenSDKTests/IntegrationProxy.swift +++ b/WultraMobileTokenSDKTests/IntegrationProxy.swift @@ -31,7 +31,7 @@ class IntegrationProxy { typealias Callback = (_ error: String?) -> Void func prepareActivation(pin: String, callback: @escaping Callback) { - WPNLogger.verboseLevel = .debug + WPNLogger.verboseLevel = .all guard let configPath = Bundle.init(for: IntegrationProxy.self).path(forResource: "config", ofType: "json", inDirectory: "Configs") else { callback("Config file config.json is not present.") return diff --git a/WultraMobileTokenSDKTests/OperationUIDataTests.swift b/WultraMobileTokenSDKTests/OperationUIDataTests.swift index 953b051..0a404c6 100644 --- a/WultraMobileTokenSDKTests/OperationUIDataTests.swift +++ b/WultraMobileTokenSDKTests/OperationUIDataTests.swift @@ -212,6 +212,7 @@ class OperationUIDataTests: XCTestCase { XCTAssertEqual(uiResult.templates?.detail?.sections?[0].title, "operation.money.header") XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].style, nil) XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].name, "operation.amount") + XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].centered, true) XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].visibleTitle, false) XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].canCopy, true) XCTAssertEqual(uiResult.templates?.detail?.sections?[0].cells?[0].collapsable, .no) @@ -489,7 +490,8 @@ class OperationUIDataTests: XCTestCase { "visibleTitle": false, "style": null, "canCopy": true, - "collapsable": "NO" + "collapsable": "NO", + "centered": true }, { "style": "CONVERSION",