Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ final class PaymentSheetAnalyticsHelper {
stpAssertionFailure("logShow() is not supported for embedded integration")
return
}
let isCustom = integrationShape == .flowController
if !isCustom {
let isFlowController = integrationShape == .flowController
if !isFlowController {
startTimeMeasurement(.checkout)
}
let event: STPAnalyticEvent = {
switch showingSavedPMList {
case true:
return isCustom ? .mcShowCustomSavedPM : .mcShowCompleteSavedPM
return isFlowController ? .mcShowCustomSavedPM : .mcShowCompleteSavedPM
case false:
return isCustom ? .mcShowCustomNewPM : .mcShowCompleteNewPM
return isFlowController ? .mcShowCustomNewPM : .mcShowCompleteNewPM
}
}()
log(event: event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ public final class EmbeddedPaymentElement {
self.analyticsHelper = analyticsHelper

analyticsHelper.logInitialized()
analyticsHelper.startTimeMeasurement(.checkout)
self.containerView.needsUpdateSuperviewHeight = { [weak self] in
guard let self else { return }
self.delegate?.embeddedPaymentElementDidUpdateHeight(embeddedPaymentElement: self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ extension PaymentSheet {
self.configuration = configuration
self.analyticsHelper = analyticsHelper
self.analyticsHelper.logInitialized()
self.analyticsHelper.startTimeMeasurement(.checkout)
self.viewController = Self.makeViewController(
configuration: configuration,
loadResult: loadResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ final class PaymentSheetLoader {
return true
}
}

var shouldStartCheckoutMeasurementOnLoad: Bool {
switch self {
case .paymentSheet, .embedded: // TODO(porter) Figure out when we want to start checkout measurement for embedded
return false
case .flowController:
return true
}
}
}

static func load(
Expand Down Expand Up @@ -180,9 +171,6 @@ final class PaymentSheetLoader {
guard !paymentMethodTypes.isEmpty else {
throw PaymentSheetError.noPaymentMethodTypesAvailable(intentPaymentMethods: elementsSession.orderedPaymentMethodTypes)
}
if integrationShape.shouldStartCheckoutMeasurementOnLoad {
analyticsHelper.startTimeMeasurement(.checkout)
}
Comment on lines -183 to -185
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been moved to the FlowController/Embedded initializer. There's no practical difference in the reported number, but this simplifies the code.


// Initialize telemetry. Don't wait for this to finish to return.
STPTelemetryClient.shared.sendTelemetryData()
Expand Down
Loading