stripe-ios icon indicating copy to clipboard operation
stripe-ios copied to clipboard

Instant Debits: first iteration of Instant Debits in Payment Sheet

Open kgaidis-stripe opened this issue 10 months ago • 2 comments

Summary

This PR implements the first iteration of Instant Debits in the Payment Sheet. The PR:

  1. Adds a new payment method (instant debits) so we could display a new "Bank Account" payment method in the payment sheet
  2. If "Bank Account" (Instant Debits) is selected, the code displays UI, and routes through Payment Sheet and Financial Connections

⚠️ Some important notes for reviewing:

  • This is just the first iteration. Despite Android equivalent already being landed, we still have a lot of things to resolve and improve before launching to merchants: handle flags for rollout, design, testing, etc.

Testing

See two videos:

PaymentIntent Succeeds

https://github.com/stripe/stripe-ios/assets/105514761/dddd0e22-9a9a-4415-8933-0c3aa38368d9

SetupIntent Succeeds

https://github.com/stripe/stripe-ios/assets/105514761/4ff6341c-a3d4-4d72-b23a-9957959c4873

Financial Connections Still Works

https://app.bitrise.io/build/30cd250d-0695-4af1-bd81-5c5de2f882f3

FinancialConnectionsNetworkingUITests
    ✓ testNativeNetworkingTestMode (111.850 seconds)
    ✓ testNativeNetworkingTestModeSignUpWithMultiSelectAndPrefilledEmail (30.682 seconds)
FinancialConnectionsUITests
    ✓ testDataLiveModeOAuthNativeAuthFlow (29.338 seconds)
    ✓ testDataLiveModeOAuthWebAuthFlow (18.610 seconds)
    ✓ testDataTestModeOAuthNativeAuthFlow (18.501 seconds)
    ✓ testPaymentSearchInLiveModeNativeAuthFlow (26.620 seconds)
    ✓ testPaymentTestModeLegacyNativeAuthFlow (20.153 seconds)
    ✓ testPaymentTestModeManualEntryNativeAuthFlow (24.347 seconds)

kgaidis-stripe avatar Apr 19 '24 20:04 kgaidis-stripe

⚠️ 5 new unused protocols, 6 builds increased size

Name Version Download Change Install Change Approval
StripeApplePaySize
com.stripe.StripeApplePaySize
1.0 (1) 422.3 kB ⬆️ 240 B (0.06%) 1.5 MB ⬆️ 1.7 kB (0.11%) N/A
StripePaymentsSize
com.stripe.StripePaymentsSize
1.0 (1) 1.1 MB ⬆️ 856 B (0.08%) 3.9 MB ⬆️ 2.6 kB (0.07%) N/A
StripePaymentSheetSize
com.stripe.StripePaymentSheetSize
1.0 (1) 3.2 MB ⬆️ 10.8 kB (0.34%) 9.6 MB ⬆️ 27.3 kB (0.29%) N/A
StripeSize
com.stripe.StripeSize
1.0 (1) 2.3 MB ⬆️ 1.3 kB (0.05%) 7.6 MB ⬆️ 2.6 kB (0.03%) N/A
StripePaymentsUISize
com.stripe.StripePaymentsUISize
1.0 (1) 1.8 MB ⬆️ 1.3 kB (0.07%) 6.1 MB ⬆️ 3.0 kB (0.05%) N/A
StripeFinancialConnectionsSize
com.stripe.StripeFinancialConnectionsSize
1.0 (1) 1.2 MB ⬆️ 9.8 kB (0.84%) 3.9 MB ⬆️ 23.5 kB (0.61%) N/A

StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize

⚠️ 2 new unused protocols: FinancialConnectionsLinkedBank and InstantDebitsLinkedBank ⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 1.7 kB (0.11%) Total download size change: ⬆️ 240 B (0.06%)

Largest size changes

Item Install Size Change
📝 StripeCore.FinancialConnectionsSDKResult.Completed.value witness ⬆️ 624 B
Other ⬆️ 1.0 kB
View Treemap

Image of diff

StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize

⚠️ Found new unused protocol: InstantDebitsLinkedBank ⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 2.6 kB (0.07%) Total download size change: ⬆️ 856 B (0.08%)

Largest size changes

Item Install Size Change
🗑 StripePayments.StubbedLinkedBank ⬇️ -1.2 kB
📝 StripePayments.StubbedFinancialConnectionsLinkedBank.value witnes... ⬆️ 740 B
📝 StripeCore.FinancialConnectionsSDKResult.Completed.value witness ⬆️ 624 B
StripePayments.STPAPIClient.linkAccountSessions(endpoint,clientSe... ⬆️ 536 B
Other ⬆️ 1.9 kB
View Treemap

Image of diff

StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize

⚠️ Found new unused protocol: InstantDebitsLinkedBank ⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 27.3 kB (0.29%) Total download size change: ⬆️ 10.8 kB (0.34%)

Largest size changes

Item Install Size Change
📝 StripePaymentSheet.AddPaymentMethodViewController.handleCollectIn... ⬆️ 2.7 kB
📝 StripePaymentSheet.PaymentSheetFormFactory.makeInstantDebits ⬆️ 2.0 kB
📝 StripePaymentSheet.InstantDebitsPaymentMethodElement.didTapXIcon ⬆️ 1.5 kB
📝 StripePaymentSheet.InstantDebitsPaymentMethodElement.init(configu... ⬆️ 1.5 kB
🗑 StripePayments.StubbedLinkedBank ⬇️ -1.2 kB
View Treemap

Image of diff

StripeSize 1.0 (1)
com.stripe.StripeSize

⚠️ Found new unused protocol: InstantDebitsLinkedBank ⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 2.6 kB (0.03%) Total download size change: ⬆️ 1.3 kB (0.05%)

Largest size changes

Item Install Size Change
🗑 StripePayments.StubbedLinkedBank ⬇️ -1.2 kB
📝 StripePayments.StubbedFinancialConnectionsLinkedBank.value witnes... ⬆️ 740 B
📝 StripeCore.FinancialConnectionsSDKResult.Completed.value witness ⬆️ 624 B
StripePayments.STPAPIClient.linkAccountSessions(endpoint,clientSe... ⬆️ 536 B
Other ⬆️ 1.9 kB
View Treemap

Image of diff

StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize

⚠️ Found new unused protocol: InstantDebitsLinkedBank ⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 3.0 kB (0.05%) Total download size change: ⬆️ 1.3 kB (0.07%)

Largest size changes

Item Install Size Change
🗑 StripePayments.StubbedLinkedBank ⬇️ -1.2 kB
📝 StripePayments.StubbedFinancialConnectionsLinkedBank.value witnes... ⬆️ 740 B
📝 StripeCore.FinancialConnectionsSDKResult.Completed.value witness ⬆️ 624 B
StripePayments.STPAPIClient.linkAccountSessions(endpoint,clientSe... ⬆️ 536 B
Other ⬆️ 2.3 kB
View Treemap

Image of diff

StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize

⚖️ Compare build ⏱️ Analyze build performance

Total install size change: ⬆️ 23.5 kB (0.61%) Total download size change: ⬆️ 9.8 kB (0.84%)

Largest size changes

Item Install Size Change
📝 StripeFinancialConnections.HostControllerResult.value witness ⬆️ 3.9 kB
📝 StripeFinancialConnections.HostControllerResult.Completed.value w... ⬆️ 3.6 kB
📝 StripeFinancialConnections.FinancialConnectionsWebFlowViewControl... ⬆️ 1.4 kB
StripeFinancialConnections.HostController.hostViewController(didF... ⬆️ 1.4 kB
📝 StripeFinancialConnections.FinancialConnectionsWebFlowViewControl... ⬆️ 1.3 kB
View Treemap

Image of diff


:flying_saucer: Powered by Emerge Tools

emerge-tools[bot] avatar May 07 '24 17:05 emerge-tools[bot]

⚠️ Public API changes detected:

StripePayments

- get
- }
- @objc public var mobilePay: StripePayments.STPPaymentMethodMobilePay? {
+ case instantDebits
- @objc deinit
- @objc public var allResponseFields: [Swift.AnyHashable : Any] {
- get
- }
- @objc override dynamic public var description: Swift.String {
- @objc get
- }
- @objc public static func decodedObject(fromAPIResponse response: [Swift.AnyHashable : Any]?) -> Self?

StripeCore

+ public enum Name : Swift.String {
+ case open
+ case manualEntryInitiated
+ case consentAcquired
+ case searchInitiated
+ case institutionSelected
+ case institutionAuthorized
+ case accountsSelected
+ case success
+ case error
+ case cancel
+ case flowLaunchedInBrowser
+ public init?(rawValue: Swift.String)
+ public typealias RawValue = Swift.String
+ public var rawValue: Swift.String {
+ get
+ }
+ }
+ public struct Metadata {
+ public let dictionary: [Swift.String : Any]
+ public var manualEntry: Swift.Bool? {
+ get
+ }
+ public var institutionName: Swift.String? {
+ get
+ }
+ public var errorCode: StripeCore.FinancialConnectionsEvent.ErrorCode? {
+ get
+ }
+ }
+ public enum ErrorCode : Swift.String {
+ case accountNumbersUnavailable
+ case accountsUnavailable
+ case noDebitableAccount
+ case authorizationFailed
+ case institutionUnavailablePlanned
+ case institutionUnavailableUnplanned
+ case institutionTimeout
+ case unexpectedError
+ case sessionExpired
+ case failedBotDetection
+ public init?(rawValue: Swift.String)
+ public typealias RawValue = Swift.String
+ public var rawValue: Swift.String {
+ get
+ }
+ }
+ public let name: StripeCore.FinancialConnectionsEvent.Name
+ public let metadata: StripeCore.FinancialConnectionsEvent.Metadata
- public enum Name : Swift.String {
- case open
- case manualEntryInitiated
- case consentAcquired
- case searchInitiated
- case institutionSelected
- case institutionAuthorized
- case accountsSelected
- case success
- case error
- case cancel
- case flowLaunchedInBrowser
- public init?(rawValue: Swift.String)
- public typealias RawValue = Swift.String
- public var rawValue: Swift.String {
- get
- }
- }
- public struct Metadata {
- public let dictionary: [Swift.String : Any]
- public var manualEntry: Swift.Bool? {
- get
- }
- public var institutionName: Swift.String? {
- get
- }
- public var errorCode: StripeCore.FinancialConnectionsEvent.ErrorCode? {
- get
- }
- }
- public enum ErrorCode : Swift.String {
- case accountNumbersUnavailable
- case accountsUnavailable
- case noDebitableAccount
- case authorizationFailed
- case institutionUnavailablePlanned
- case institutionUnavailableUnplanned
- case institutionTimeout
- case unexpectedError
- case sessionExpired
- case failedBotDetection
- public init?(rawValue: Swift.String)
- public typealias RawValue = Swift.String
- public var rawValue: Swift.String {
- get
- }
- }
- public let name: StripeCore.FinancialConnectionsEvent.Name
- public let metadata: StripeCore.FinancialConnectionsEvent.Metadata

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.

github-actions[bot] avatar May 08 '24 17:05 github-actions[bot]