Skip to content

Commit

Permalink
Removed experimentType
Browse files Browse the repository at this point in the history
  • Loading branch information
stechiu committed Dec 18, 2024
1 parent 2cc089a commit c1461f6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
5 changes: 0 additions & 5 deletions Sources/BraintreeCore/Analytics/FPTIBatchData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ struct FPTIBatchData: Codable {
let endTime: Int?
let errorDescription: String?
let eventName: String
/// The experiment type that is sent to analytics to help improve the Shopper Insights feature experience.
let experimentType: String?
/// True if the `BTConfiguration` was retrieved from local cache after `tokenize()` call.
/// False if the `BTConfiguration` was fetched remotely after `tokenize()` call.
let isConfigFromCache: Bool?
Expand Down Expand Up @@ -81,7 +79,6 @@ struct FPTIBatchData: Codable {
endTime: Int? = nil,
errorDescription: String? = nil,
eventName: String,
experimentType: String? = nil,
isConfigFromCache: Bool? = nil,
isVaultRequest: Bool? = nil,
linkType: String? = nil,
Expand All @@ -102,7 +99,6 @@ struct FPTIBatchData: Codable {
self.endTime = endTime
self.errorDescription = errorDescription
self.eventName = eventName
self.experimentType = experimentType
self.isConfigFromCache = isConfigFromCache
self.isVaultRequest = isVaultRequest
self.linkType = linkType
Expand All @@ -123,7 +119,6 @@ struct FPTIBatchData: Codable {
case correlationID = "correlation_id"
case errorDescription = "error_desc"
case eventName = "event_name"
case experimentType = "experiment_type"
case isConfigFromCache = "config_cached"
case isVaultRequest = "is_vault"
case linkType = "link_type"
Expand Down
4 changes: 1 addition & 3 deletions Sources/BraintreeCore/BTAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,10 @@ import Foundation
buttonType: String? = nil,
correlationID: String? = nil,
errorDescription: String? = nil,
experimentType: String? = nil,
merchantExperiment: String? = nil,
isConfigFromCache: Bool? = nil,
isVaultRequest: Bool? = nil,
linkType: LinkType? = nil,
merchantExperiment: String? = nil,
pageType: String? = nil,
paymentMethodsDisplayed: String? = nil,
payPalContextID: String? = nil,
Expand All @@ -326,7 +325,6 @@ import Foundation
correlationID: correlationID,
errorDescription: errorDescription,
eventName: eventName,
experimentType: experimentType,
isConfigFromCache: isConfigFromCache,
isVaultRequest: isVaultRequest,
linkType: linkType?.rawValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class BTShopperInsightsClient {
BTShopperInsightsAnalytics.buttonPresented,
buttonOrder: presentmentDetails.buttonOrder.rawValue,
buttonType: buttonType.rawValue,
experimentType: presentmentDetails.experimentType.formattedExperiment,
merchantExperiment: presentmentDetails.experimentType.formattedExperiment,
pageType: presentmentDetails.pageType.rawValue,
shopperSessionID: shopperSessionID
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class BTShopperInsightsClient_Tests: XCTestCase {
XCTAssertEqual(mockAPIClient.postedAnalyticsEvents.first, "shopper-insights:button-presented")
XCTAssertEqual(mockAPIClient.postedButtonOrder, 0)
XCTAssertEqual(mockAPIClient.postedButtonType, "PayPal")
XCTAssertEqual(mockAPIClient.postedExperimentType,
XCTAssertEqual(mockAPIClient.postedMerchantExperiment,
"""
[
{ "exp_name" : "PaymentReady" }
Expand All @@ -242,7 +242,7 @@ class BTShopperInsightsClient_Tests: XCTestCase {
XCTAssertEqual(mockAPIClient.postedAnalyticsEvents.first, "shopper-insights:button-presented")
XCTAssertEqual(mockAPIClient.postedButtonOrder, 0)
XCTAssertEqual(mockAPIClient.postedButtonType, "Venmo")
XCTAssertEqual(mockAPIClient.postedExperimentType,
XCTAssertEqual(mockAPIClient.postedMerchantExperiment,
"""
[
{ "exp_name" : "PaymentReady" }
Expand Down
5 changes: 1 addition & 4 deletions UnitTests/BraintreeTestShared/MockAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class MockAPIClient: BTAPIClient {
public var postedAppSwitchURL: [String: String?] = [:]
public var postedButtonOrder: Int? = nil
public var postedButtonType: String? = nil
public var postedExperimentType: String? = nil
public var postedIsVaultRequest = false
public var postedLinkType: LinkType? = nil
public var postedMerchantExperiment: String? = nil
Expand Down Expand Up @@ -103,19 +102,17 @@ public class MockAPIClient: BTAPIClient {
buttonType: String? = nil,
correlationID: String? = nil,
errorDescription: String? = nil,
experimentType: String? = nil,
merchantExperiment experiment: String? = nil,
isConfigFromCache: Bool? = nil,
isVaultRequest: Bool? = nil,
linkType: LinkType? = nil,
merchantExperiment experiment: String? = nil,
pageType: String? = nil,
paymentMethodsDisplayed: String? = nil,
payPalContextID: String? = nil,
shopperSessionID: String? = nil
) {
postedButtonType = buttonType
postedButtonOrder = buttonOrder
postedExperimentType = experimentType
postedPageType = pageType
postedPayPalContextID = payPalContextID
postedLinkType = linkType
Expand Down

0 comments on commit c1461f6

Please sign in to comment.