2017-10-20 14:06:37 -05:00
|
|
|
|
using BTCPayServer.Services.Invoices;
|
2017-09-13 23:50:36 +09:00
|
|
|
|
using BTCPayServer.Validations;
|
2017-12-06 18:08:21 +09:00
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
2017-09-13 23:50:36 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BTCPayServer.Models.StoreViewModels
|
|
|
|
|
{
|
|
|
|
|
public class StoreViewModel
|
|
|
|
|
{
|
2017-12-06 18:08:21 +09:00
|
|
|
|
class Format
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
}
|
|
|
|
|
public StoreViewModel()
|
|
|
|
|
{
|
|
|
|
|
var btcPay = new Format { Name = "BTCPay", Value = "BTCPay" };
|
|
|
|
|
DerivationSchemeFormat = btcPay.Value;
|
|
|
|
|
DerivationSchemeFormats = new SelectList(new Format[]
|
|
|
|
|
{
|
|
|
|
|
btcPay,
|
|
|
|
|
new Format { Name = "Electrum", Value = "Electrum" },
|
|
|
|
|
}, nameof(btcPay.Value), nameof(btcPay.Name), btcPay);
|
|
|
|
|
}
|
2017-12-03 23:35:52 +09:00
|
|
|
|
public string Id { get; set; }
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[Display(Name = "Store Name")]
|
|
|
|
|
[Required]
|
|
|
|
|
[MaxLength(50)]
|
|
|
|
|
[MinLength(1)]
|
|
|
|
|
public string StoreName
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[Url]
|
|
|
|
|
[Display(Name = "Store Website")]
|
|
|
|
|
[MaxLength(500)]
|
|
|
|
|
public string StoreWebsite
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string DerivationScheme
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2017-12-06 18:08:21 +09:00
|
|
|
|
[Display(Name = "Derivation Scheme format")]
|
|
|
|
|
public string DerivationSchemeFormat
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SelectList DerivationSchemeFormats { get; set; }
|
|
|
|
|
|
2017-12-03 14:43:52 +09:00
|
|
|
|
[Display(Name = "Payment invalid if transactions fails to confirm after ... minutes")]
|
|
|
|
|
[Range(10, 60 * 24 * 31)]
|
|
|
|
|
public int MonitoringExpiration
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[Display(Name = "Consider the invoice confirmed when the payment transaction...")]
|
|
|
|
|
public SpeedPolicy SpeedPolicy
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[Display(Name = "Add network fee to invoice (vary with mining fees)")]
|
|
|
|
|
public bool NetworkFee
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-10-23 19:27:22 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public List<(string KeyPath, string Address)> AddressSamples
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
} = new List<(string KeyPath, string Address)>();
|
2017-10-05 00:05:38 +09:00
|
|
|
|
|
2017-10-27 17:53:04 +09:00
|
|
|
|
public string StatusMessage
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
}
|