🐛 Added past_due and unpaid subscriptions for members (#12301)

refs https://github.com/TryGhost/Ghost/issues/12256 , https://github.com/TryGhost/Ghost/issues/12255

Currently when listing subscriptions for Members in both the Admin and the Theme, we only show the subscriptions which have a status of trialing or active.

Based on discussion, the `unpaid` and `past_due` states on Stripe also represent owner's intention of considering a subscription as active instead of `cancelled`, so we allow any subscriptions under these 2 states to be also listed for a member and consider them as `paid`.

- Subscriptions will go into a past_due state if the payment is missed, this should be considered a grace period where the member still has access.

- After this the subscriptions will either go to the unpaid or the cancelled state - this can be configured on an account by account basis in the Stripe dashboard. `unpaid` is considered as an intention to keep the subscription to allow for re-activation later.
This commit is contained in:
Rishabh Garg 2020-10-27 15:19:48 +05:30 committed by GitHub
parent 0c62f28a42
commit 0ce5f87616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ const Member = ghostBookshelf.Model.extend({
'customer_id',
'id',
'customer_id'
).query('whereIn', 'status', ['active', 'trialing']);
).query('whereIn', 'status', ['active', 'trialing', 'past_due', 'unpaid']);
},
serialize(options) {
@ -211,7 +211,7 @@ const Member = ghostBookshelf.Model.extend({
'members_stripe_customers_subscriptions.customer_id'
).onIn(
'members_stripe_customers_subscriptions.status',
['active', 'trialing']
['active', 'trialing', 'past_due', 'unpaid']
);
}
);