1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

support credit purchases and prorated upgrades

This commit is contained in:
Kyle Spearrin
2019-02-20 23:54:27 -05:00
parent e10c99ec96
commit 01d324a8b4
4 changed files with 76 additions and 29 deletions

View File

@ -22,7 +22,8 @@ namespace Bit.Core.Models.Api
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if(string.IsNullOrWhiteSpace(PaymentToken) && License == null)
var creditType = PaymentMethodType.HasValue && PaymentMethodType.Value == Enums.PaymentMethodType.Credit;
if(string.IsNullOrWhiteSpace(PaymentToken) && !creditType && License == null)
{
yield return new ValidationResult("Payment token or license is required.");
}