1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 17:12:49 -05:00

[PM-13999] show estimated tax for taxable countries (#5110)

This commit is contained in:
Jonas Hendrickx
2025-01-02 20:27:53 +01:00
committed by GitHub
parent 1062c6d522
commit 97e11774e3
32 changed files with 1806 additions and 548 deletions

View File

@ -82,13 +82,19 @@ public class PremiumUserBillingService(
throw new BillingException();
}
var (address, taxIdData) = customerSetup.TaxInformation.GetStripeOptions();
var subscriberName = user.SubscriberName();
var customerCreateOptions = new CustomerCreateOptions
{
Address = address,
Address = new AddressOptions
{
Line1 = customerSetup.TaxInformation.Line1,
Line2 = customerSetup.TaxInformation.Line2,
City = customerSetup.TaxInformation.City,
PostalCode = customerSetup.TaxInformation.PostalCode,
State = customerSetup.TaxInformation.State,
Country = customerSetup.TaxInformation.Country,
},
Description = user.Name,
Email = user.Email,
Expand = ["tax"],
@ -113,8 +119,7 @@ public class PremiumUserBillingService(
Tax = new CustomerTaxOptions
{
ValidateLocation = StripeConstants.ValidateTaxLocationTiming.Immediately
},
TaxIdData = taxIdData
}
};
var (paymentMethodType, paymentMethodToken) = customerSetup.TokenizedPaymentSource;