mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
combined tax updates with other operations
This commit is contained in:
@ -345,7 +345,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
public async Task<string> PurchasePremiumAsync(User user, PaymentMethodType paymentMethodType,
|
||||
string paymentToken, short additionalStorageGb)
|
||||
string paymentToken, short additionalStorageGb, string country, string postalCode)
|
||||
{
|
||||
if (paymentMethodType != PaymentMethodType.Credit && string.IsNullOrWhiteSpace(paymentToken))
|
||||
{
|
||||
@ -463,10 +463,28 @@ namespace Bit.Core.Services
|
||||
InvoiceSettings = new CustomerInvoiceSettingsOptions
|
||||
{
|
||||
DefaultPaymentMethod = stipeCustomerPaymentMethodId
|
||||
}
|
||||
},
|
||||
Address = new AddressOptions
|
||||
{
|
||||
Line1 = string.Empty,
|
||||
Country = country,
|
||||
PostalCode = postalCode,
|
||||
},
|
||||
});
|
||||
createdStripeCustomer = true;
|
||||
}
|
||||
else if (customer != null)
|
||||
{
|
||||
await customerService.UpdateAsync(customer.Id, new CustomerUpdateOptions
|
||||
{
|
||||
Address = new AddressOptions
|
||||
{
|
||||
Line1 = string.Empty,
|
||||
Country = country,
|
||||
PostalCode = postalCode,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (customer == null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user