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

make payment method type required

This commit is contained in:
Kyle Spearrin
2019-02-26 12:45:34 -05:00
parent 91bbc3e8f9
commit 506fe28ee7
9 changed files with 19 additions and 81 deletions

View File

@ -463,7 +463,7 @@ namespace Bit.Api.Controllers
throw new BadRequestException("Invalid license.");
}
await _userService.SignUpPremiumAsync(user, model.PaymentToken, model.PaymentMethodType,
await _userService.SignUpPremiumAsync(user, model.PaymentToken, model.PaymentMethodType.Value,
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, model.PaymentMethodType);
await _userService.ReplacePaymentMethodAsync(user, model.PaymentToken, model.PaymentMethodType.Value);
}
[HttpPost("storage")]

View File

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