mirror of
https://github.com/bitwarden/server
synced 2025-12-17 16:53:23 +00:00
null checked Stripe.Customer.Address for org seat and storage upgrades (#1099)
This commit is contained in:
@@ -415,6 +415,9 @@ namespace Bit.Core.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
var customer = await new CustomerService().GetAsync(sub.CustomerId);
|
var customer = await new CustomerService().GetAsync(sub.CustomerId);
|
||||||
|
if (!string.IsNullOrWhiteSpace(customer?.Address?.Country)
|
||||||
|
&& !string.IsNullOrWhiteSpace(customer?.Address?.PostalCode))
|
||||||
|
{
|
||||||
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
||||||
new Bit.Core.Models.Table.TaxRate()
|
new Bit.Core.Models.Table.TaxRate()
|
||||||
{
|
{
|
||||||
@@ -430,6 +433,7 @@ namespace Bit.Core.Services
|
|||||||
taxRate.Id
|
taxRate.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var subResponse = await subscriptionService.UpdateAsync(sub.Id, subUpdateOptions);
|
var subResponse = await subscriptionService.UpdateAsync(sub.Id, subUpdateOptions);
|
||||||
|
|
||||||
|
|||||||
@@ -719,6 +719,9 @@ namespace Bit.Core.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
var customer = await new CustomerService().GetAsync(sub.CustomerId);
|
var customer = await new CustomerService().GetAsync(sub.CustomerId);
|
||||||
|
if (!string.IsNullOrWhiteSpace(customer?.Address?.Country)
|
||||||
|
&& !string.IsNullOrWhiteSpace(customer?.Address?.PostalCode))
|
||||||
|
{
|
||||||
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
var taxRates = await _taxRateRepository.GetByLocationAsync(
|
||||||
new Bit.Core.Models.Table.TaxRate()
|
new Bit.Core.Models.Table.TaxRate()
|
||||||
{
|
{
|
||||||
@@ -734,6 +737,7 @@ namespace Bit.Core.Services
|
|||||||
taxRate.Id
|
taxRate.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var subResponse = await subscriptionService.UpdateAsync(sub.Id, subUpdateOptions);
|
var subResponse = await subscriptionService.UpdateAsync(sub.Id, subUpdateOptions);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user