-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Connect] Using FinancialConnections SDK in Connect #4159
[Connect] Using FinancialConnections SDK in Connect #4159
Conversation
Example/StripeConnectExample/StripeConnectExample/MainViewController.swift
Outdated
Show resolved
Hide resolved
StripeConnect/StripeConnect/Source/EmbeddedComponentManager.swift
Outdated
Show resolved
Hide resolved
StripeFinancialConnections/StripeFinancialConnections/Source/Common/HostController.swift
Outdated
Show resolved
Hide resolved
Example/StripeConnectExample/StripeConnect Example.xcodeproj/project.pbxproj
Outdated
Show resolved
Hide resolved
a37d5e1
to
141c9d3
Compare
.../StripeConnect/Source/Internal/Webview/MessageSenders/ReturnedFromFinancialConnections.swift
Outdated
Show resolved
Hide resolved
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:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
d4937c6
to
5ce1981
Compare
6 builds increased size
StripeSize 1.0 (1)
|
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 432 B |
StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 828 B (0.05%)
Total download size change: ⬆️ 621 B (0.13%)
Largest size changes
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 24 B |
StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 828 B (0.02%)
Total download size change: ⬆️ 384 B (0.03%)
Largest size changes
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 24 B |
StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 820 B (0.02%)
Total download size change: ⬆️ 234 B (0.02%)
Largest size changes
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 16 B |
StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 820 B (0.01%)
Total download size change: ⬆️ 612 B (0.03%)
Largest size changes
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 16 B |
StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize
⚖️ Compare build
⏱️ Analyze build performance
Total install size change: ⬆️ 820 B
Total download size change: ⬆️ 721 B (0.02%)
Largest size changes
Item | Install Size Change |
---|---|
📝 StripeCore.STPAPIClient.makeCopy | ⬆️ 804 B |
Other | ⬆️ 16 B |
🛸 Powered by Emerge Tools
update comment comment Remove returnUrl and use presentForToken revert accidental change test coverage rebase fixes Add test dependencies Update financial connections to accept Connected Account Id makeCopy
5556d61
to
78dfb21
Compare
authenticatedWebViewManager: AuthenticatedWebViewManager = .init(), | ||
financialConnectionsPresenter: FinancialConnectionsPresenter = .init() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to second guess whether these should have default values or not. I'm worried that one day we will do a handoff to a new ConnectComponentWebViewController instance and not provide the existing managers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we end up having that future case, then I agree we should stop configuring default values here since it could lead to issues. But given that we don't have that case today and these are only explicitly set for test injection, I'm not too concerned about it right now.
// Make a copy before modifying so we don't unexpectedly modify the shared API client | ||
financialConnectionsSheet.apiClient = apiClient.makeCopy() | ||
financialConnectionsSheet.apiClient.stripeAccount = connectedAccountId | ||
return await withCheckedContinuation { continuation in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to check to see if we have weighed the pros and cons of checked vs unchecked continuation here. If we stick with checked then this will cause a crash if resume is called more than once. It shouldn't get called more than once in this instance, but maybe we can add some extra protections here to ensure we don't call resume more than once and instead of crashing we log an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't spend too much time thinking about it in this instance since it shouldn't be possible for it to get called more than once. I don't think we have a strong opinion as to which to use the SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that's ok, I don't think this should be a blocker or anything. Just wanted to call out that we have been bitten by this before. Especially within an SDK it would be ideal to not crash on a programmer error like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FC integration looks good to me!
Summary
Enables using the mobile native FinancialConnections SDK from Connect web components to retrieve the user's bank token.
StripeConnect
->StripeFinancialConnections
openFinancialConnections
message handler: Triggers the FinancialConnectionsSheet to open:clientSecret
: The Financial Connections Session client secret for the connected accountconnectedAccountId
: The ID of the connected accountid
: A unique UUID that gets passed back to the web layer onreturnFromFinancialConnections
returnedFromFinancialConnections
message sender: Returns the connected bank token to the web layerbankToken
: The bank account token of the connected account. This value will be null if the user canceled out of the flow or an error occurredid
: Theid
originally passed to the mobile layer fromopenFinancialConnections
Motivation
https://jira.corp.stripe.com/browse/MXMOBILE-2526
https://docs.google.com/document/d/1WUTvnK8kqsB00zcmUzwVC_CW5MMmXC_CDk8eQTAzaaQ
Testing
CleanShot.2024-12-11.at.16.41.29.mp4