From e56fb986ae5ef7ee11ecc4382536854198713728 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Wed, 24 Sep 2025 14:17:42 -0400 Subject: [PATCH] Delay display of continue state in FC --- .../PartnerAuthViewController.swift | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift index 14fc1fca292f..cf128a2ac30e 100644 --- a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift +++ b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift @@ -311,27 +311,34 @@ final class PartnerAuthViewController: SheetViewController { ) return } - let continueStateViews = ContinueStateViews( - institutionImageUrl: institution.icon?.default, - appearance: dataSource.manifest.appearance, - didSelectContinue: { [weak self] in - guard let self else { return } - self.dataSource.analyticsClient.log( - eventName: "click.apptoapp.continue", - pane: .partnerAuth - ) - self.openInstitutionAuthenticationNativeRedirect(authSession: authSession) - }, - didSelectCancel: { [weak self] in - guard let self else { return } - self.delegate?.partnerAuthViewControllerDidRequestToGoBack(self) - } - ) - self.continueStateViews = continueStateViews - setup( - withContentView: continueStateViews.contentView, - footerView: continueStateViews.footerView - ) + + let setContinueState = { [weak self] in + // Update the view to indicate to the user that they can continue linking their bank account + // in their banking app. They shouldn't ever see this unless they exit their banking app and + // return to the merchant app. + guard let self else { return } + let continueStateViews = ContinueStateViews( + institutionImageUrl: institution.icon?.default, + appearance: dataSource.manifest.appearance, + didSelectContinue: { [weak self] in + guard let self else { return } + self.dataSource.analyticsClient.log( + eventName: "click.apptoapp.continue", + pane: .partnerAuth + ) + self.openInstitutionAuthenticationNativeRedirect(authSession: authSession) + }, + didSelectCancel: { [weak self] in + guard let self else { return } + self.delegate?.partnerAuthViewControllerDidRequestToGoBack(self) + } + ) + self.continueStateViews = continueStateViews + self.setup( + withContentView: continueStateViews.contentView, + footerView: continueStateViews.footerView + ) + } subscribeToURLAndAppActiveNotifications() UIApplication.shared.open( @@ -339,7 +346,8 @@ final class PartnerAuthViewController: SheetViewController { options: [.universalLinksOnly: true] ) { (didOpenBankingApp) in guard !didOpenBankingApp else { - // we pass control to the bank app + // we did pass control to the bank app + setContinueState() return } // if we get here, it means the banking app is not installed