Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates #1497

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update more api version usages
pakrym-stripe committed Aug 1, 2022

Unverified

This user has not yet uploaded their public signing key.
commit 5fc55f47f4f6d36edb888b1941b3e9fd045d0a57
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2020-08-27
2022-08-01
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import env from 'dotenv';
env.config();

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2020-08-27',
apiVersion: '2022-08-01',
});

const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
"node": "^8.1 || >=10.*"
},
"main": "lib/stripe.js",
"types": "types/2020-08-27/index.d.ts",
"types": "types/2022-08-01/index.d.ts",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
2 changes: 1 addition & 1 deletion types/lib.d.ts
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ declare module 'stripe' {
};
static MAX_BUFFERED_REQUEST_METRICS: number;
}
export type LatestApiVersion = '2020-08-27';
export type LatestApiVersion = '2022-08-01';
export type HttpAgent = Agent;
export type HttpProtocol = 'http' | 'https';

6 changes: 3 additions & 3 deletions types/test/typescriptTest.ts
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
import Stripe from 'stripe';

let stripe = new Stripe('sk_test_123', {
apiVersion: '2020-08-27',
apiVersion: '2022-08-01',
});

// @ts-ignore lazily ignore apiVersion requirement.
@@ -27,7 +27,7 @@ stripe = new Stripe('sk_test_123', {

// Check config object.
stripe = new Stripe('sk_test_123', {
apiVersion: '2020-08-27',
apiVersion: '2022-08-01',
typescript: true,
maxNetworkRetries: 1,
timeout: 1000,
@@ -49,7 +49,7 @@ stripe.setHost('host', 'port', 'protocol');
description: 'test',
};
const opts: Stripe.RequestOptions = {
apiVersion: '2020-08-27',
apiVersion: '2022-08-01',
};
const customer: Stripe.Customer = await stripe.customers.create(params, opts);