1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -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

@ -529,7 +529,7 @@ namespace Bit.Api.Controllers
[HttpPost("storage")]
[SelfHosted(NotSelfHostedOnly = true)]
public async Task PostStorage([FromBody]StorageRequestModel model)
public async Task<PaymentResponseModel> PostStorage([FromBody]StorageRequestModel model)
{
var user = await _userService.GetUserByPrincipalAsync(User);
if(user == null)
@ -537,7 +537,12 @@ namespace Bit.Api.Controllers
throw new UnauthorizedAccessException();
}
await _userService.AdjustStorageAsync(user, model.StorageGbAdjustment.Value);
var result = await _userService.AdjustStorageAsync(user, model.StorageGbAdjustment.Value);
return new PaymentResponseModel
{
Success = true,
PaymentIntentClientSecret = result
};
}
[HttpPost("license")]