diff --git a/Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift b/Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift index 65b4bc171c3..8b2bf6a9f0f 100644 --- a/Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift +++ b/Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift @@ -830,6 +830,7 @@ extension PlaygroundController { "link_mode": settings.linkEnabledMode.rawValue, "use_manual_confirmation": settings.integrationType == .deferred_mc, "require_cvc_recollection": settings.requireCVCRecollection == .on, + "is_confirmation_token": settings.integrationType == .deferred_csc_ct || settings.integrationType == .deferred_ssc_ct, "customer_session_component_name": "mobile_payment_element", "customer_session_payment_method_save": settings.paymentMethodSave.rawValue, "customer_session_payment_method_remove": settings.paymentMethodRemove.rawValue, diff --git a/StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift b/StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift index 0c8c9431738..4cf8768d7d5 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift @@ -449,7 +449,7 @@ final class PaymentSheetAnalyticsHelper { additionalParams["setup_future_usage"] = intent?.setupFutureUsageString additionalParams["payment_method_options_setup_future_usage"] = intent?.isPaymentMethodOptionsSetupFutureUsageSet additionalParams["elements_session_config_id"] = elementsSession?.sessionID - + additionalParams["is_confirmation_tokens"] = intent?.intentConfig?.confirmationTokenConfirmHandler != nil if event.shouldLogFcSdkAvailability { additionalParams["fc_sdk_availability"] = FinancialConnectionsSDKAvailability.analyticsValue } diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift index 5d964518214..d5ff9921398 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift @@ -24,11 +24,6 @@ extension PaymentSheet { radarOptions: STPRadarOptions? = nil, completion: @escaping (PaymentSheetResult, STPAnalyticsClient.DeferredIntentConfirmationType?) -> Void ) { - // Assert that exactly one confirm handler is populated - let hasConfirmHandler = intentConfig.confirmHandler != nil - let hasConfirmationTokenHandler = intentConfig.confirmationTokenConfirmHandler != nil - stpAssert(hasConfirmHandler != hasConfirmationTokenHandler, "Exactly one confirm handler should be set (either confirmHandler or confirmationTokenConfirmHandler, but not both or neither)") - // Route based on which handler is available in the intent configuration if intentConfig.confirmationTokenConfirmHandler != nil { guard let elementsSession else { diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift index 87cd78dc022..6af4575f8bc 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift @@ -171,7 +171,9 @@ private class ApplePayContextClosureDelegate: NSObject, ApplePayContextDelegate Task { do { // Create the confirmation token - let confirmationToken = try await context.apiClient.createConfirmationToken(with: confirmationTokenParams, ephemeralKeySecret: nil) + let confirmationToken = try await context.apiClient.createConfirmationToken(with: confirmationTokenParams, + ephemeralKeySecret: nil, + additionalPaymentUserAgentValues: PaymentSheet.makeDeferredPaymentUserAgentValue(intentConfiguration: intentConfig)) // Call the confirmation token handler await MainActor.run {