From bcfaf5541214d0250ece24d3311563eb8a8a017a Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Mon, 6 May 2024 11:56:02 -0400 Subject: [PATCH] [AC-2548] Remove automatic tax collection check from provider creation (#4042) * Remove automatic tax collection check * Fix tests --- .../StartSubscriptionCommand.cs | 7 ----- .../Commands/StartSubscriptionCommandTests.cs | 26 ------------------- 2 files changed, 33 deletions(-) diff --git a/src/Core/Billing/Commands/Implementations/StartSubscriptionCommand.cs b/src/Core/Billing/Commands/Implementations/StartSubscriptionCommand.cs index a3223f0ce..45cab1e0c 100644 --- a/src/Core/Billing/Commands/Implementations/StartSubscriptionCommand.cs +++ b/src/Core/Billing/Commands/Implementations/StartSubscriptionCommand.cs @@ -45,13 +45,6 @@ public class StartSubscriptionCommand( var customer = await GetOrCreateCustomerAsync(provider, taxInfo); - if (taxInfo.BillingAddressCountry == "US" && customer.Tax is not { AutomaticTax: StripeConstants.AutomaticTaxStatus.Supported }) - { - logger.LogError("Cannot start Provider subscription - Provider's ({ProviderID}) Stripe customer ({CustomerID}) is in the US and does not support automatic tax", provider.Id, customer.Id); - - throw ContactSupport(); - } - var providerPlans = await providerPlanRepository.GetByProviderId(provider.Id); if (providerPlans == null || providerPlans.Count == 0) diff --git a/test/Core.Test/Billing/Commands/StartSubscriptionCommandTests.cs b/test/Core.Test/Billing/Commands/StartSubscriptionCommandTests.cs index 308126380..6e8213c2d 100644 --- a/test/Core.Test/Billing/Commands/StartSubscriptionCommandTests.cs +++ b/test/Core.Test/Billing/Commands/StartSubscriptionCommandTests.cs @@ -105,32 +105,6 @@ public class StartSubscriptionCommandTests await DidNotRetrieveProviderPlansAsync(sutProvider); } - [Theory, BitAutoData] - public async Task StartSubscription_CustomerDoesNotSupportAutomaticTax_ThrowsBillingException( - SutProvider sutProvider, - Provider provider, - TaxInfo taxInfo) - { - provider.GatewayCustomerId = _customerId; - - provider.GatewaySubscriptionId = null; - - taxInfo.BillingAddressCountry = "US"; - - SetCustomerRetrieval(sutProvider, new Customer - { - Id = _customerId, - Tax = new CustomerTax - { - AutomaticTax = StripeConstants.AutomaticTaxStatus.NotCollecting - } - }); - - await ThrowsContactSupportAsync(() => sutProvider.Sut.StartSubscription(provider, taxInfo)); - - await DidNotRetrieveProviderPlansAsync(sutProvider); - } - [Theory, BitAutoData] public async Task StartSubscription_NoProviderPlans_ThrowsBillingException( SutProvider sutProvider,