Skip to content

[v6] (1/2) BACS Direct Debit: Remove confirmation screen#2597

Open
nauaros wants to merge 19 commits into
feature/COSDK-1284_Remove_confirmation_screen_BACSfrom
chore/BACS_remove_confirmation_screen
Open

[v6] (1/2) BACS Direct Debit: Remove confirmation screen#2597
nauaros wants to merge 19 commits into
feature/COSDK-1284_Remove_confirmation_screen_BACSfrom
chore/BACS_remove_confirmation_screen

Conversation

@nauaros

@nauaros nauaros commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR removes the confirmation screen from the BACSDirectDebitComponent, turning it into a single-screen component. This aligns BACS with the rest of our payment components (like SEPA and ACH), simplifies the user experience, and reduces checkout friction.

Key Changes

  • Single-Screen Flow: Users now submit payments directly from the input form.
  • submit() Method Support: Form validation and submission can now be triggered programmatically via the submit() function.
  • Custom Button Support: Enables seamless integration with custom submit buttons.

Demo

Before After
BACS_v5.mov
BACS_v6.mov

Ticket

COSDK-1284

Checklist [Required]

  • Tested changes locally
  • Added/updated unit tests (Follow up PR)
  • Verified against acceptance criteria
  • Aligned public API changes with other platforms (if applicable)

@nauaros nauaros self-assigned this Jun 16, 2026
@nauaros nauaros added the chore a pull request that has chore changes that shouldn't be in the release notes label Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

ℹ️ No baseline data found for 'feature/COSDK-1284_Remove_confirmation_screen_BACS'.

Framework Size
AdyenComponents.framework 2472 KB
AdyenActions.framework 2364 KB
AdyenDropIn.framework 1373 KB
AdyenDelegatedAuthentication.framework 158 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 274 KB
AdyenUI.framework 3272 KB
AdyenCardScanner.framework 689 KB
AdyenEncryption.framework 506 KB
AdyenSession.framework 674 KB
AdyenTwint.framework 263 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 2377 KB
AdyenCashAppPay.framework 1764 KB
AdyenCard.framework 1685 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5169 KB
total 28538 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 BACS Direct Debit component to use an MVVM architecture, introducing BACSViewController and BACSViewModel while removing the previous presenter-router pattern and the confirmation screen. It also updates the form UI components to support existential any FormItem types. The review feedback highlights several critical compilation errors in the tests, a missing shopperEmail property and parameter in BACSDirectDebitDetails, a potential silent failure in performSubmit(), unnecessary use of @Published in the view model, and opportunities to reduce code duplication in the form view manager and controller.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread AdyenComponents/BACS Direct Debit/BACSDirectDebitComponent.swift
Comment thread AdyenUI/UI/Form/FormViewController.swift Outdated
Comment thread AdyenUI/UI/Form/FormViewItemManager.swift Outdated
@nauaros nauaros closed this Jun 16, 2026
@Adyen Adyen deleted a comment from gemini-code-assist Bot Jun 16, 2026
@Adyen Adyen deleted a comment from gemini-code-assist Bot Jun 16, 2026
@nauaros nauaros reopened this Jun 16, 2026
@nauaros

nauaros commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 BACS Direct Debit component by removing the confirmation screen and transitioning to a view model-based architecture using BACSViewModel and BACSViewController. However, several critical compilation errors were introduced in the integration tests due to references to undefined protocols, private properties, and removed properties. Additionally, the shopper's email address is collected but not propagated to the backend, and the items array in BACSViewModel should be simplified to a non-optional array using compactMap to avoid unnecessary optional-handling helpers in FormViewController.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread AdyenComponents/BACS Direct Debit/BACSViewModel.swift
Comment thread AdyenComponents/BACS Direct Debit/BACSViewModel.swift
Comment thread AdyenComponents/BACS Direct Debit/BACSViewModel.swift Outdated
Comment thread AdyenComponents/BACS Direct Debit/BACSViewModel.swift Outdated
Comment thread AdyenComponents/BACS Direct Debit/BACSViewController.swift Outdated
Comment thread AdyenUI/UI/Form/FormViewController+ViewProtocol.swift Outdated
@Adyen Adyen deleted a comment from gemini-code-assist Bot Jun 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ 2 public changes detected ⚠️

Comparing chore/BACS_remove_confirmation_screen to feature/COSDK-1284_Remove_confirmation_screen_BACS
Platform: iOS

❇️1 Addition
🔀1 Modification

AdyenComponents

BACSDirectDebitDetails

❇️ Added

public let shopperEmail: Swift.String? { get }

🔀 Modified

// From
public init(
  paymentMethod: Adyen.BACSDirectDebitPaymentMethod,
  holderName: Swift.String,
  bankAccountNumber: Swift.String,
  bankLocationId: Swift.String
)

// To
public init(
  paymentMethod: Adyen.BACSDirectDebitPaymentMethod,
  holderName: Swift.String,
  bankAccountNumber: Swift.String,
  bankLocationId: Swift.String,
  shopperEmail: Swift.String? = nil
)

/**
Changes:
- Added parameter `shopperEmail: Swift.String? = nil`
*/

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

@nauaros nauaros marked this pull request as ready for review June 16, 2026 17:43
@nauaros nauaros changed the title [v6] BACS Direct Debit: Remove confirmation screen [v6] (1/2) BACS Direct Debit: Remove confirmation screen Jun 17, 2026
// MARK: - PresentableComponent

package let viewController: UIViewController
package lazy var viewController: UIViewController = {

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.

Doesn't this approach limit our testing capabilities? Passing a mock view controller could help us cover the lifecycle events if needed.


// MARK: - Private

private func createViewController() -> UIViewController {

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.

Can we think of extracting assembly code from the payment business logic to another assembly/provider/factory?

import Combine
import UIKit

internal final class BACSViewController: FormViewController {

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.

I noticed #if canImport(AdyenUI) bracket in the imports section, but it's missing from here where we actually use the FormViewController itself.

import Adyen
#if canImport(AdyenUI)
import AdyenUI
@_spi(AdyenInternal) import class AdyenUI.FormTextInputItem

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.

This makes view model impossible to reuse when(if) we migrate to SwiftUI without code changes.

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.

Or maybe there is a way to decouple FormTextInputItem from AdyenUI, as we treat item as a business logic layer model. Just a thought for future decisions.

return
}

guard let holderName = holderNameItem?.value,

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.

this code section does exactly what the prior one promised - validation.
If we have to rely of FormViewController validation, then we can extract local validation rules to a separate method that in turn will call validateForm()

submitButtonItem?.showsActivityIndicator = true
}

private func createItems() -> [any FormItem] {

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.

Extracting helper methods to a separate extension would make code easier to read (can be skipped honestly)

@atmamont atmamont 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.

Architecture choice seems to be a bit verbose for the task, with some concerns regarding future adoption of SwiftUI. Happy to discuss it later, these are non-blocking thoughts.


override internal func viewDidLoad() {
super.viewDidLoad()
viewModel.viewDidLoad()

@robertdalmeida robertdalmeida Jun 19, 2026

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.

thought;
i think if we need to inform the viewModel that controller finished/"did" load, it should be at the end of this method after doing everything? (to avoid any timing issues).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants