Skip to content

[4/4] DropIn Actions: Present PaymentAction from the DropInRouter - #2744

Merged
nauaros merged 17 commits into
feature/dropin-payment-action-3from
feature/dropin-payment-action-4
Oct 1, 2026
Merged

nauaros merged 17 commits into
feature/dropin-payment-action-3from
feature/dropin-payment-action-4

Conversation

@nauaros

@nauaros nauaros commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Last of four PRs splitting the drop-in payment action work. Stacked on #2743 — review #2741, #2742 and #2743 first.

Summary

  • Actions were presented by whichever module happened to be on screen, each conforming to ActionPresenter and building its own container. The root router now owns action presentation through the payment action module added in [1/4] DropIn Actions: Add PaymentAction module to DropIn #2741, and the action is pushed onto the existing navigation stack instead of being presented on top of it. A web view manages its own navigation, so it is still presented modally.
  • The action router is kept out of childRouter, so presenting it does not release the module hierarchy below the root.
  • Dismissing an action dismisses the drop in, as there is no way back to the payment details of the selected payment method.
  • DropInFlowManager tracks the submission: the task is cancelled when the flow moves on, and an action that arrives when none is expected is ignored, for example when the drop in was closed while the payment was in flight.
  • Removes ActionNavigationController, ActionPresentationHelper and the per-module ActionPresenter conformances, so submit(_:from:) no longer carries a presenter.

Test plan

  • DropInRouterTests covers pushing onto the deepest module, the modal web view, that the child router is kept, and the dismissal
  • DropInFlowManagerTests covers the submission lifecycle, the ignored stale actions and the action presentation
  • Action presentation tests removed from the four modules that no longer present actions
  • xcodebuild test -testPlan CI green: 970 XCTest and 262 Swift Testing tests, with one pre-existing flake (FormCardNumberValidationTests.testUC7_ReenteringFieldRestoresLogos, passes in isolation and CI retries)

Ticket

CO-276

@nauaros nauaros added the chore a pull request that has chore changes that shouldn't be in the release notes label Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenComponents.framework 2574 KB
AdyenActions.framework 2327 KB
AdyenDropIn.framework 1952 KB
AdyenDelegatedAuthentication.framework 158 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 274 KB
AdyenUI.framework 3404 KB
AdyenCardScanner.framework 689 KB
AdyenEncryption.framework 506 KB
AdyenSession.framework 666 KB
AdyenTwint.framework 302 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 834 KB
AdyenCashAppPay.framework 1764 KB
AdyenCard.framework 1732 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5171 KB
total 27851 KB

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the presentation and handling of payment actions within the Drop-In component. It replaces the ActionPresenter protocol with a centralized routing mechanism via DropInFlowRouting and PaymentActionPresenting, allowing actions to be presented on the deepest active module of the drop-in. Additionally, DropInFlowManager now manages submission tasks asynchronously, and several router protocols have been simplified by removing redundant action presentation methods. While the refactoring is well-tested, a critical bug was identified in DropInRouter.swift where an assertion condition is inverted, which would cause unexpected assertion failures during normal execution.

Comment thread AdyenDropIn/Modules/Root/DropInRouter.swift
@nauaros
nauaros marked this pull request as draft September 24, 2026 14:58
@nauaros nauaros changed the title [4/4] DropIn Actions: Present payment actions from the root router [4/4] DropIn Actions: Present PaymentAction from the DropInRouter Sep 24, 2026
@nauaros nauaros self-assigned this Sep 24, 2026
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch from c038692 to 5a8b071 Compare September 24, 2026 15:56
@nauaros
nauaros added this pull request to stack #2746 September 24, 2026 16:15
@nauaros
nauaros marked this pull request as ready for review September 25, 2026 11:29
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch from 5a8b071 to 7e0ca50 Compare September 25, 2026 12:21
@nauaros
nauaros requested a review from erenbesel September 25, 2026 12:42
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch 3 times, most recently from a31968d to f167f9b Compare September 29, 2026 09:58
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch from f167f9b to 85b79b0 Compare September 29, 2026 14:44
nauaros and others added 9 commits September 30, 2026 12:10
Sourcery scanned the repository root, including the gitignored TempProject
directory that the Carthage integration tests leave behind. That directory
holds a stale copy of the SDK, so mocks were generated from the wrong
declarations, for example emitting `public` where the source says `package`.
Exclude it.

Also mark the generated mocks as generated so they collapse in review.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Introduces the module that hosts an action produced by a submitted payment:
assembler, router, view model and a container view controller.

Action components that manage their own navigation, such as the redirect
web view, are used as is. Everything else is embedded in a container that
owns the navigation item. The container offers a single trailing Done
button and suppresses back navigation, since the payment has already been
submitted and there is no way back to the payment details.

The module is not wired into the drop in flow yet.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…nt progress leftovers

The flow manager kept its own weak reference to the merchant delegate,
which goes stale when the delegate is set after the manager is built.
It now reads it from the drop in it already holds.

`paymentInProgress` had no writers and `userDidCancel` no callers left
after the cancellation moved into the flow manager, as did the
`stopLoading` call, which became a no-op once the drop in stopped
conforming to `LoadingComponent`.
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch from 85b79b0 to a1604ad Compare September 30, 2026 10:11
@nauaros
nauaros force-pushed the feature/dropin-payment-action-4 branch from a1604ad to b94f426 Compare September 30, 2026 11:58
The flow manager now presents actions on the root router itself, so the
view model no longer needs to act as an action presenter or route action
view controllers.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@robertdalmeida robertdalmeida left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, looking forward to this being merged as i think the StoredPayment Screen also would need to redirect its action handling to to the DropinRouter.

@erenbesel erenbesel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Much better looking this way! some comments

Comment thread AdyenDropIn/Modules/DropInFlowManager.swift Outdated
Comment thread AdyenDropIn/Modules/DropInFlowManager.swift Outdated
@nauaros
nauaros requested a review from erenbesel October 1, 2026 12:19
# Conflicts:
#	AdyenDropIn/Modules/DropInFlowManager.swift
…yment-action-4

# Conflicts:
#	AdyenDropIn/Modules/ComponentContainer/ComponentContainerRouter.swift
#	AdyenDropIn/Modules/DropInFlowManager.swift
#	AdyenDropIn/Modules/GenericPaymentMethod/GenericPaymentMethodRouter.swift
#	AdyenDropIn/Modules/Root/DropInRouter.swift
#	AdyenDropIn/Modules/StoredPaymentMethodContent/StoredPaymentMethodContentView.swift
#	Tests/GeneratedMocks/AutoMockable.generated.swift
#	Tests/IntegrationTests/DropIn Tests/DropInFlowManagerTests.swift
#	Tests/IntegrationTests/DropIn Tests/DropInRouterTests.swift
#	Tests/IntegrationTests/DropIn Tests/PaymentMethodList/PaymentMethodListRouterTests.swift
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ No changes detected

Comparing feature/dropin-payment-action-4 to feature/dropin-payment-action-3
Platform: iOS


Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay

@robertdalmeida robertdalmeida left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. ✅

@nauaros
nauaros added this pull request to the merge queue Oct 1, 2026
Merged via the queue into develop with commit b057701 Oct 1, 2026
17 checks passed
@nauaros
nauaros deleted the feature/dropin-payment-action-4 branch October 1, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a pull request that has chore changes that shouldn't be in the release notes size:large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants