1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-29 13:25:17 +01:00

handle incomplete status in webhook

This commit is contained in:
Kyle Spearrin 2019-08-12 10:45:05 -04:00
parent 5c3bf78226
commit 18e6149329

View File

@ -102,8 +102,9 @@ namespace Bit.Billing.Controllers
var subCanceled = subDeleted && subscription.Status == "canceled"; var subCanceled = subDeleted && subscription.Status == "canceled";
var subUnpaid = subUpdated && subscription.Status == "unpaid"; var subUnpaid = subUpdated && subscription.Status == "unpaid";
var subIncompleteExpired = subUpdated && subscription.Status == "incomplete_expired";
if(subCanceled || subUnpaid) if(subCanceled || subUnpaid || subIncompleteExpired)
{ {
// org // org
if(ids.Item1.HasValue) if(ids.Item1.HasValue)
@ -213,7 +214,7 @@ namespace Bit.Billing.Controllers
}); });
foreach(var sub in subscriptions) foreach(var sub in subscriptions)
{ {
if(sub.Status != "canceled") if(sub.Status != "canceled" && sub.Status != "incomplete_expired")
{ {
ids = GetIdsFromMetaData(sub.Metadata); ids = GetIdsFromMetaData(sub.Metadata);
if(ids.Item1.HasValue || ids.Item2.HasValue) if(ids.Item1.HasValue || ids.Item2.HasValue)