Files
server/src/Api/Models/Request/IapCheckRequestModel.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
603 B
C#
Raw Normal View History

using System.ComponentModel.DataAnnotations;
2021-12-14 15:05:07 +00:00
using Enums = Bit.Core.Enums;
2019-09-19 08:46:26 -04:00
2021-12-14 15:05:07 +00:00
namespace Bit.Api.Models.Request;
2022-08-29 16:06:55 -04:00
2021-12-14 15:05:07 +00:00
public class IapCheckRequestModel : IValidatableObject
2019-09-19 08:46:26 -04:00
{
[Required]
public Enums.PaymentMethodType? PaymentMethodType { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
2022-08-29 16:06:55 -04:00
{
2021-12-14 15:05:07 +00: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) });
}
}
}