1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-26 07:12:20 -05:00

Don't enable tax for customer without tax info (#5347)

This commit is contained in:
Alex Morask 2025-01-30 10:26:34 -05:00 committed by Alex Morask
parent b587b6a168
commit e68394a743
No known key found for this signature in database
GPG Key ID: 23E38285B743E3A8

View File

@ -356,11 +356,20 @@ public class OrganizationBillingService(
}
}
var customerHasTaxInfo = customer is
{
Address:
{
Country: not null and not "",
PostalCode: not null and not ""
}
};
var subscriptionCreateOptions = new SubscriptionCreateOptions
{
AutomaticTax = new SubscriptionAutomaticTaxOptions
{
Enabled = true
Enabled = customerHasTaxInfo
},
CollectionMethod = StripeConstants.CollectionMethod.ChargeAutomatically,
Customer = customer.Id,