Remove StoredCardAlertManager and switch to using StoredCardInputViewController#2503
Remove StoredCardAlertManager and switch to using StoredCardInputViewController#2503robertdalmeida wants to merge 14 commits intodevelopfrom
Conversation
…tead of alert-based UI
…toredCardInputViewModel
…oredCardInputViewController to PreselectedPaymentMethodRouter
…roperty in StoredCardInputViewModel
…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
…y and add TODO for AMEX CVC length handling
…stored-view-reduced-scope
…stored-view-reduced-scope
…r instead of UIAlertController
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
| self?.viewController.dismiss(animated: true) | ||
| } | ||
|
|
||
| self.sendInitialAnalytics() |
There was a problem hiding this comment.
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.
| self.sendInitialAnalytics() | |
| self.sendInitialAnalytics() | |
| self.sendDidLoadEvent() |
|
ℹ️ No baseline data found for 'develop'.
|
…validation and fix loading state handling
…n true after submit
|
| ❇️ | 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
Summary [Required]
Remove StoredCardAlertManager and switch to using StoredCardInputViewController
Whats next?
COSDK-1140
Checklist [Required]