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

@ -770,7 +770,11 @@ namespace Bit.Core.Services
{ {
if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId)) if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId))
{ {
await _stripePaymentService.CancelSubscriptionAsync(organization, true); try
{
await _stripePaymentService.CancelSubscriptionAsync(organization, true);
}
catch(GatewayException) { }
} }
await _organizationRepository.DeleteAsync(organization); await _organizationRepository.DeleteAsync(organization);

View File

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