Skip to content

Connect the stored security code input view to the StoredCardComponent#2476

Closed
robertdalmeida wants to merge 11 commits intodevelopfrom
chore/connect-the-stored-view
Closed

Connect the stored security code input view to the StoredCardComponent#2476
robertdalmeida wants to merge 11 commits intodevelopfrom
chore/connect-the-stored-view

Conversation

@robertdalmeida
Copy link
Copy Markdown
Contributor

@robertdalmeida robertdalmeida commented Apr 1, 2026

Summary [Required]

  • Deleted the StoredCardAlertManager
  • Replaced it with the StoredCardInputViewController
  • Added some TODOs with some issues in this screen such as autolayout. This wasted a lot of time already.

Demo [Required for UI changes]

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-01.at.11.30.29.mov

Checklist [Required]

  • Tested changes locally
  • Added/updated unit tests
  • Verified against acceptance criteria

@robertdalmeida robertdalmeida self-assigned this Apr 1, 2026
@robertdalmeida robertdalmeida added the chore a pull request that has chore changes that shouldn't be in the release notes label Apr 1, 2026
Copy link
Copy Markdown
Contributor

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

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 StoredCardComponent by replacing the legacy alert-based interface with a dedicated StoredCardInputViewController and StoredCardInputViewModel. It also integrates theme support and updates related tests and project configurations. Feedback highlights several critical issues: wrapping the view controller in a UINavigationController may cause navigation conflicts, the inProgress state is not correctly reset after payment submission, and there are duplicated imports and broken autolayout constraints that need to be addressed before merging.

Comment on lines +69 to +70
// TODO: Robert: StoredView: I assume here is the right place to wrap it in a navigation. As StoredCardComponent can be used separately by the merchant. If this is not, where else should this be?
return UINavigationController(rootViewController: storedCardInputController)
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.

high

Wrapping the component's view controller in a UINavigationController can lead to nested navigation stacks when used within DropIn or other navigation-based containers. It is generally better to return the content view controller directly and let the consumer decide how to wrap or present it.

Suggested change
// TODO: Robert: StoredView: I assume here is the right place to wrap it in a navigation. As StoredCardComponent can be used separately by the merchant. If this is not, where else should this be?
return UINavigationController(rootViewController: storedCardInputController)
return storedCardInputController

@@ -160,7 +159,6 @@ internal final class StoredCardInputViewModel: StoredCardInputViewModelProtocol
resetSecurityCodeField()

await submitPayment(securityCode: securityCode)
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.

high

The inProgress flag is no longer reset to false after the payment submission completes. This will prevent the user from interacting with the UI (e.g., retrying or correcting input) if the submission fails or doesn't result in the screen being dismissed.

        await submitPayment(securityCode: securityCode)
        inProgress = false

Comment on lines +10 to +13
@_spi(AdyenInternal) import AdyenUI
#if canImport(AdyenUI)
@_spi(AdyenInternal) import AdyenUI
#endif
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.

medium

The import of AdyenUI is duplicated. Line 10 provides an unconditional import, while lines 11-13 provide a conditional one. It is recommended to use only the conditional import to maintain consistency and safety across different build configurations.

#if canImport(AdyenUI)
@_spi(AdyenInternal) import AdyenUI
#endif

Comment on lines +64 to +65
// TODO: Robert: This doesn't seem to a right place to trigger initialAnalytics(). As this is a lazy var. Maybe this could be moved elsewhere? - I don't know where as of yet.
self.sendInitialAnalytics()
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.

medium

Triggering sendInitialAnalytics() inside a lazy property initializer makes the analytics reporting dependent on when the viewController is first accessed. To ensure consistent tracking, consider moving this call to the initializer or a more deterministic lifecycle event.

}

private func configureConstraints() {
// TODO: Robert: StoredView: Autolayout Constraints breaks. This needs a separate investigation as this involves the FormCardSecurityCodeItemView
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.

medium

This TODO indicates that the autolayout constraints are currently broken. This issue should be resolved before merging to ensure the UI is stable and renders correctly on all devices.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenComponents.framework 2790 KB
AdyenActions.framework 2392 KB
AdyenDropIn.framework 1359 KB
AdyenDelegatedAuthentication.framework 98 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 262 KB
AdyenUI.framework 3311 KB
AdyenCardScanner.framework 694 KB
AdyenEncryption.framework 504 KB
AdyenSession.framework 750 KB
AdyenTwint.framework 278 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 2070 KB
AdyenCashAppPay.framework 1764 KB
AdyenCard.framework 1718 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5065 KB
total 28553 KB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

✅ No changes detected

Comparing chore/connect-the-stored-view to develop


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

@robertdalmeida
Copy link
Copy Markdown
Contributor Author

Will recreate this MR again once the other MR is merged.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant