mirror of
https://github.com/bitwarden/server
synced 2025-12-14 15:23:42 +00:00
support credit purchases and prorated upgrades
This commit is contained in:
@@ -708,7 +708,7 @@ namespace Bit.Core.Services
|
||||
Directory.CreateDirectory(dir);
|
||||
File.WriteAllText($"{dir}/{user.Id}.json", JsonConvert.SerializeObject(license, Formatting.Indented));
|
||||
}
|
||||
else if(!string.IsNullOrWhiteSpace(paymentToken))
|
||||
else
|
||||
{
|
||||
if(!paymentMethodType.HasValue)
|
||||
{
|
||||
@@ -729,10 +729,6 @@ namespace Bit.Core.Services
|
||||
await _paymentService.PurchasePremiumAsync(user, paymentMethodType.Value,
|
||||
paymentToken, additionalStorageGb);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("License or payment token is required.");
|
||||
}
|
||||
|
||||
user.Premium = true;
|
||||
user.RevisionDate = DateTime.UtcNow;
|
||||
|
||||
Reference in New Issue
Block a user