mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 13:38:13 -05:00
22 lines
673 B
C#
22 lines
673 B
C#
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)
|
|
{
|
|
if(PaymentMethodType != Enums.PaymentMethodType.AppleInApp)
|
|
{
|
|
yield return new ValidationResult("Not a supported in-app purchase payment method.",
|
|
new string[] { nameof(PaymentMethodType) });
|
|
}
|
|
}
|
|
}
|
|
}
|