Skip to content

Add Pay by Bank support#6238

Merged
joyceqin-stripe merged 24 commits into
masterfrom
joyceqin/pay-by-bank
Apr 13, 2026
Merged

Add Pay by Bank support#6238
joyceqin-stripe merged 24 commits into
masterfrom
joyceqin/pay-by-bank

Conversation

@joyceqin-stripe

@joyceqin-stripe joyceqin-stripe commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add Pay by Bank support

Motivation

Add Pay by Bank support

Testing

Unit tests

Simulator.Screen.Recording.-.iPhone.12.mini.-.2026-04-10.at.10.43.13.mov
Simulator.Screen.Recording.-.iPhone.12.mini.-.2026-04-10.at.10.41.39.mov

Changelog

  • [Added] Added support for Pay by Bank payments (GA in GB, private preview in EU).

@github-actions

github-actions Bot commented Mar 23, 2026

Copy link
Copy Markdown

⚠️ Public API changes detected:

StripePayments

Public API

+    @objc get
+    get
+    get
+  @objc convenience public init(payByBank: StripePayments.STPPaymentMethodPayByBankParams, billingDetails: StripePayments.STPPaymentMethodBillingDetails?, metadata: [Swift.String : Swift.String]?)
+  @objc deinit
+  @objc deinit
+  @objc override dynamic public init()
+  @objc override dynamic public var description: Swift.String {
+  @objc public class func decodedObject(fromAPIResponse response: [Swift.AnyHashable : Any]?) -> Self?
+  @objc public class func propertyNamesToFormFieldNamesMapping() -> [Swift.String : Swift.String]
+  @objc public class func rootObjectName() -> Swift.String?
+  @objc public var additionalAPIParameters: [Swift.AnyHashable : Any]
+  @objc public var allResponseFields: [Swift.AnyHashable : Any] {
+  @objc public var bank: Swift.String?
+  @objc public var payByBank: StripePayments.STPPaymentMethodPayByBank? {
+  @objc public var payByBank: StripePayments.STPPaymentMethodPayByBankParams?
+  case payByBank
+  }
+  }
+  }
+@objc @_hasMissingDesignatedInitializers public class STPPaymentMethodPayByBank : ObjectiveC.NSObject {
+@objc @_inheritsConvenienceInitializers public class STPPaymentMethodPayByBankParams : ObjectiveC.NSObject, StripePayments.STPFormEncodable {
+}
+}

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 the interface change.
Additionally, if you modified or removed an existing API, ensure you update the changelog to reflect the necessary version bump for your changes. Regular public API changes require a MAJOR version bump, and SPI API changes (other than @_spi(STP)-only declarations) require a MINOR or MAJOR version bump.

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

@joyceqin-stripe joyceqin-stripe marked this pull request as ready for review April 10, 2026 14:45
@joyceqin-stripe joyceqin-stripe requested review from a team as code owners April 10, 2026 14:45

@porter-stripe porter-stripe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

few comments

Comment on lines +981 to +982
// Skip unknown and wero (private preview, not yet recognized by /v1/elements/sessions)
guard type != .unknown, type != .wero else { return partialResult }
// Skip unknown, wero, and pay_by_bank (private preview, not yet recognized by /v1/elements/sessions)
guard type != .unknown, type != .wero, type != .payByBank else { return partialResult }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Let's make a list of PMs that should be excluded here now that we have more than 1.

}
},
{
"type": "pay_by_bank",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we actually need this entry in the form specs? I don't think we should use LUXE specs for new LPMs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This LPM has no input fields, so either we have this entry in the form specs or we add a case in PaymentSheetFormFactory.make that just returns an empty FormElement; otherwise, we hit the stpAssertionFailure that it's missing form specs. I don't see any other LPMs returning the empty FormElement, so I thought it made sense to keep an entry here, copied from https://stripe.sourcegraphcloud.com/r/stripe-internal/mint/-/blob/pay-server/lib/lpm_ui_platform/private/specs/pay_by_bank.json

return "<\(props.joined(separator: "; "))>"
}

// MARK: - STPAPIResponseDecodeable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: STPAPIResponseDecodeable -> STPAPIResponseDecodable (extra 'e'). This typo exists in several other LPM files too, so not blocking.

expand: ["payment_method"]
) { paymentIntent, _ in
XCTAssertNotNil(paymentIntent?.paymentMethod?.allResponseFields["pay_by_bank"])
let payByBankJson = try? XCTUnwrap(paymentIntent?.paymentMethod?.payByBank?.allResponseFields)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

try? XCTUnwrap(...) silently swallows failures — XCTUnwrap should be used with try (not try?) so the test fails with a useful message if payByBank is nil. (Same issue exists in the Wero test, but let's not copy it
forward.)

@github-actions

github-actions Bot commented Apr 10, 2026

Copy link
Copy Markdown

✅ Dead code has been resolved in this PR.

[find-dead-code]

@joyceqin-stripe joyceqin-stripe merged commit 7be2625 into master Apr 13, 2026
7 checks passed
@joyceqin-stripe joyceqin-stripe deleted the joyceqin/pay-by-bank branch April 13, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants