1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

Sales Tax for Premium signups (#1087)

* Started charging sales tax on Premium signups

* added a line break
This commit is contained in:
Addison Beck 2021-01-14 17:53:37 -05:00 committed by GitHub
parent 9f938f5efd
commit c9cab74476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<string>(1)
{
taxRate.Id
};
}
if (additionalStorageGb > 0)
{
subCreateOptions.Items.Add(new SubscriptionItemOptions