From d219726f9cbb791f357c26e469c27db148b877ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rau=CC=81l=20Acun=CC=83a?= Date: Tue, 9 Apr 2019 18:25:13 -0400 Subject: [PATCH] Add incomplete and incomplete expired subscription status Version 2019-03-14 of the Stripe API added two new values to the subscription status. --- types/stripe/index.d.ts | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index d2ef67dd96..6833b20fd3 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -5161,7 +5161,7 @@ declare namespace Stripe { } namespace subscriptions { - type SubscriptionStatus = "trialing" | "active" | "past_due" | "canceled" | "unpaid"; + type SubscriptionStatus = "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid"; type SubscriptionBilling = "charge_automatically" | "send_invoice"; /** * Subscriptions allow you to charge a customer's card on a recurring basis. A subscription ties a customer to @@ -5243,13 +5243,29 @@ declare namespace Stripe { start: number; /** - * Possible values are "trialing", "active", "past_due", "canceled", or "unpaid". A subscription still in its trial period is trialing - * and moves to active when the trial period is over. When payment to renew the subscription fails, the subscription becomes - * past_due. After Stripe has exhausted all payment retry attempts, the subscription ends up with a status of either canceled - * or unpaid depending on your retry settings. Note that when a subscription has a status of unpaid, no subsequent invoices - * will be attempted (invoices will be created, but then immediately automatically closed. Additionally, updating customer - * card details will not lead to Stripe retrying the latest invoice.). After receiving updated card details from a customer, - * you may choose to reopen and pay their closed invoices. + * Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, + * `past_due`, `canceled`, or `unpaid`. + * + * For `billing=charge_automatically` a subscription moves into `incomplete` if the + * initial payment attempt fails. A subscription in this state can only have metadata + * and default_source updated. Once the first invoice is paid, the subscription moves + * into an `active` state. If the first invoice is not paid within 23 hours, the + * subscription transitions to `incomplete_expired`. This is a terminal state, the open + * invoice will be voided and no further invoices will be generated. + * + * A subscription that is currently in a trial period is `trialing` and moves to + * `active` when the trial period is over. + * + * If subscription `billing=charge_automatically` it becomes `past_due` when payment to + * renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) + * when Stripe has exhausted all payment retry attempts. + * + * If subscription `billing=send_invoice` it becomes `past_due` when its invoice is not + * paid by the due date, and `canceled` or `unpaid` if it is still not paid by an + * additional deadline after that. Note that when a subscription has a status of + * `unpaid`, no subsequent invoices will be attempted (invoices will be created, but + * then immediately automatically closed). After receiving updated payment information + * from a customer, you may choose to reopen and pay their closed invoices. */ status: SubscriptionStatus;