-
Notifications
You must be signed in to change notification settings - Fork 951
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
Instant Debits: first iteration of Instant Debits in Payment Sheet #3528
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 3 additions & 33 deletions
36
...ns Bindings/ConnectionsSDKInterface.swift → ... Bindings/FinancialConnectionsEvent.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
StripeCore/StripeCore/Source/Connections Bindings/FinancialConnectionsLinkedBank.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// FinancialConnectionsLinkedBank.swift | ||
// StripeCore | ||
// | ||
// Created by Krisjanis Gaidis on 4/16/24. | ||
// | ||
|
||
import Foundation | ||
|
||
@_spi(STP) public protocol FinancialConnectionsLinkedBank { | ||
var sessionId: String { get } | ||
var accountId: String { get } | ||
var displayName: String? { get } | ||
var bankName: String? { get } | ||
var last4: String? { get } | ||
var instantlyVerified: Bool { get } | ||
} |
21 changes: 21 additions & 0 deletions
21
StripeCore/StripeCore/Source/Connections Bindings/FinancialConnectionsSDKInterface.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// ConnectionsSDKInterface.swift | ||
// StripeCore | ||
// | ||
// Created by Vardges Avetisyan on 2/24/22. | ||
// Copyright © 2022 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@_spi(STP) public protocol FinancialConnectionsSDKInterface { | ||
init() | ||
func presentFinancialConnectionsSheet( | ||
apiClient: STPAPIClient, | ||
clientSecret: String, | ||
returnURL: String?, | ||
onEvent: ((FinancialConnectionsEvent) -> Void)?, | ||
from presentingViewController: UIViewController, | ||
completion: @escaping (FinancialConnectionsSDKResult) -> Void | ||
) | ||
} |
19 changes: 19 additions & 0 deletions
19
StripeCore/StripeCore/Source/Connections Bindings/FinancialConnectionsSDKResult.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// FinancialConnectionsSDKResult.swift | ||
// StripeCore | ||
// | ||
// Created by Krisjanis Gaidis on 4/16/24. | ||
// | ||
|
||
import Foundation | ||
|
||
@_spi(STP) @frozen public enum FinancialConnectionsSDKResult { | ||
case completed(Completed) | ||
case cancelled | ||
case failed(error: Error) | ||
|
||
@_spi(STP) public enum Completed { | ||
case financialConnections(FinancialConnectionsLinkedBank) | ||
case instantDebits(InstantDebitsLinkedBank) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
StripeCore/StripeCore/Source/Connections Bindings/InstantDebitsLinkedBank.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// InstantDebitsLinkedBank.swift | ||
// StripeCore | ||
// | ||
// Created by Krisjanis Gaidis on 4/16/24. | ||
// | ||
|
||
import Foundation | ||
|
||
@_spi(STP) public protocol InstantDebitsLinkedBank { | ||
var paymentMethodId: String { get } | ||
var bankName: String? { get } | ||
var last4: String? { get } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
for now, this needs to be uncommented for Instant Debits to show up via playground
there's a precedent for it below (😁 ):
likely not the end state we want but its OK for now given the state of the project (still iterating on design etc.)
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.
Does turning the Link flag on work? That should set
[card, link]
as the PMs. If this is necessary, might be nice to make it a switch, it's not too difficult to add a new oneThere 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.
@davidme-stripe
What is the Link flag? Or, in other words, given the current state, what would I change/do to try turning the Link flag on? (also asked some other folks in the meanwhile too)
I do see this (...but doesn't seem to do the intended):
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.
That should be it — if it's
on
, the backend should send[card, link, (a few others)]
.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.
@davidme-stripe
With that on...
in:
intent.recommendedPaymentMethodTypes
returns:they key problem, as I understand it, is that the "USBankAccount" is returned (where if that exists, Instant Debits is disabled - by
intent.linkFundingSources?.contains(.bankAccount) == true
NOT being true)LMK if there's other easy way around this, right now Android added a comma-separated list to the playground app to support this through the UI and the current plan was to just copy it: stripe/stripe-android#8428
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.
Oh, got it! That makes sense to me.