From 6e433678197daca623011752ba1003cb458065a6 Mon Sep 17 00:00:00 2001 From: Oleg Vaskevich Date: Wed, 12 Jun 2019 19:54:47 +0100 Subject: [PATCH] Add support for pay_immediately=false when creating Stripe subscriptions (#36129) --- types/stripe/index.d.ts | 8 ++++++++ types/stripe/stripe-tests.ts | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 80db4a929d..ca70d09ee2 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -6053,6 +6053,14 @@ declare namespace Stripe { * the anchor date. If false, the anchor period will be free (similar to a trial). */ prorate?: boolean; + + /** + * Boolean (default true). Used to prevent Stripe Invoicing from automatically paying the subscription on creation. This can be set + * to false when used with services like Avalara that need to augment an invoice before the subscription is paid. + * + * Using this flag requires contacting Stripe support in order to have the account whitelisted. + */ + pay_immediately?: boolean; } interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 1bcb857ea4..4791086e5f 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -480,6 +480,14 @@ stripe.customers.createSource( } ); +stripe.customers.createSubscription( + "cus_5rfJKDJkuxzh5Q", + { + items: [{plan: "some_plan", quantity: 2}], + pay_immediately: false + } +); + stripe.customers.retrieveCard( "cus_5rfJKDJkuxzh5Q", "card_15fvyXEe31JkLCeQ9KMktP5S",