diff --git a/CHANGELOG.md b/CHANGELOG.md index bb9e30548..ff8a0563d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * BraintreeVenmo * Send `url` in `event_params` for App Switch events to PayPal's analytics service (FPTI) * BraintreeShopperInsights (BETA) - * Send `sessionID` to PayPal's analytics service (FPTI) + * Add `shopperSessionID` to `BTShopperInsightsClient` initializer * Add `isPayPalAppInstalled()` and/or `isVenmoAppInstalled()` ## 6.24.0 (2024-10-15) diff --git a/Sources/BraintreeCore/Analytics/FPTIBatchData.swift b/Sources/BraintreeCore/Analytics/FPTIBatchData.swift index fdf923ce3..f986717b6 100644 --- a/Sources/BraintreeCore/Analytics/FPTIBatchData.swift +++ b/Sources/BraintreeCore/Analytics/FPTIBatchData.swift @@ -53,6 +53,7 @@ struct FPTIBatchData: Codable { /// Used for linking events from the client to server side request /// This value will be PayPal Order ID, Payment Token, EC token, Billing Agreement, or Venmo Context ID depending on the flow let payPalContextID: String? + /// UTC millisecond timestamp when a networking task started requesting a resource. See [Apple's docs](https://developer.apple.com/documentation/foundation/urlsessiontasktransactionmetrics#3162615). let requestStartTime: Int? /// UTC millisecond timestamp when a networking task initiated. @@ -177,7 +178,7 @@ struct FPTIBatchData: Codable { let platform = "iOS" - /// This value should be the shopper session ID returned from your server SDK request + /// Either a randomly generated session ID or the shopper session ID passed in by a merchant let sessionID: String let tokenizationKey: String? diff --git a/Sources/BraintreeShopperInsights/BTShopperInsightsClient.swift b/Sources/BraintreeShopperInsights/BTShopperInsightsClient.swift index b78753dc2..597b5e5b7 100644 --- a/Sources/BraintreeShopperInsights/BTShopperInsightsClient.swift +++ b/Sources/BraintreeShopperInsights/BTShopperInsightsClient.swift @@ -21,8 +21,8 @@ public class BTShopperInsightsClient { /// Creates a `BTShopperInsightsClient` /// - Parameters: - /// - `apiClient`: A `BTAPIClient` instance. - /// - `shopperSessionID`: This value should be the shopper session ID returned from your server SDK request + /// - apiClient: A `BTAPIClient` instance. + /// - shopperSessionID: This value should be the shopper session ID returned from your server SDK request /// - Warning: This features only works with a client token. public init(apiClient: BTAPIClient, shopperSessionID: String? = nil) { self.apiClient = apiClient diff --git a/UnitTests/BraintreeShopperInsightsTests/BTShopperInsightsClient_Tests.swift b/UnitTests/BraintreeShopperInsightsTests/BTShopperInsightsClient_Tests.swift index 8af9d1c18..a77190fa6 100644 --- a/UnitTests/BraintreeShopperInsightsTests/BTShopperInsightsClient_Tests.swift +++ b/UnitTests/BraintreeShopperInsightsTests/BTShopperInsightsClient_Tests.swift @@ -223,7 +223,7 @@ class BTShopperInsightsClient_Tests: XCTestCase { XCTAssertEqual(mockAPIClient.postedAnalyticsEvents.first, "shopper-insights:venmo-presented") } - func testSendVenmoSelectedEvent() { + func testSendVenmoSelectedEvent_sendsAnalytic() { sut.sendVenmoSelectedEvent() XCTAssertEqual(mockAPIClient.postedAnalyticsEvents.first, "shopper-insights:venmo-selected") }