Add networkBusinessProfile to seller payment methods#6326
Add networkBusinessProfile to seller payment methods#6326floriansuess-stripe wants to merge 2 commits intomasterfrom
networkBusinessProfile to seller payment methods#6326Conversation
- Make SellerDetails fields (networkId, externalId, businessName) optional - Add networkBusinessProfile field to SellerDetails - Send business_name and network_business_profile in elements/sessions params - Add beta header when networkBusinessProfile is provided - Add mutual exclusion validation for sellerDetails vs paymentMethodConfigurationId - Add tests for new fields, beta header, and mutual exclusion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
StripePaymentSheetPublic API+ case paymentMethodConfigurationAndSellerDetailsMutuallyExclusiveSPI API- @_spi(SharedPaymentToken) public init(networkId: Swift.String, externalId: Swift.String, businessName: Swift.String)
- @_spi(SharedPaymentToken) public let businessName: Swift.String
- @_spi(SharedPaymentToken) public let externalId: Swift.String
- @_spi(SharedPaymentToken) public let networkId: Swift.String
+ @_spi(SharedPaymentToken) public init(networkId: Swift.String? = nil, externalId: Swift.String? = nil, businessName: Swift.String? = nil, networkBusinessProfile: Swift.String? = nil)
+ @_spi(SharedPaymentToken) public let businessName: Swift.String?
+ @_spi(SharedPaymentToken) public let externalId: Swift.String?
+ @_spi(SharedPaymentToken) public let networkBusinessProfile: Swift.String?
+ @_spi(SharedPaymentToken) public let networkId: Swift.String?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 |
| /// Backwards-compatible initializer with required fields | ||
| public init(networkId: String, externalId: String, businessName: String) { | ||
| self.networkId = networkId | ||
| self.externalId = externalId | ||
| self.businessName = businessName | ||
| self.networkBusinessProfile = nil | ||
| } |
There was a problem hiding this comment.
I think we can delete this because the new constructor has a default value for networkBusinessProfile
The all-optional initializer already handles the 3-arg case since networkBusinessProfile defaults to nil. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
toluo-stripe
left a comment
There was a problem hiding this comment.
LGTM, but I'm not an iOS codeowner. There's also an api change that may be a blocker. @wooj-stripe @yuki-stripe can you take a look?
Summary and motivation
APIREVIEW-4954.
iOS SDK counterpart to the Stripe.js change in mint#2041413.
Exposes the API surface for agents to pass a seller's Business Network profile to Payment Element on iOS, enabling PE to display the seller's configured payment methods. Beta header
payment_element_seller_payment_methods_beta_1is automatically included whennetworkBusinessProfileis provided.The
/v1/elements/sessionsrequest already supports:GET /v1/elements/sessionsIn the iOS SDK:
For backwards compatibility, the existing 3-arg initializer
SellerDetails(networkId:externalId:businessName:)with non-optional String types is preserved. A new initializer with all-optional parameters enables flexible usage including the newnetworkBusinessProfilefield.The new
network_business_profilefield allows agents to specify a BizNet profile ID, from which Stripe resolves the seller's default PMC (providedpayment_element_seller_payment_methods_beta_1is present).All fields made optional.
networkBusinessProfileadded.paymentMethodConfigurationIdandsellerDetailsare now validated as mutually exclusive, passing both returns aPaymentSheetErrorclient-side.All this together looks like:
Note: what we do not do in this PR is act on it, i.e., take that network_business_profile value, resolve it to a seller's PMC, and return the right payment methods in the session response. That will come later.