1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 21:48:12 -05:00

catch gateway exception when canceling on delete

This commit is contained in:
Kyle Spearrin 2018-09-07 14:00:56 -04:00
parent fceef7133e
commit fb45f75bc8
2 changed files with 10 additions and 2 deletions

View File

@ -769,9 +769,13 @@ namespace Bit.Core.Services
public async Task DeleteAsync(Organization organization)
{
if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId))
{
try
{
await _stripePaymentService.CancelSubscriptionAsync(organization, true);
}
catch(GatewayException) { }
}
await _organizationRepository.DeleteAsync(organization);
await _applicationCacheService.DeleteOrganizationAbilityAsync(organization.Id);

View File

@ -182,8 +182,12 @@ namespace Bit.Core.Services
if(!string.IsNullOrWhiteSpace(user.GatewaySubscriptionId))
{
var paymentService = user.GetPaymentService(_globalSettings);
try
{
await paymentService.CancelSubscriptionAsync(user, true);
}
catch(GatewayException) { }
}
await _userRepository.DeleteAsync(user);
await _pushService.PushLogOutAsync(user.Id);