Add support for pay_immediately=false when creating Stripe subscriptions (#36129)

This commit is contained in:
Oleg Vaskevich 2019-06-12 19:54:47 +01:00 committed by Ron Buckton
parent eb04955276
commit 6e43367819
2 changed files with 16 additions and 0 deletions

View File

@ -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 {

View File

@ -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",