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:
parent
b8a2158626
commit
bc4eeff604
@ -444,20 +444,24 @@ namespace Bit.Core.Services
|
|||||||
Quantity = 1,
|
Quantity = 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
if (!string.IsNullOrWhiteSpace(taxInfo?.BillingAddressCountry)
|
||||||
new Bit.Core.Models.Table.TaxRate()
|
&& !string.IsNullOrWhiteSpace(taxInfo?.BillingAddressPostalCode))
|
||||||
{
|
|
||||||
Country = customer.Address.Country,
|
|
||||||
PostalCode = customer.Address.PostalCode
|
|
||||||
}
|
|
||||||
);
|
|
||||||
var taxRate = taxRates.FirstOrDefault();
|
|
||||||
if (taxRate != null)
|
|
||||||
{
|
{
|
||||||
subCreateOptions.DefaultTaxRates = new List<string>(1)
|
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
||||||
{
|
new Bit.Core.Models.Table.TaxRate()
|
||||||
taxRate.Id
|
{
|
||||||
};
|
Country = taxInfo.BillingAddressCountry,
|
||||||
|
PostalCode = taxInfo.BillingAddressPostalCode
|
||||||
|
}
|
||||||
|
);
|
||||||
|
var taxRate = taxRates.FirstOrDefault();
|
||||||
|
if (taxRate != null)
|
||||||
|
{
|
||||||
|
subCreateOptions.DefaultTaxRates = new List<string>(1)
|
||||||
|
{
|
||||||
|
taxRate.Id
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (additionalStorageGb > 0)
|
if (additionalStorageGb > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user