1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

cancel on delete

This commit is contained in:
Kyle Spearrin 2018-12-31 14:07:19 -05:00
parent 6d173385b0
commit 4ad1634d1d
2 changed files with 4 additions and 3 deletions

View File

@ -785,7 +785,9 @@ namespace Bit.Core.Services
{
try
{
await _stripePaymentService.CancelSubscriptionAsync(organization, true);
var eop = !organization.ExpirationDate.HasValue ||
organization.ExpirationDate.Value >= DateTime.UtcNow;
await _stripePaymentService.CancelSubscriptionAsync(organization, eop);
}
catch(GatewayException) { }
}

View File

@ -205,10 +205,9 @@ namespace Bit.Core.Services
if(!string.IsNullOrWhiteSpace(user.GatewaySubscriptionId))
{
var paymentService = user.GetPaymentService(_globalSettings);
try
{
await paymentService.CancelSubscriptionAsync(user, true);
await CancelPremiumAsync(user);
}
catch(GatewayException) { }
}