Skip to content

Commit

Permalink
Fix multiple references to the old types file
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Mar 3, 2020
1 parent 32375c9 commit f1dbba5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import env from 'dotenv';
env.config();

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2019-12-03',
apiVersion: '2020-03-02',
});

const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"node": "^8.1 || >=10.*"
},
"main": "lib/stripe.js",
"types": "types/2019-12-03/index.d.ts",
"types": "types/2020-03-02/index.d.ts",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
Expand Down
4 changes: 2 additions & 2 deletions types/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Agent} from 'http';

declare module 'stripe' {
namespace Stripe {
export type LatestApiVersion = '2019-12-03';
export type LatestApiVersion = '2020-03-02';
export type HttpAgent = Agent;

export interface StripeConfig {
Expand Down Expand Up @@ -92,7 +92,7 @@ declare module 'stripe' {
stripe_account?: string;

/**
* The [API Version](https://stripe.com/docs/upgrades) to use for a given request (e.g., '2019-12-03').
* The [API Version](https://stripe.com/docs/upgrades) to use for a given request (e.g., '2020-03-02').
*/
apiVersion?: string;
/** @deprecated Please use apiVersion instead. */
Expand Down
8 changes: 4 additions & 4 deletions types/test/typescriptTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* and to perform a basic sanity check that types are exported as intended.
*/

///<reference types="../2019-12-03" />
///<reference types="../2020-03-02" />
import Stripe from 'stripe';

let stripe = new Stripe('sk_test_123', {
apiVersion: '2019-12-03',
apiVersion: '2020-03-02',
});

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

// Check config object.
stripe = new Stripe('sk_test_123', {
apiVersion: '2019-12-03',
apiVersion: '2020-03-02',
typescript: true,
maxNetworkRetries: 1,
timeout: 1000,
Expand All @@ -48,7 +48,7 @@ stripe.setHost('host', 'port', 'protocol');
description: 'test',
};
const opts: Stripe.RequestOptions = {
apiVersion: '2019-12-03',
apiVersion: '2020-03-02',
};
const customer: Stripe.Customer = await stripe.customers.create(params, opts);

Expand Down

0 comments on commit f1dbba5

Please sign in to comment.