Add bigger than zero validation for payment request amount (#981)

fix #844
This commit is contained in:
Umar Bolatov 2019-08-21 17:05:06 +03:00 committed by Nicolas Dorier
parent 3d00611ddf
commit 13f2be7811

View File

@ -48,7 +48,10 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
public string Id { get; set; }
[Required] public string StoreId { get; set; }
[Required][Range(0, double.PositiveInfinity)]public decimal Amount { get; set; }
[Required]
[Range(double.Epsilon, double.PositiveInfinity, ErrorMessage = "Please enter a value bigger than zero")]
public decimal Amount { get; set; }
[Display(Name = "The currency used for payment request. (e.g. BTC, LTC, USD, etc.)")]
public string Currency { get; set; }