mirror of
https://github.com/bitwarden/server.git
synced 2025-07-11 12:53:50 -05:00
Consistency on TaxInfo use in service params
This commit is contained in:
@ -704,7 +704,7 @@ namespace Bit.Core.Services
|
||||
|
||||
public async Task<Tuple<bool, string>> SignUpPremiumAsync(User user, string paymentToken,
|
||||
PaymentMethodType paymentMethodType, short additionalStorageGb, UserLicense license,
|
||||
string country, string postalCode)
|
||||
TaxInfo taxInfo)
|
||||
{
|
||||
if (user.Premium)
|
||||
{
|
||||
@ -743,7 +743,7 @@ namespace Bit.Core.Services
|
||||
else
|
||||
{
|
||||
paymentIntentClientSecret = await _paymentService.PurchasePremiumAsync(user, paymentMethodType,
|
||||
paymentToken, additionalStorageGb, country, postalCode);
|
||||
paymentToken, additionalStorageGb, taxInfo);
|
||||
}
|
||||
|
||||
user.Premium = true;
|
||||
@ -845,14 +845,14 @@ namespace Bit.Core.Services
|
||||
return secret;
|
||||
}
|
||||
|
||||
public async Task ReplacePaymentMethodAsync(User user, string paymentToken, PaymentMethodType paymentMethodType)
|
||||
public async Task ReplacePaymentMethodAsync(User user, string paymentToken, PaymentMethodType paymentMethodType, TaxInfo taxInfo)
|
||||
{
|
||||
if (paymentToken.StartsWith("btok_"))
|
||||
{
|
||||
throw new BadRequestException("Invalid token.");
|
||||
}
|
||||
|
||||
var updated = await _paymentService.UpdatePaymentMethodAsync(user, paymentMethodType, paymentToken);
|
||||
var updated = await _paymentService.UpdatePaymentMethodAsync(user, paymentMethodType, paymentToken, taxInfo: taxInfo);
|
||||
if (updated)
|
||||
{
|
||||
await SaveUserAsync(user);
|
||||
|
Reference in New Issue
Block a user