[BREAKING] swap Stripe.webhooks from a factory function to a static property#2277
Merged
xavdid-stripe merged 1 commit intomasterfrom Mar 25, 2025
Merged
[BREAKING] swap Stripe.webhooks from a factory function to a static property#2277xavdid-stripe merged 1 commit intomasterfrom
xavdid-stripe merged 1 commit intomasterfrom
Conversation
Contributor
|
This feels like a really big breaking change; I think we should discuss before merging. |
mbroshi-stripe
approved these changes
Mar 25, 2025
Contributor
|
For posterity, we discussed this in our team design review meeting, and decided
|
ramya-stripe
added a commit
that referenced
this pull request
Apr 1, 2025
* Add Next.js App Router webhook example that leverages Route Handlers (#2259) * Update generated code (#2256) * Update generated code for v1463 * Update generated code for v1494 * Update generated code for v1495 * Update generated code for v1501 * Update generated code for v1505 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> * Bump version to 17.7.0 * Update actions/cache as v2 is deprecated (#2269) * remove test using soon-to-be-gone endpoint (#2270) * [BREAKING] swap Stripe.webhooks from a factory function to a static property (#2277) swap Stripe.webhooks from a factory function to a static property * Remove tests for endpoints that were removed (#2281) * Remove types that were marked as deprecated in Feb 2024 (#2286) * Remove types that were marked as deprecated in Feb 2024 * remove the test for deprecated type * add Amount interface (#2289) * Update generated code for v1641 * Update generated code for v1641 * Update generated code for v1641 * Update generated code for v1641 * Support for APIs in the new API version 2025-03-31.basil (#2279) Update generated code for v1641 Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> * Update generated code for v1642 * Update generated code for v1642 * Update generated code (#2291) * Update generated code for v1642 * Update generated code for v1642 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> * Update generated code for v1645 * Update generated code for v1646 --------- Co-authored-by: Jonathan Steele <83410553+jsteele-stripe@users.noreply.github.com> Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Co-authored-by: Prathmesh Ranaut <prathmesh@stripe.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why?
In #1956, a user flagged that they wanted to be able to use webhook utilities before creating a
Stripeinstance. Since the webhook utilities were standalone (didn't depend on anything insideStripe) we made them static. But because they were factory functions before, we didn't want to break that mid-cycle. Now that it's time for a major version, we can complete this change.What?
Stripe.webhooksto the result ofcreateWebhooks()directlythis.webhooksinside theStripeconstructor to the value atStripe.webhooksSee Also
Changelog
Stripe.webhooksandStripe().webhooksare no longer functions (just plain objects)Stripe.webhooks().someMethod(), you should useStripe.webhooks.someMethod()instead