From 8c3269dad0b3b153e06365dd9ddb205af52a34d7 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Fri, 5 Feb 2021 16:01:35 -0500 Subject: [PATCH] API Updates (#1118) * Codegen for openapi 79b5ae3 --- lib/resources/EphemeralKeys.js | 2 +- test/resources/EphemeralKeys.spec.js | 4 +++- types/2020-08-27/LineItems.d.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 6db8357f0d..cfe1408333 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -16,7 +16,7 @@ module.exports = StripeResource.extend({ validator: (data, options) => { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( - 'stripe_version must be specified to create an ephemeral key' + 'Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node' ); } }, diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 4149ac745d..2a64f5a978 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -6,7 +6,9 @@ const expect = require('chai').expect; function errorsOnNoStripeVersion() { return expect( stripe.ephemeralKeys.create({customer: 'cus_123'}) - ).to.be.eventually.rejectedWith(/stripe_version must be specified/i); + ).to.be.eventually.rejectedWith( + /Passing apiVersion in a separate options hash is required/i + ); } function sendsCorrectStripeVersion() { diff --git a/types/2020-08-27/LineItems.d.ts b/types/2020-08-27/LineItems.d.ts index 0462364358..a5ddfe5251 100644 --- a/types/2020-08-27/LineItems.d.ts +++ b/types/2020-08-27/LineItems.d.ts @@ -19,12 +19,12 @@ declare module 'stripe' { /** * Total before any discounts or taxes are applied. */ - amount_subtotal: number | null; + amount_subtotal: number; /** * Total after discounts and taxes. */ - amount_total: number | null; + amount_total: number; /** * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).