Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link v3: Add support for 2FA Modal and FlowController  #4227

Draft
wants to merge 6 commits into
base: relink/passthrough
Choose a base branch
from

Conversation

davidme-stripe
Copy link
Contributor

@davidme-stripe davidme-stripe commented Nov 5, 2024

Summary

  • Show the 2FA modal before showing the list of payment methods. Allow this to be disabled by a server-side flag.
  • Enable Link in FlowController by bringing back the PayWithNativeLinkController. This can be used separately to confirm a Link payment.
  • We pass through the AnalyticsHelper from PaymentSheet when using it.

Motivation

Enabling FlowController in Link v3.

Testing

PaymentSheet Example, will add end-to-end tests

Changelog

None yet

@davidme-stripe davidme-stripe changed the title Relink/flowcontroller Link v3: Add support for FlowController Nov 8, 2024
@davidme-stripe davidme-stripe changed the base branch from master to relink/passthrough November 8, 2024 22:33
@davidme-stripe davidme-stripe changed the title Link v3: Add support for FlowController Link v3: Add support for 2FA Modal and FlowController  Nov 8, 2024
Comment on lines 42 to 49
if configuration.forceEnableNativeLink &&
self.supportsLink &&
linkAccount.sessionState == .requiresVerification &&
!linkAccount.hasStartedSMSVerification &&
self.linkSettings?.suppress2FAModal != true {
return true
}
return false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove if and just return

        return configuration.forceEnableNativeLink && ...

Copy link
Contributor Author

@davidme-stripe davidme-stripe Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Thanks!

let keyWindow = UIApplication.shared.windows.first(where: { $0.isKeyWindow }),
let presentedViewController = keyWindow.findTopMostPresentedViewController()
else {
assertionFailure("No key window with view controller found")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stpAssertionFailure

verificationController.present(from: self.bottomSheetViewController) { result in
switch result {
case .completed:
self.presentPayWithNativeLinkController(from: self.bottomSheetViewController, intent: loadResult.intent, elementsSession: loadResult.elementsSession, shouldOfferApplePay: true, shouldFinishOnClose: false) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would have expected shouldOfferApplePay to come from our configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants