Connect the stored security code input view to the StoredCardComponent#2476
Connect the stored security code input view to the StoredCardComponent#2476robertdalmeida wants to merge 11 commits intodevelopfrom
Conversation
…tored card payments
…ew controller initialization
…ntroller TODO comment
There was a problem hiding this comment.
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.
| // 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) |
There was a problem hiding this comment.
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.
| // 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) | |||
There was a problem hiding this comment.
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| @_spi(AdyenInternal) import AdyenUI | ||
| #if canImport(AdyenUI) | ||
| @_spi(AdyenInternal) import AdyenUI | ||
| #endif |
There was a problem hiding this comment.
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| // 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() |
There was a problem hiding this comment.
| } | ||
|
|
||
| private func configureConstraints() { | ||
| // TODO: Robert: StoredView: Autolayout Constraints breaks. This needs a separate investigation as this involves the FormCardSecurityCodeItemView |
|
ℹ️ No baseline data found for 'develop'.
|
…ow logical nesting order
✅ No changes detectedComparing Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay |
|
Will recreate this MR again once the other MR is merged. |
Summary [Required]
StoredCardInputViewControllerDemo [Required for UI changes]
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-01.at.11.30.29.mov
Checklist [Required]