1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-17 17:45:36 -05:00

changed the address data used to pull sales tax for premium subscriptions (#1109)

* changed the address data used to pull sales tax for premium subscriptions

* nulled checked for extra safety

* fixes null check
This commit is contained in:
Addison Beck 2021-01-25 09:56:53 -05:00 committed by GitHub
parent b8a2158626
commit bc4eeff604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,11 +444,14 @@ namespace Bit.Core.Services
Quantity = 1, Quantity = 1,
}); });
if (!string.IsNullOrWhiteSpace(taxInfo?.BillingAddressCountry)
&& !string.IsNullOrWhiteSpace(taxInfo?.BillingAddressPostalCode))
{
var taxRates = await _taxRateRepository.GetByLocationAsync( var taxRates = await _taxRateRepository.GetByLocationAsync(
new Bit.Core.Models.Table.TaxRate() new Bit.Core.Models.Table.TaxRate()
{ {
Country = customer.Address.Country, Country = taxInfo.BillingAddressCountry,
PostalCode = customer.Address.PostalCode PostalCode = taxInfo.BillingAddressPostalCode
} }
); );
var taxRate = taxRates.FirstOrDefault(); var taxRate = taxRates.FirstOrDefault();
@ -459,6 +462,7 @@ namespace Bit.Core.Services
taxRate.Id taxRate.Id
}; };
} }
}
if (additionalStorageGb > 0) if (additionalStorageGb > 0)
{ {