From 04157a6fa3d32c29a51e0372d214c188d93de514 Mon Sep 17 00:00:00 2001 From: Andrii Vysotskyi Date: Tue, 10 Nov 2026 21:26:57 +0100 Subject: [PATCH 1/2] fix(ad-hoc): send application name in telemetry metadata --- .../Sources/Services/Telemetry/DefaultTelemetryService.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ProcessOut/Sources/Services/Telemetry/DefaultTelemetryService.swift b/Sources/ProcessOut/Sources/Services/Telemetry/DefaultTelemetryService.swift index e8ab7a262..f49709778 100644 --- a/Sources/ProcessOut/Sources/Services/Telemetry/DefaultTelemetryService.swift +++ b/Sources/ProcessOut/Sources/Services/Telemetry/DefaultTelemetryService.swift @@ -93,7 +93,7 @@ final class DefaultTelemetryService: TelemetryService, @unchecked Sendable { private func telemetryMetadata(configuration: TelemetryServiceConfiguration) async -> Telemetry.Metadata { let application = Telemetry.ApplicationMetadata( - name: configuration.applicationVersion, version: configuration.applicationVersion + name: configuration.applicationName, version: configuration.applicationVersion ) let device: Telemetry.DeviceMetadata = await { let metadata = await deviceMetadataProvider.deviceMetadata From 5c0c864e187d3fb1bd914c864799d361d5ffc69f Mon Sep 17 00:00:00 2001 From: Andrii Vysotskyi Date: Tue, 10 Nov 2026 21:31:40 +0100 Subject: [PATCH 2/2] fix(ad-hoc): honour ephemeral web authentication session preference Forward prefersEphemeralWebAuthenticationSession when rebuilding invoice authorization and customer token assignment requests, so it no longer falls back to the default value. Also preserve localeIdentifier when rebuilding customer token assignment requests. Expose prefersEphemeralWebAuthenticationSession on POAssignCustomerTokenRequest instead of always using an ephemeral session. --- .../Sources/Generated/Sourcery+Generated.swift | 1 + .../Requests/POAssignCustomerTokenRequest.swift | 13 +++++++++++++ .../DefaultCustomerTokensService.swift | 6 ++++-- .../Services/Invoices/DefaultInvoicesService.swift | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Sources/ProcessOut/Sources/Generated/Sourcery+Generated.swift b/Sources/ProcessOut/Sources/Generated/Sourcery+Generated.swift index d77bda56a..51bea8ac0 100644 --- a/Sources/ProcessOut/Sources/Generated/Sourcery+Generated.swift +++ b/Sources/ProcessOut/Sources/Generated/Sourcery+Generated.swift @@ -25,6 +25,7 @@ extension POAssignCustomerTokenRequest { case enableThreeDS2 = "enable_three_d_s_2" case thirdPartySdkVersion case metadata + case prefersEphemeralWebAuthenticationSession case localeIdentifier } } diff --git a/Sources/ProcessOut/Sources/Repositories/CustomerTokens/Requests/POAssignCustomerTokenRequest.swift b/Sources/ProcessOut/Sources/Repositories/CustomerTokens/Requests/POAssignCustomerTokenRequest.swift index 125686687..b4ffcd8dc 100644 --- a/Sources/ProcessOut/Sources/Repositories/CustomerTokens/Requests/POAssignCustomerTokenRequest.swift +++ b/Sources/ProcessOut/Sources/Repositories/CustomerTokens/Requests/POAssignCustomerTokenRequest.swift @@ -52,6 +52,17 @@ public struct POAssignCustomerTokenRequest: Codable, Sendable { // sourcery: Aut @POExcludedEncodable public private(set) var webAuthenticationCallback: POWebAuthenticationCallback? // sourcery:coding:skip + /// A boolean value that indicates whether the web authentication session should ask the browser + /// for a private authentication session. + /// + /// Set `prefersEphemeralWebAuthenticationSession` to true to request that the browser + /// doesn’t share cookies or other browsing data between the authentication session + /// and the user’s normal browser session. + /// + /// The value of this property is `true` by default. + @POExcludedEncodable + public private(set) var prefersEphemeralWebAuthenticationSession: Bool + /// Customer's locale identifier override. public let localeIdentifier: String? @@ -67,6 +78,7 @@ public struct POAssignCustomerTokenRequest: Codable, Sendable { // sourcery: Aut thirdPartySdkVersion: String? = nil, metadata: [String: String]? = nil, webAuthenticationCallback: POWebAuthenticationCallback? = nil, + prefersEphemeralWebAuthenticationSession: Bool = true, localeIdentifier: String? = nil ) { self.customerId = customerId @@ -78,6 +90,7 @@ public struct POAssignCustomerTokenRequest: Codable, Sendable { // sourcery: Aut self.thirdPartySdkVersion = thirdPartySdkVersion self.metadata = metadata self.webAuthenticationCallback = webAuthenticationCallback + self.prefersEphemeralWebAuthenticationSession = prefersEphemeralWebAuthenticationSession self.localeIdentifier = localeIdentifier } } diff --git a/Sources/ProcessOut/Sources/Services/CustomerTokens/DefaultCustomerTokensService.swift b/Sources/ProcessOut/Sources/Services/CustomerTokens/DefaultCustomerTokensService.swift index c30e1c3fd..31060cd89 100644 --- a/Sources/ProcessOut/Sources/Services/CustomerTokens/DefaultCustomerTokensService.swift +++ b/Sources/ProcessOut/Sources/Services/CustomerTokens/DefaultCustomerTokensService.swift @@ -71,7 +71,7 @@ final class DefaultCustomerTokensService: POCustomerTokensService { let customerActionRequest = CustomerActionRequest( customerAction: customerAction, webAuthenticationCallback: request.webAuthenticationCallback, - prefersEphemeralWebAuthenticationSession: true + prefersEphemeralWebAuthenticationSession: request.prefersEphemeralWebAuthenticationSession ) let newSource = try await customerActionsService.handle( request: customerActionRequest, threeDSService: threeDSService @@ -107,7 +107,9 @@ private extension POAssignCustomerTokenRequest { // swiftlint:disable:this no_ex invoiceId: invoiceId, thirdPartySdkVersion: newSdkVersion ?? thirdPartySdkVersion, metadata: metadata, - webAuthenticationCallback: webAuthenticationCallback + webAuthenticationCallback: webAuthenticationCallback, + prefersEphemeralWebAuthenticationSession: prefersEphemeralWebAuthenticationSession, + localeIdentifier: localeIdentifier ) return updatedRequest } diff --git a/Sources/ProcessOut/Sources/Services/Invoices/DefaultInvoicesService.swift b/Sources/ProcessOut/Sources/Services/Invoices/DefaultInvoicesService.swift index 5e735c401..859b0b091 100644 --- a/Sources/ProcessOut/Sources/Services/Invoices/DefaultInvoicesService.swift +++ b/Sources/ProcessOut/Sources/Services/Invoices/DefaultInvoicesService.swift @@ -162,6 +162,7 @@ private extension POInvoiceAuthorizationRequest { // swiftlint:disable:this no_e clientSecret: clientSecret, metadata: metadata, webAuthenticationCallback: webAuthenticationCallback, + prefersEphemeralWebAuthenticationSession: prefersEphemeralWebAuthenticationSession, localeIdentifier: localeIdentifier ) return updatedRequest