Skip to content

Support for StripeAccount in StripeClient, and StripeContext on V1#1952

Merged
jar-stripe merged 2 commits intosdk-release/next-majorfrom
jar/stripe-account-and-stripe-context
Mar 13, 2025
Merged

Support for StripeAccount in StripeClient, and StripeContext on V1#1952
jar-stripe merged 2 commits intosdk-release/next-majorfrom
jar/stripe-account-and-stripe-context

Conversation

@jar-stripe
Copy link
Contributor

@jar-stripe jar-stripe commented Mar 10, 2025

Why?

The SDK should support setting StripeAccount and StripeContext at the client level, and StripeClient should be accepted in the same way across V1 and V2 APIs.

What?

  • added StripeAccount to StripeClientBuilder
  • removed v1 limitation on using StripeContext
  • added tests

See Also

Changelog

  • ⚠️ Adds getStripeAccount to StripeResponseGetterOptions. If you have a class that extends StripeResponseGetterOptions you will need to implement this method.
  • Adds setStripeAccount to StripeClientBuilder, so you can specify the Stripe-Account header at the client (instead of the individual request) level.
  • Enables Stripe-Context headers for v1 resource and service methods

removed v1 limitation on using StripeContext
added tests
@jar-stripe jar-stripe changed the base branch from master to sdk-release/next-major March 10, 2025 17:24
@jar-stripe jar-stripe marked this pull request as ready for review March 10, 2025 17:24
@jar-stripe jar-stripe requested a review from a team as a code owner March 10, 2025 17:24
@jar-stripe jar-stripe requested review from prathmesh-stripe and removed request for a team March 10, 2025 17:24
@prathmesh-stripe
Copy link
Contributor

One test is failing. Otherwise LGTM

@jar-stripe jar-stripe enabled auto-merge (squash) March 13, 2025 19:40
@jar-stripe jar-stripe disabled auto-merge March 13, 2025 19:40
@jar-stripe jar-stripe enabled auto-merge (squash) March 13, 2025 19:40
@jar-stripe jar-stripe disabled auto-merge March 13, 2025 20:46
@jar-stripe
Copy link
Contributor Author

compat error is expected, because we are adding a new abstract method to a public class.

@jar-stripe jar-stripe merged commit 4808c92 into sdk-release/next-major Mar 13, 2025
11 of 12 checks passed
@jar-stripe jar-stripe deleted the jar/stripe-account-and-stripe-context branch March 13, 2025 20:47
ramya-stripe added a commit that referenced this pull request Mar 19, 2025
…1958)

* removed test that expected error when setting context on v1 request

* added support for StripeAccount in StripeClient builder (#1952)

removed v1 limitation on using StripeContext

---------

Co-authored-by: Jesse Rosalia <jar@stripe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants