2019-09-19 08:46:26 -04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Api
|
|
|
|
|
|
{
|
|
|
|
|
|
public class IapCheckRequestModel : IValidatableObject
|
|
|
|
|
|
{
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public PaymentMethodType? PaymentMethodType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
|
|
|
|
{
|
2020-03-27 14:36:37 -04:00
|
|
|
|
if (PaymentMethodType != Enums.PaymentMethodType.AppleInApp)
|
2019-09-19 08:46:26 -04:00
|
|
|
|
{
|
|
|
|
|
|
yield return new ValidationResult("Not a supported in-app purchase payment method.",
|
|
|
|
|
|
new string[] { nameof(PaymentMethodType) });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|