From 0ce5f87616742ebf9c9b88f8e674ec5d006f7784 Mon Sep 17 00:00:00 2001 From: Rishabh Garg Date: Tue, 27 Oct 2020 15:19:48 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Added=20`past=5Fdue`=20and=20`un?= =?UTF-8?q?paid`=20subscriptions=20for=20members=20(#12301)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/server/models/member.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/server/models/member.js b/core/server/models/member.js index 722638da8d..829dc9fecd 100644 --- a/core/server/models/member.js +++ b/core/server/models/member.js @@ -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'] ); } );