From 7b2a6da4ba4e2e2aa2845914ac42bb4af87b916e Mon Sep 17 00:00:00 2001 From: Keisuke Kan <9renpoto@gmail.com> Date: Wed, 18 Dec 2019 22:15:51 +0900 Subject: [PATCH] chore(types/stripe): Added stripe.plans.IPlanUpdateOptions options (#41080) * chore(types/stripe): Added stripe.plans.IPlanUpdateOptions options * fix(types/stripe): trial_period_days type to number --- types/stripe/index.d.ts | 10 ++++++++++ types/stripe/stripe-tests.ts | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 57de752245..9d70a87805 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -8571,6 +8571,16 @@ declare namespace Stripe { * be affected. */ product?: string; + + /** + * Whether the plan is currently available for new subscriptions. + */ + active?: boolean; + + /** + * Default number of trial days when subscribing a customer to this plan using `trial_from_plan=true`. + */ + trial_period_days?: number; } interface IPlanCreationOptionsProductHash { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index a23273fd94..c505f4ac33 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -2351,6 +2351,12 @@ stripe.plans.update( stripe.plans.update('gold-plan', { nickname: 'New gold plan nickname' }).then(plan => { // asynchronously called }); +stripe.plans.update('gold-plan', { active: true }).then(plan => { + // asynchronously called +}); +stripe.plans.update('gold-plan', { trial_period_days: 1 }).then(plan => { + // asynchronously called +}); stripe.plans.del('gold-plan', (err, confirmation) => { // asynchronously called