Skip to content

Migration guide for v11

anniel-stripe edited this page Nov 17, 2022 · 1 revision

Changes in 11.0.0 - 2022-11-15

Major version release for API version 2022-11-15. "⚠️" symbol highlights breaking changes.

⚠️ Changed

  • Drop support for Node.js 8 and 10. We now support Node.js 12+.
  • Change StripeSignatureVerificationError to have header and payload fields instead of detail. To access these properties, use err.header and err.payload instead of err.detail.header and err.detail.payload.

⚠️ Removed

  • Remove Orders resource.

  • Remove SKU resource.

  • Remove deprecated CheckoutSessionCreateParams.subscription_data.items.

  • Remove deprecated configuration setter methods (setHost, setProtocol, setPort, setApiVersion, setApiKey, setTimeout, setAppInfo, setHttpAgent, setMaxNetworkRetries, and setTelemetryEnabled).

    Use the config object to set these options instead, for example:

    const stripe = Stripe('sk_test_...', {
      apiVersion: '2019-08-08',
      maxNetworkRetries: 1,
      httpAgent: new ProxyAgent(process.env.http_proxy),
      timeout: 1000,
      host: 'api.example.com',
      port: 123,
      telemetry: true,
    });
  • Remove deprecated basic method definitions. Use basic methods defined on the resource instead.

    // Before
    basicMethods: true
    
    // After
    create: stripeMethod({
      method: 'POST',
      fullPath: '/v1/resource',
    }),
    list: stripeMethod({
      method: 'GET',
      methodType: 'list',
      fullPath: '/v1/resource',
    }),
    retrieve: stripeMethod({
      method: 'GET',
      fullPath: '/v1/resource/{id}',
    }),
    update: stripeMethod({
      method: 'POST',
      fullPath: '/v1/resource/{id}',
    }),
    // Avoid 'delete' keyword in JS
    del: stripeMethod({
      method: 'DELETE',
      fullPath: '/v1/resource/{id}',
    }),
  • Remove deprecated option names. Use the following option names instead (OLD->NEW): api_key->apiKey, idempotency_key->idempotencyKey, stripe_account->stripeAccount, stripe_version->apiVersion, stripeVersion->apiVersion.

  • Remove charges field on PaymentIntent and replace it with latest_charge.

  • Remove deprecated amount field on Checkout.Session.LineItem.

  • Remove support for tos_shown_and_accepted on Checkout.Session.PaymentMethodOptions.Paynow.

Read more at https://stripe.com/docs/upgrades#2022-11-15