1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-22 20:11:04 -05: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 try
{ {
await _stripePaymentService.CancelSubscriptionAsync(organization, true); var eop = !organization.ExpirationDate.HasValue ||
organization.ExpirationDate.Value >= DateTime.UtcNow;
await _stripePaymentService.CancelSubscriptionAsync(organization, eop);
} }
catch(GatewayException) { } catch(GatewayException) { }
} }

View File

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