yarn stripe 22.0.0
v22.0.0

latest releases: 22.1.0-alpha.1, 22.1.0-beta.1
12 hours ago
  • #2642 Update README.md

  • #2645 ⚠️ Remove stripeMethod and standardize how function args are handled (including removing callback support)

    • ⚠️ Refactor how incoming method arguments are parsed. Type signatures for API methods should be much more accurate and reliable now
      • ⚠️ Remove support for providing callbacks to API methods. Use async / await instead
      • ⚠️ Remove support for passing a plain API key as a function arg. If supplied on a per-request basis, it should be in the RequestOptions under the apiKey property
      • ⚠️ Keys from params and options objects are no longer mixed. If present on a method, RequestParams must always come first and RequestOptions must always come second. To supply options without params, pass undefined as the first argument explicitly
      • ⚠️ Removed methods from StripeResource: createFullPath, createResourcePathWithSymbols, extend, method and _joinUrlParts. These were mostly intended for internal use and we no longer need them

    As a result, the following call patterns are no longer supported:

    stripe.customers.retrieve('cus_123', 'sk_test_123')
    stripe.customers.create({name: 'david', host: 'example.com'}, 'sk_test_123')
    stripe.customers.create({apiKey: 'sk_test_123'})
    stripe.customers.list(customers => {
      // do something with customers
    })

    If those look familiar, head over to the migration guide to update your code.

  • #2643 ⚠️ remove support for overriding host per-request

    • ⚠️ Removed per-request host override. To use a custom host, set it in the client configuration. All requests from that client will use that host.

    Before:

    import Stripe from 'stripe';
    const stripe = new Stripe('sk_test_...');
    
    const customer = await stripe.customers.create({
      email: 'customer@example.com',
    }, {host: 'example.com'});

    After:

    import Stripe from 'stripe';
    const stripe = new Stripe('sk_test_...', {host: 'example.com'});
    
    // goes to example.com
    const customer = await stripe.customers.create({
      email: 'customer@example.com',
    });
  • #2619 Improved TypeScript support in the Node SDK

  • #2638 Converted V2/Amount.ts to V2/V2Amount.ts

  • #2635 Updated stripe.spec.ts test and constructEvent.tolerance type

See the changelog for more details.

Don't miss a new stripe release

NewReleases is sending notifications on new releases.