1
0
mirror of https://github.com/bitwarden/server synced 2025-12-14 15:23:42 +00:00

adjust storage with payment intent/method handling

This commit is contained in:
Kyle Spearrin
2019-08-10 12:59:32 -04:00
parent e60f1a4f50
commit 74bbeae776
9 changed files with 66 additions and 22 deletions

View File

@@ -774,7 +774,7 @@ namespace Bit.Core.Services
await SaveUserAsync(user);
}
public async Task AdjustStorageAsync(User user, short storageAdjustmentGb)
public async Task<string> AdjustStorageAsync(User user, short storageAdjustmentGb)
{
if(user == null)
{
@@ -786,8 +786,10 @@ namespace Bit.Core.Services
throw new BadRequestException("Not a premium user.");
}
await BillingHelpers.AdjustStorageAsync(_paymentService, user, storageAdjustmentGb, StoragePlanId);
var secret = await BillingHelpers.AdjustStorageAsync(_paymentService, user, storageAdjustmentGb,
StoragePlanId);
await SaveUserAsync(user);
return secret;
}
public async Task ReplacePaymentMethodAsync(User user, string paymentToken, PaymentMethodType paymentMethodType)