From 7d36a0d3981d11ce5c0ff53f16b72ea1fd02c7c6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 16 Feb 2019 16:08:12 -0500 Subject: [PATCH] filter canceled orgs --- src/Billing/Controllers/StripeController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Billing/Controllers/StripeController.cs b/src/Billing/Controllers/StripeController.cs index 1dfdaff5b..b61e4f69f 100644 --- a/src/Billing/Controllers/StripeController.cs +++ b/src/Billing/Controllers/StripeController.cs @@ -206,11 +206,14 @@ namespace Bit.Billing.Controllers }); foreach(var sub in subscriptions) { - ids = GetIdsFromMetaData(sub.Metadata); - if(ids.Item1.HasValue || ids.Item2.HasValue) + if(sub.Status != "canceled") { - subscription = sub; - break; + ids = GetIdsFromMetaData(sub.Metadata); + if(ids.Item1.HasValue || ids.Item2.HasValue) + { + subscription = sub; + break; + } } } }