1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05: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

@ -8,7 +8,7 @@ namespace Bit.Core.Utilities
{
public static class BillingHelpers
{
internal static async Task AdjustStorageAsync(IPaymentService paymentService, IStorableSubscriber storableSubscriber,
internal static async Task<string> AdjustStorageAsync(IPaymentService paymentService, IStorableSubscriber storableSubscriber,
short storageAdjustmentGb, string storagePlanId)
{
if(storableSubscriber == null)
@ -51,8 +51,10 @@ namespace Bit.Core.Utilities
}
var additionalStorage = newStorageGb - 1;
await paymentService.AdjustStorageAsync(storableSubscriber, additionalStorage, storagePlanId);
var paymentIntentClientSecret = await paymentService.AdjustStorageAsync(storableSubscriber,
additionalStorage, storagePlanId);
storableSubscriber.MaxStorageGb = newStorageGb;
return paymentIntentClientSecret;
}
}
}