From e29e9d6947fbf722c055b37773ee3d48a0c9eb1e Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 17 Aug 2023 01:43:54 -0700 Subject: [PATCH 1/5] Update lib.d.ts --- types/lib.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lib.d.ts b/types/lib.d.ts index e940c7f2e6..b96d3f5489 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -27,7 +27,7 @@ declare module 'stripe' { }): (...args: any[]) => Response; //eslint-disable-line @typescript-eslint/no-explicit-any static MAX_BUFFERED_REQUEST_METRICS: number; } - export type LatestApiVersion = '2022-11-15'; + export type LatestApiVersion = '2023-08-16'; export type HttpAgent = Agent; export type HttpProtocol = 'http' | 'https'; From 024f2818fa1074a92cbc8990b0027aced0d9e3c0 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 17 Aug 2023 01:52:38 -0700 Subject: [PATCH 2/5] Fix test --- types/test/typescriptTest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index dcf8b03cdf..71b26eaf6e 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -27,7 +27,7 @@ stripe = new Stripe('sk_test_123', { // Check config object. stripe = new Stripe('sk_test_123', { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', typescript: true, maxNetworkRetries: 1, timeout: 1000, From f397c36e30854616ced858a8f07d3b30831e2b36 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 17 Aug 2023 02:00:55 -0700 Subject: [PATCH 3/5] Fix test more --- types/test/typescriptTest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index 71b26eaf6e..f769205137 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -9,7 +9,7 @@ import Stripe from 'stripe'; let stripe = new Stripe('sk_test_123', { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', }); // @ts-ignore lazily ignore apiVersion requirement. From 5dcad772f2ae46a9b4bc05c9f741c20721b73cbe Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 17 Aug 2023 02:09:08 -0700 Subject: [PATCH 4/5] More test fixes --- examples/webhook-signing/express/main.ts | 2 +- examples/webhook-signing/koa/main.ts | 2 +- examples/webhook-signing/nextjs/pages/api/webhooks.ts | 2 +- examples/webhook-signing/test/main.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/webhook-signing/express/main.ts b/examples/webhook-signing/express/main.ts index eb0b68df4c..d5bdb83993 100755 --- a/examples/webhook-signing/express/main.ts +++ b/examples/webhook-signing/express/main.ts @@ -8,7 +8,7 @@ import {AddressInfo} from 'net'; env.config(); const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', }); const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET; diff --git a/examples/webhook-signing/koa/main.ts b/examples/webhook-signing/koa/main.ts index 3f25070a05..8768a1248b 100755 --- a/examples/webhook-signing/koa/main.ts +++ b/examples/webhook-signing/koa/main.ts @@ -12,7 +12,7 @@ env.config(); const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', }); const handleWebhook = async (ctx: Koa.ParameterizedContext, next: Koa.Next) => { diff --git a/examples/webhook-signing/nextjs/pages/api/webhooks.ts b/examples/webhook-signing/nextjs/pages/api/webhooks.ts index 057f53c62a..f287872f41 100644 --- a/examples/webhook-signing/nextjs/pages/api/webhooks.ts +++ b/examples/webhook-signing/nextjs/pages/api/webhooks.ts @@ -6,7 +6,7 @@ const handler = async ( res: NextApiResponse ): Promise => { const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', }); const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET; diff --git a/examples/webhook-signing/test/main.ts b/examples/webhook-signing/test/main.ts index 3bf9750456..e4d3eb949f 100755 --- a/examples/webhook-signing/test/main.ts +++ b/examples/webhook-signing/test/main.ts @@ -42,7 +42,7 @@ env.config({ const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', }); const payload = Buffer.from( From f884e6e897b57b7cb8733f0801d82df2fec459ec Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 17 Aug 2023 02:15:06 -0700 Subject: [PATCH 5/5] More tests --- testProjects/cloudflare-pages/functions/index.js | 2 +- testProjects/mjs-ts/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testProjects/cloudflare-pages/functions/index.js b/testProjects/cloudflare-pages/functions/index.js index 2212d64b9e..f468b35a40 100644 --- a/testProjects/cloudflare-pages/functions/index.js +++ b/testProjects/cloudflare-pages/functions/index.js @@ -5,7 +5,7 @@ export async function onRequestPost({env, request}) { const body = await request.text(); const stripe = new Stripe(env.STRIPE_API_KEY, { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', httpClient: Stripe.createFetchHttpClient(), }); const webCrypto = Stripe.createSubtleCryptoProvider(); diff --git a/testProjects/mjs-ts/index.ts b/testProjects/mjs-ts/index.ts index 61b857b77d..cffb780b36 100644 --- a/testProjects/mjs-ts/index.ts +++ b/testProjects/mjs-ts/index.ts @@ -1,13 +1,13 @@ import DefaultStripe, {Stripe} from 'stripe'; const stripe = new Stripe(process.argv[2], { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', host: process.env.STRIPE_MOCK_HOST || 'localhost', port: process.env.STRIPE_MOCK_PORT || 12111, protocol: 'http', }); const defaultStripe = new DefaultStripe(process.argv[2], { - apiVersion: '2022-11-15', + apiVersion: '2023-08-16', host: process.env.STRIPE_MOCK_HOST || 'localhost', port: process.env.STRIPE_MOCK_PORT || 12111, protocol: 'http',