1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

handle sub incomplete status

This commit is contained in:
Kyle Spearrin
2019-08-12 10:42:14 -04:00
parent 41f9f6a7f0
commit 5c3bf78226
2 changed files with 5 additions and 3 deletions

View File

@ -976,7 +976,8 @@ namespace Bit.Core.Services
throw new GatewayException("Subscription was not found.");
}
if(sub.CanceledAt.HasValue || sub.Status == "canceled" || sub.Status == "unpaid")
if(sub.CanceledAt.HasValue || sub.Status == "canceled" || sub.Status == "unpaid" ||
sub.Status == "incomplete_expired")
{
// Already canceled
return;
@ -1021,7 +1022,8 @@ namespace Bit.Core.Services
throw new GatewayException("Subscription was not found.");
}
if((sub.Status != "active" && sub.Status != "trialing") || !sub.CanceledAt.HasValue)
if((sub.Status != "active" && sub.Status != "trialing" && !sub.Status.StartsWith("incomplete")) ||
!sub.CanceledAt.HasValue)
{
throw new GatewayException("Subscription is not marked for cancellation.");
}