Skip to content

Remove StoredCardAlertManager and switch to using StoredCardInputViewController#2503

Closed
robertdalmeida wants to merge 14 commits intodevelopfrom
chore/connect-the-stored-view-reduced-scope
Closed

Remove StoredCardAlertManager and switch to using StoredCardInputViewController#2503
robertdalmeida wants to merge 14 commits intodevelopfrom
chore/connect-the-stored-view-reduced-scope

Conversation

@robertdalmeida
Copy link
Copy Markdown
Contributor

Summary [Required]

Remove StoredCardAlertManager and switch to using StoredCardInputViewController

Whats next?

  • Fix bug 🐞 Constraints issue with the FormCardSecurityCodeItemView.
  • Fix bug 🐞 ScrollView not working with the keyboard.
  • Fix bug 🐞 Amex card should accept 4 digits
  • Fix bug 🐞 Validation issue with the FormCardSecurityItem - it accepts 4 digits even though UI accepts only 3.

COSDK-1140

Checklist [Required]

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

…oredCardInputViewController to PreselectedPaymentMethodRouter
…InputViewController verification test. As these tests are duplicated in StoredCardInputViewModel tests
…r as navigation is now handled by PreselectedPaymentMethodRouter
…onstant in StoredCardInputViewModel and PreselectedPaymentMethod tests
…per for UI interaction instead of direct UIAlertController manipulation
@robertdalmeida robertdalmeida self-assigned this Apr 22, 2026
@robertdalmeida robertdalmeida added the chore a pull request that has chore changes that shouldn't be in the release notes label Apr 22, 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 replaces the StoredCardAlertManager, which utilized a UIAlertController, with a new StoredCardInputViewController and StoredCardInputViewModel for processing stored card payments. The changes include project file updates, deprecation of related localization keys, and adjustments to the Drop-in routing logic. Feedback indicates that the removal of the back button logic prevents dismissal in standalone mode, a regression exists where the pay button is enabled without a security code, and a required analytics event call is missing in the new implementation.

configureContent()
setupBindings()
setupNavigationBackButton()
disableSwipeDownToDismissScreen()
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 removal of the back button logic (setupNavigationBackButton and backTapped) makes the StoredCardInputViewController non-dismissible when used as a standalone component. While the PreselectedPaymentMethodRouter in Drop-in now handles this manually, other consumers of StoredCardComponent will find the UI stuck. Furthermore, the closeHandler defined in StoredCardComponent is no longer triggered by any UI action within this view controller, rendering it unreachable.


XCTAssertTrue(proxy.securityCodeText?.isEmpty == true)
XCTAssertFalse(proxy.isPayButtonEnabled)
XCTAssertTrue(proxy.isPayButtonEnabled)
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 test assertion for isPayButtonEnabled has been changed from false to true while the security code is empty. This indicates a regression in validation logic; the pay button should remain disabled until a valid security code is entered, consistent with the previous implementation.

self?.viewController.dismiss(animated: true)
}

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

The call to sendDidLoadEvent() is missing in the new viewController initialization. This event was present in the previous StoredCardAlertManager implementation and is typically required for accurate analytics tracking when the component is loaded.

Suggested change
self.sendInitialAnalytics()
self.sendInitialAnalytics()
self.sendDidLoadEvent()

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenComponents.framework 2822 KB
AdyenActions.framework 2374 KB
AdyenDropIn.framework 1362 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 2100 KB
AdyenCashAppPay.framework 1764 KB
AdyenCard.framework 1715 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5066 KB
total 28598 KB

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 9 public changes detected ⚠️

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

❇️5 Additions
4 Removals

AdyenComponents

❇️ Added

public protocol ApplePayAuthorizationDelegate: AnyObject {
  func didAuthorize(
    payment: PassKit.PKPayment,
    completion: @escaping (PassKit.PKPaymentAuthorizationResult) -> Swift.Void
  ) -> Swift.Void
}
public protocol ApplePayComponentDelegate: AnyObject {
  func didUpdate(
    contact: PassKit.PKContact,
    for summaryItems: [PassKit.PKPaymentSummaryItem],
    completion: @escaping (PassKit.PKPaymentRequestShippingContactUpdate) -> Swift.Void
  ) -> Swift.Void
  func didUpdate(
    couponCode: Swift.String,
    for summaryItems: [PassKit.PKPaymentSummaryItem],
    completion: @escaping (PassKit.PKPaymentRequestCouponCodeUpdate) -> Swift.Void
  ) -> Swift.Void
  func didUpdate(
    shippingMethod: PassKit.PKShippingMethod,
    for summaryItems: [PassKit.PKPaymentSummaryItem],
    completion: @escaping (PassKit.PKPaymentRequestShippingMethodUpdate) -> Swift.Void
  ) -> Swift.Void
}

ApplePayComponent

❇️ Added

@_Concurrency.MainActor
weak public var applePayDelegate: (any AdyenComponents.ApplePayComponentDelegate)?
@_Concurrency.MainActor
weak public var authorizationDelegate: (any AdyenComponents.ApplePayAuthorizationDelegate)?

ApplePayComponent.Configuration

❇️ Added

public var dismissesAutomatically: Swift.Bool

❌ Removed

public var onAuthorize: (@_Concurrency.MainActor (PassKit.PKPayment) async -> PassKit.PKPaymentAuthorizationResult)?
public var onCouponCodeChange: (@_Concurrency.MainActor (Swift.String, [PassKit.PKPaymentSummaryItem]) async -> PassKit.PKPaymentRequestCouponCodeUpdate)?
public var onShippingContactChange: (@_Concurrency.MainActor (PassKit.PKContact, [PassKit.PKPaymentSummaryItem]) async -> PassKit.PKPaymentRequestShippingContactUpdate)?
public var onShippingMethodChange: (@_Concurrency.MainActor (PassKit.PKShippingMethod, [PassKit.PKPaymentSummaryItem]) async -> PassKit.PKPaymentRequestShippingMethodUpdate)?

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

@robertdalmeida robertdalmeida deleted the chore/connect-the-stored-view-reduced-scope branch April 23, 2026 07:00
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:medium size:small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant