mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-30 02:01:46 +00:00
Add days_until_due argument when creating/updating subscription
With tests. https://stripe.com/docs/api#create_subscription-days_until_due
This commit is contained in:
Vendored
+11
@@ -4384,6 +4384,12 @@ declare namespace Stripe {
|
||||
* instructions. Defaults to "charge_automatically".
|
||||
*/
|
||||
billing?: SubscriptionBilling;
|
||||
|
||||
/**
|
||||
* Number of days a customer has to pay invoices generated by this subscription.
|
||||
* Only valid for subscriptions where billing=send_invoice.
|
||||
*/
|
||||
days_until_due?: number;
|
||||
}
|
||||
|
||||
interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions {
|
||||
@@ -4456,6 +4462,11 @@ declare namespace Stripe {
|
||||
*/
|
||||
billing?: SubscriptionBilling;
|
||||
|
||||
/**
|
||||
* Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice.
|
||||
*/
|
||||
days_until_due?: number;
|
||||
|
||||
/**
|
||||
* List of subscription items, each with an attached plan.
|
||||
*/
|
||||
|
||||
@@ -253,12 +253,13 @@ stripe.customers.create({
|
||||
|
||||
customer.subscriptions.create({ items: [{ plan: "gold" }] }).then(function (subscription) { });
|
||||
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now" }).then(function (subscription) { });
|
||||
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: 1516881177 }).then(function (subscription) { });
|
||||
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: 1516881177, billing: "send_invoice", days_until_due: 7 }).then(function (subscription) { });
|
||||
customer.subscriptions.create({ items: [{ plan: "gold" }], billing: "charge_automatically" }).then(function (subscription) { });
|
||||
customer.subscriptions.retrieve("sub_8Eluur5KoIKxuy").then(function (subscription) {
|
||||
customer.subscriptions.update("sub_8Eluur5KoIKxuy", { items: [{ id: subscription.items.data[0].id, plan: "silver" }] }).then(function (subscription) { });
|
||||
});
|
||||
customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: "now" });
|
||||
customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177 });
|
||||
customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177, billing: "send_invoice", days_until_due: 7 });
|
||||
customer.subscriptions.list().then(function (subscriptions) { });
|
||||
customer.subscriptions.del("sub_8Eluur5KoIKxuy").then(function (subscription) { });
|
||||
customer.subscriptions.deleteDiscount("sub_8Eluur5KoIKxuy").then(function (confirmation) { });
|
||||
|
||||
Reference in New Issue
Block a user