From fb45f75bc8910cd123e0b596be9fabfa6e183fd7 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Sep 2018 14:00:56 -0400 Subject: [PATCH] catch gateway exception when canceling on delete --- src/Core/Services/Implementations/OrganizationService.cs | 6 +++++- src/Core/Services/Implementations/UserService.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index b4d58718f7..67d9b2eb69 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -770,7 +770,11 @@ namespace Bit.Core.Services { if(!string.IsNullOrWhiteSpace(organization.GatewaySubscriptionId)) { - await _stripePaymentService.CancelSubscriptionAsync(organization, true); + try + { + await _stripePaymentService.CancelSubscriptionAsync(organization, true); + } + catch(GatewayException) { } } await _organizationRepository.DeleteAsync(organization); diff --git a/src/Core/Services/Implementations/UserService.cs b/src/Core/Services/Implementations/UserService.cs index 14089f4405..33106e03e9 100644 --- a/src/Core/Services/Implementations/UserService.cs +++ b/src/Core/Services/Implementations/UserService.cs @@ -182,7 +182,11 @@ namespace Bit.Core.Services if(!string.IsNullOrWhiteSpace(user.GatewaySubscriptionId)) { var paymentService = user.GetPaymentService(_globalSettings); - await paymentService.CancelSubscriptionAsync(user, true); + try + { + await paymentService.CancelSubscriptionAsync(user, true); + } + catch(GatewayException) { } } await _userRepository.DeleteAsync(user);