Skip to content

feat(ad-hoc): support manual web fallback#524

Merged
andrii-vysotskyi-cko merged 14 commits into
masterfrom
feat/support-manual-web-fallback
Jun 2, 2026
Merged

feat(ad-hoc): support manual web fallback#524
andrii-vysotskyi-cko merged 14 commits into
masterfrom
feat/support-manual-web-fallback

Conversation

@andrii-vysotskyi-cko
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors web authentication and deep-link handling to support a manual web fallback for native alternative payments. The internal WebAuthenticationSession/WebAuthenticationRequest types are promoted to @_spi(PO) public POWebAuthenticationSession/POWebAuthenticationRequest and exposed on ProcessOut.shared. The native AP interactor now drives the web redirect itself via the web authentication session (so it can capture the return URL) and resolves deep-link return URLs locally instead of via global event observation in DefaultInvoicesService.

Changes:

  • Promote internal web auth types to @_spi(PO) public POWebAuthenticationSession/POWebAuthenticationRequest and expose ProcessOut.shared.webAuthenticationSession.
  • Drive the web redirect flow from NativeAlternativePaymentDefaultInteractor and forward the resulting URL via the new result field of PONativeAlternativePaymentRedirectResultV2; add resolveUrl on the service adapter / POInvoicesService.
  • Remove the global deep-link event plumbing (PONativeAlternativePaymentDeepLinkResolved/ResolutionFailedEvent and DefaultInvoicesService.observeEvents) in favor of the interactor handling PODeepLinkReceivedEvent directly.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Sources/ProcessOut/Sources/Sessions/WebAuthentication/POWebAuthenticationSession.swift New SPI public protocol replacing internal WebAuthenticationSession.
Sources/ProcessOut/Sources/Sessions/WebAuthentication/POWebAuthenticationRequest.swift New SPI public request type with public initializer.
Sources/ProcessOut/Sources/Sessions/WebAuthentication/WebAuthenticationSession.swift Old internal protocol removed.
Sources/ProcessOut/Sources/Sessions/WebAuthentication/WebAuthenticationRequest.swift Old internal struct removed.
Sources/ProcessOut/Sources/Sessions/WebAuthentication/ThrottledWebAuthenticationSessionDecorator.swift Updated to conform to the new SPI protocol.
Sources/ProcessOut/Sources/Sessions/WebAuthentication/DefaultWebAuthenticationSession.swift Updated to use the new SPI types.
Sources/ProcessOut/Sources/Api/ProcessOut.swift Exposes webAuthenticationSession on the singleton.
Sources/ProcessOut/Sources/Services/CustomerActions/DefaultCustomerActionsService.swift Uses new protocol type.
Sources/ProcessOut/Sources/Services/AlternativePayments/DefaultAlternativePaymentsService.swift Uses new protocol type.
Sources/ProcessOut/Sources/Services/Invoices/POInvoicesService.swift Adds SPI resolveUrl with default-throwing extension.
Sources/ProcessOut/Sources/Services/Invoices/DefaultInvoicesService.swift Implements resolveUrl; drops global deep-link event observation.
Sources/ProcessOut/Sources/Services/Invoices/Events/PONativeAlternativePaymentDeepLinkResolvedEvent.swift Event removed.
Sources/ProcessOut/Sources/Services/Invoices/Events/PONativeAlternativePaymentDeepLinkResolutionFailedEvent.swift Event removed.
Sources/ProcessOut/Sources/Repositories/Shared/Requests/AlternativePaymentV2/PONativeAlternativePaymentRedirectResultV2.swift Adds nested Result and result: Result? to carry the return URL.
Sources/ProcessOut/Sources/Repositories/Invoices/Requests/AlternativePaymentV2/PONativeAlternativePaymentUrlResolutionRequestV2.swift Adds public initializers for nested types.
Sources/ProcessOutUI/Sources/Modules/NativeAlternativePayment/Interactor/NativeAlternativePaymentDefaultInteractor.swift Switches dependency to POWebAuthenticationSession, drives web redirect, listens for PODeepLinkReceivedEvent, and routes resolution through the service adapter. Contains invalid ProcessOut::POWebAuthenticationSession syntax.
Sources/ProcessOutUI/Sources/Modules/NativeAlternativePayment/Interactor/Adapter/NativeAlternativePaymentServiceAdapter.swift Adds resolveUrl to the adapter protocol.
Sources/ProcessOutUI/Sources/Modules/NativeAlternativePayment/Interactor/Adapter/DefaultNativeAlternativePaymentServiceAdapter.swift Implements resolveUrl by delegating to invoices service.
Sources/ProcessOutUI/Sources/Modules/NativeAlternativePayment/Component/PONativeAlternativePaymentComponent.swift Wires webAuthenticationSession into the interactor.
Sources/ProcessOutUI/Sources/Modules/DynamicCheckout/Utils/ChildProvider/DynamicCheckoutInteractorDefaultChildProvider.swift Wires webAuthenticationSession into the interactor.
Tests/ProcessOutTests/Sources/Mocks/WebAuthenticationSession/MockWebAuthenticationSession.swift Mock updated to new protocol/request type names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

@andrii-vysotskyi-cko andrii-vysotskyi-cko merged commit f59a5ec into master Jun 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants