From c9cab744769dfbe251f21cbffb13f0bac79852c6 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Thu, 14 Jan 2021 17:53:37 -0500 Subject: [PATCH] Sales Tax for Premium signups (#1087) * Started charging sales tax on Premium signups * added a line break --- .../Implementations/StripePaymentService.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Core/Services/Implementations/StripePaymentService.cs b/src/Core/Services/Implementations/StripePaymentService.cs index b0ad30ff14..4aaf150644 100644 --- a/src/Core/Services/Implementations/StripePaymentService.cs +++ b/src/Core/Services/Implementations/StripePaymentService.cs @@ -444,6 +444,22 @@ namespace Bit.Core.Services Quantity = 1, }); + var taxRates = await _taxRateRepository.GetByLocationAsync( + new Bit.Core.Models.Table.TaxRate() + { + Country = customer.Address.Country, + PostalCode = customer.Address.PostalCode + } + ); + var taxRate = taxRates.FirstOrDefault(); + if (taxRate != null) + { + subCreateOptions.DefaultTaxRates = new List(1) + { + taxRate.Id + }; + } + if (additionalStorageGb > 0) { subCreateOptions.Items.Add(new SubscriptionItemOptions