mirror of
https://github.com/bitwarden/server.git
synced 2025-04-09 15:18:13 -05:00
catch gateway exception when canceling on delete
This commit is contained in:
parent
fceef7133e
commit
fb45f75bc8
@ -769,9 +769,13 @@ namespace Bit.Core.Services
|
|||||||
public async Task DeleteAsync(Organization organization)
|
public async Task DeleteAsync(Organization organization)
|
||||||
{
|
{
|
||||||
if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId))
|
if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await _stripePaymentService.CancelSubscriptionAsync(organization, true);
|
await _stripePaymentService.CancelSubscriptionAsync(organization, true);
|
||||||
}
|
}
|
||||||
|
catch(GatewayException) { }
|
||||||
|
}
|
||||||
|
|
||||||
await _organizationRepository.DeleteAsync(organization);
|
await _organizationRepository.DeleteAsync(organization);
|
||||||
await _applicationCacheService.DeleteOrganizationAbilityAsync(organization.Id);
|
await _applicationCacheService.DeleteOrganizationAbilityAsync(organization.Id);
|
||||||
|
@ -182,8 +182,12 @@ namespace Bit.Core.Services
|
|||||||
if(!string.IsNullOrWhiteSpace(user.GatewaySubscriptionId))
|
if(!string.IsNullOrWhiteSpace(user.GatewaySubscriptionId))
|
||||||
{
|
{
|
||||||
var paymentService = user.GetPaymentService(_globalSettings);
|
var paymentService = user.GetPaymentService(_globalSettings);
|
||||||
|
try
|
||||||
|
{
|
||||||
await paymentService.CancelSubscriptionAsync(user, true);
|
await paymentService.CancelSubscriptionAsync(user, true);
|
||||||
}
|
}
|
||||||
|
catch(GatewayException) { }
|
||||||
|
}
|
||||||
|
|
||||||
await _userRepository.DeleteAsync(user);
|
await _userRepository.DeleteAsync(user);
|
||||||
await _pushService.PushLogOutAsync(user.Id);
|
await _pushService.PushLogOutAsync(user.Id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user