Add prorate option to subscription creation options

with tests
This commit is contained in:
CodeAnimal
2018-03-28 20:54:12 +01:00
parent bf51de3bc8
commit 27c85093ad
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -4470,6 +4470,12 @@ declare namespace Stripe {
* with month or year intervals, the day of the month for subsequent invoices.
*/
billing_cycle_anchor?: number;
/**
* Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until
* the anchor date. If false, the anchor period will be free (similar to a trial).
*/
prorate?: boolean;
}
interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions {
+1 -1
View File
@@ -252,7 +252,7 @@ stripe.customers.create({
customer.cards.del("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (confirmation) {});
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_period_days: 7 }).then(function (subscription) { });
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177 }).then(function (subscription) { });
customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177, prorate: true }).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) {