From 2b5803e49e48bbe5194c5f47eccc8daac14e79f1 Mon Sep 17 00:00:00 2001 From: Precious OSSAI Date: Tue, 26 Mar 2024 16:15:03 +0000 Subject: [PATCH 1/2] feat: log correlationId on frames mode --- Sources/Risk/Logging/LoggerService.swift | 2 ++ Sources/Risk/Models/RiskSDKInternalConfig.swift | 2 ++ Sources/Risk/RiskSDKConfig.swift | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/Risk/Logging/LoggerService.swift b/Sources/Risk/Logging/LoggerService.swift index cc474d2..43742fd 100644 --- a/Sources/Risk/Logging/LoggerService.swift +++ b/Sources/Risk/Logging/LoggerService.swift @@ -69,6 +69,7 @@ extension LoggerServiceProtocol { case .published, .collected: properties = [ "Block": AnyCodable(latencyMetric.block), + "CorrelationId": AnyCodable(internalConfig.correlationId), "DeviceDataPersist": AnyCodable(latencyMetric.deviceDataPersist), "FpLoad": AnyCodable(latencyMetric.fpload), "FpPublish": AnyCodable(latencyMetric.fppublish), @@ -85,6 +86,7 @@ extension LoggerServiceProtocol { case .publishFailure, .loadFailure, .publishDisabled: properties = [ "Block": AnyCodable(latencyMetric.block), + "CorrelationId": AnyCodable(internalConfig.correlationId), "DeviceDataPersist": AnyCodable(latencyMetric.deviceDataPersist), "FpLoad": AnyCodable(latencyMetric.fpload), "FpPublish": AnyCodable(latencyMetric.fppublish), diff --git a/Sources/Risk/Models/RiskSDKInternalConfig.swift b/Sources/Risk/Models/RiskSDKInternalConfig.swift index 964f19b..7b2957b 100644 --- a/Sources/Risk/Models/RiskSDKInternalConfig.swift +++ b/Sources/Risk/Models/RiskSDKInternalConfig.swift @@ -15,11 +15,13 @@ struct RiskSDKInternalConfig { let sourceType: SourceType let framesMode: Bool let environment: RiskEnvironment + let correlationId: String init(config: RiskConfig) { merchantPublicKey = config.publicKey environment = config.environment framesMode = config.framesMode + correlationId = config.framesMode ? config.correlationId : "" integrationType = framesMode ? .inFrames : .standalone sourceType = framesMode ? .cardToken : .riskSDK diff --git a/Sources/Risk/RiskSDKConfig.swift b/Sources/Risk/RiskSDKConfig.swift index fa48193..3ad7fb4 100644 --- a/Sources/Risk/RiskSDKConfig.swift +++ b/Sources/Risk/RiskSDKConfig.swift @@ -19,10 +19,12 @@ public struct RiskConfig { let publicKey: String let environment: RiskEnvironment let framesMode: Bool + let correlationId: String - public init(publicKey: String, environment: RiskEnvironment, framesMode: Bool = false) { + public init(publicKey: String, environment: RiskEnvironment, framesMode: Bool = false, correlationId: String = "") { self.publicKey = publicKey self.environment = environment self.framesMode = framesMode + self.correlationId = correlationId } } From d958f7c7a80d93696492fe81160361c61510cd48 Mon Sep 17 00:00:00 2001 From: Precious OSSAI Date: Tue, 26 Mar 2024 16:20:05 +0000 Subject: [PATCH 2/2] feat(2.0.3): bump version --- .github/partial-readmes/Installation.md | 4 ++-- Risk.podspec | 2 +- Sources/Risk/Logging/Constants.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/partial-readmes/Installation.md b/.github/partial-readmes/Installation.md index 38bb0db..2a44acb 100644 --- a/.github/partial-readmes/Installation.md +++ b/.github/partial-readmes/Installation.md @@ -9,7 +9,7 @@ We've done our best to support the most common distribution methods on iOS. We a let package = Package( ... dependencies: [ - .package(url: "https://github.com/checkout/checkout-risk-sdk-ios", from: "2.0.2") + .package(url: "https://github.com/checkout/checkout-risk-sdk-ios", from: "") ] ... ) @@ -34,7 +34,7 @@ platform :ios, '12.0' use_frameworks! target '' do - pod 'Risk', '~> 2.0.2' + pod 'Risk', '~> ' end ``` diff --git a/Risk.podspec b/Risk.podspec index 4d36b30..7267e91 100644 --- a/Risk.podspec +++ b/Risk.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Risk" - s.version = "2.0.2" + s.version = "2.0.3" s.summary = "Checkout Risk package in Swift" s.description = <<-DESC Checkout Risk package in Swift. diff --git a/Sources/Risk/Logging/Constants.swift b/Sources/Risk/Logging/Constants.swift index 747d7f7..d0f6a7c 100644 --- a/Sources/Risk/Logging/Constants.swift +++ b/Sources/Risk/Logging/Constants.swift @@ -9,7 +9,7 @@ import Foundation enum Constants { static let productName = "risk-ios-sdk" - static let riskSdkVersion = "2.0.2" + static let riskSdkVersion = "2.0.3" static let userAgent = "checkout-sdk-risk-ios/\(riskSdkVersion)" static let loggerTypeIdentifier = "com.checkout.risk-mobile-sdk" }