btcpayserver/BTCPayServer/Models/StoreViewModels/StoreViewModel.cs

116 lines
3.3 KiB
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System.Collections.Generic;
2017-09-13 23:50:36 +09:00
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Client.Models;
2020-06-28 17:55:27 +09:00
using BTCPayServer.Validation;
using static BTCPayServer.Data.StoreBlob;
2017-09-13 23:50:36 +09:00
namespace BTCPayServer.Models.StoreViewModels
{
public class StoreViewModel
{
public class DerivationScheme
2017-12-06 18:08:21 +09:00
{
public string Crypto { get; set; }
2017-12-06 18:08:21 +09:00
public string Value { get; set; }
2018-07-26 22:32:24 +09:00
public WalletId WalletId { get; set; }
2019-12-24 08:20:44 +01:00
public bool WalletSupported { get; set; }
2018-07-27 13:37:16 +02:00
public bool Enabled { get; set; }
public bool Collapsed { get; set; }
2017-12-06 18:08:21 +09:00
}
2020-06-28 17:55:27 +09:00
public class AdditionalPaymentMethod
{
public string Provider { get; set; }
public bool Enabled { get; set; }
public string Action { get; set; }
}
2017-12-06 18:08:21 +09:00
public StoreViewModel()
{
2018-01-09 11:41:07 +09:00
2017-12-06 18:08:21 +09:00
}
public bool CanDelete { get; set; }
2020-10-23 17:15:07 +02:00
[Display(Name = "Store ID")]
public string Id { get; set; }
[Display(Name = "Store Name")]
[Required]
[MaxLength(50)]
[MinLength(1)]
public string StoreName
{
get; set;
}
2017-09-13 23:50:36 +09:00
2018-05-14 09:32:04 +02:00
[Uri]
[Display(Name = "Store Website")]
[MaxLength(500)]
public string StoreWebsite
{
get;
set;
}
2017-09-13 23:50:36 +09:00
[Display(Name = "Allow anyone to create invoice")]
public bool AnyoneCanCreateInvoice { get; set; }
public List<StoreViewModel.DerivationScheme> DerivationSchemes { get; set; } = new List<StoreViewModel.DerivationScheme>();
2017-12-06 18:08:21 +09:00
2020-07-22 15:31:09 +02:00
[Display(Name = "Invoice expires if the full amount has not been paid after …")]
[Range(1, 60 * 24 * 24)]
2018-01-17 15:11:05 +09:00
public int InvoiceExpiration
{
get;
set;
}
2020-07-22 15:31:09 +02:00
[Display(Name = "Payment invalid if transactions fails to confirm … after invoice expiration")]
[Range(10, 60 * 24 * 24)]
public int MonitoringExpiration
{
get;
set;
}
2020-07-22 15:31:09 +02:00
[Display(Name = "Consider the invoice confirmed when the payment transaction …")]
public SpeedPolicy SpeedPolicy
{
get; set;
}
2017-09-13 23:50:36 +09:00
2020-07-22 15:31:09 +02:00
[Display(Name = "Add additional fee (network fee) to invoice …")]
public NetworkFeeMode NetworkFeeMode
{
get; set;
}
[Display(Name = "Description template of the lightning invoice")]
public string LightningDescriptionTemplate { get; set; }
2020-06-28 17:55:27 +09:00
[Display(Name = "Enable Payjoin/P2EP")]
2020-06-28 17:55:27 +09:00
public bool PayJoinEnabled { get; set; }
public bool CanUsePayJoin { get; set; }
public bool HintWallet { get; set; }
public bool HintLightning { get; set; }
public class LightningNode
{
public string CryptoCode { get; set; }
public string Address { get; set; }
2018-07-27 13:37:16 +02:00
public bool Enabled { get; set; }
}
public List<LightningNode> LightningNodes
{
get; set;
} = new List<LightningNode>();
[Display(Name = "Consider the invoice paid even if the paid amount is ... % less than expected")]
[Range(0, 100)]
public double PaymentTolerance
{
get;
set;
}
}
2017-09-13 23:50:36 +09:00
}