1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

add support for passing payment method type

This commit is contained in:
Kyle Spearrin
2019-02-19 17:13:21 -05:00
parent de85dbc67c
commit a9336a0e02
12 changed files with 91 additions and 55 deletions

View File

@ -463,7 +463,7 @@ namespace Bit.Api.Controllers
throw new BadRequestException("Invalid license.");
}
await _userService.SignUpPremiumAsync(user, model.PaymentToken,
await _userService.SignUpPremiumAsync(user, model.PaymentToken, model.PaymentMethodType,
model.AdditionalStorageGb.GetValueOrDefault(0), license);
return new ProfileResponseModel(user, null, await _userService.TwoFactorIsEnabledAsync(user));
}
@ -518,7 +518,7 @@ namespace Bit.Api.Controllers
throw new UnauthorizedAccessException();
}
await _userService.ReplacePaymentMethodAsync(user, model.PaymentToken);
await _userService.ReplacePaymentMethodAsync(user, model.PaymentToken, model.PaymentMethodType);
}
[HttpPost("storage")]

View File

@ -209,7 +209,8 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
await _organizationService.ReplacePaymentMethodAsync(orgIdGuid, model.PaymentToken);
await _organizationService.ReplacePaymentMethodAsync(orgIdGuid, model.PaymentToken,
model.PaymentMethodType);
}
[HttpPost("{id}/upgrade")]