Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stechiu committed Dec 6, 2024
1 parent 8f707b9 commit 6a50427
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Sources/BraintreeCore/Analytics/FPTIBatchData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 6a50427

Please sign in to comment.