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 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