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

[DRAFT] [Connect] Using FinancialConnections SDK in Connect #4159

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mludowise-stripe
Copy link
Collaborator

@mludowise-stripe mludowise-stripe commented Oct 18, 2024

Summary

Enables using the mobile native FinancialConnections SDK from Connect web components to retrieve the user's bank token.

  • Adds a dependency from StripeConnect -> StripeFinancialConnections
  • Adds a new JS message handler and sender to trigger the FinancialConnections flow from web and pass back the bank token:
    • openFinancialConnections message handler: Triggers the FinancialConnectionsSheet to open:
      • Param clientSecret: The Financial Connections Session client secret for the connected account
      • Param id: A unique UUID that gets passed back to the web layer on returnFromFinancialConnections
    • returnedFromFinancialConnections message sender: Returns the connected bank token to the web layer
      • Param bankToken: The bank account token of the connected account. This value will be null if the user canceled out of the flow or an error occurred
      • Param id: The id originally passed to the mobile layer from openFinancialConnections

Motivation

https://jira.corp.stripe.com/browse/MXMOBILE-2526
https://docs.google.com/document/d/1WUTvnK8kqsB00zcmUzwVC_CW5MMmXC_CDk8eQTAzaaQ

Testing

Demo video (turn on audio):
https://drive.google.com/file/d/1I7W559oCf10uVNPYvQADRukNzw3MK_zY

TODO

  • Confirm JS<>Mobile messaging layer shape
  • Unit test coverage for message handlers / senders

@mludowise-stripe mludowise-stripe changed the title [Connect] Using FinancialConnections SDK in Connect [DRAFT] [Connect] Using FinancialConnections SDK in Connect Oct 18, 2024
@mludowise-stripe mludowise-stripe force-pushed the mludowise/connect_financial_connections_prototype branch from a37d5e1 to 141c9d3 Compare October 18, 2024 18:08
Comment on lines 11 to 13
/// The linked bank account token.
/// This value will be nil if the user canceled the flow or an error occurred.
let bankToken: String?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alternatively, if we don't need to return the bank token, we could send a success | cancelled | failed enum value to the web view

Copy link

⚠️ Public API changes detected:

StripePaymentSheet

- public var paymentMethodLayout: StripePaymentSheet.PaymentSheet.PaymentMethodLayout
- public enum PaymentMethodLayout {
- case horizontal
- case vertical
- case automatic
- public static func == (a: StripePaymentSheet.PaymentSheet.PaymentMethodLayout, b: StripePaymentSheet.PaymentSheet.PaymentMethodLayout) -> Swift.Bool
- public func hash(into hasher: inout Swift.Hasher)
- public var hashValue: Swift.Int {
- get
- }
- }

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

@mludowise-stripe mludowise-stripe force-pushed the mludowise/connect_financial_connections_prototype branch from d4937c6 to 5ce1981 Compare October 18, 2024 21:25
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.

1 participant