2018-03-23 17:27:48 +09:00
|
|
|
|
using BTCPayServer.Services;
|
|
|
|
|
using BTCPayServer.Services.Invoices;
|
2018-05-03 03:32:42 +09:00
|
|
|
|
using BTCPayServer.Services.Rates;
|
2018-05-14 09:32:04 +02:00
|
|
|
|
using BTCPayServer.Validation;
|
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
|
|
|
|
|
{
|
2018-01-08 22:45:09 +09:00
|
|
|
|
public class DerivationScheme
|
2017-12-06 18:08:21 +09:00
|
|
|
|
{
|
2018-01-08 22:45:09 +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; }
|
2018-07-27 13:37:16 +02:00
|
|
|
|
public bool Enabled { get; set; }
|
2017-12-06 18:08:21 +09:00
|
|
|
|
}
|
2018-10-24 07:52:19 +02:00
|
|
|
|
|
|
|
|
|
public class ThirdPartyPaymentMethod
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
}
|
2018-01-08 22:45:09 +09:00
|
|
|
|
|
2018-07-19 22:23:14 +09:00
|
|
|
|
public bool CanDelete { get; set; }
|
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
|
|
|
|
|
2018-05-14 09:32:04 +02:00
|
|
|
|
[Uri]
|
2017-10-27 17:53:04 +09:00
|
|
|
|
[Display(Name = "Store Website")]
|
|
|
|
|
[MaxLength(500)]
|
|
|
|
|
public string StoreWebsite
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
|
2018-09-08 14:32:26 +09:00
|
|
|
|
[Display(Name = "Allow anyone to create invoice")]
|
|
|
|
|
public bool AnyoneCanCreateInvoice { get; set; }
|
|
|
|
|
|
2018-01-08 22:45:09 +09:00
|
|
|
|
public List<StoreViewModel.DerivationScheme> DerivationSchemes { get; set; } = new List<StoreViewModel.DerivationScheme>();
|
2017-12-06 18:08:21 +09:00
|
|
|
|
|
2018-10-24 07:52:19 +02:00
|
|
|
|
public List<ThirdPartyPaymentMethod> ThirdPartyPaymentMethods { get; set; } =
|
|
|
|
|
new List<ThirdPartyPaymentMethod>();
|
|
|
|
|
|
2018-01-17 15:11:05 +09:00
|
|
|
|
[Display(Name = "Invoice expires if the full amount has not been paid after ... minutes")]
|
2018-04-07 11:53:33 +09:00
|
|
|
|
[Range(1, 60 * 24 * 24)]
|
2018-01-17 15:11:05 +09:00
|
|
|
|
public int InvoiceExpiration
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Display(Name = "Payment invalid if transactions fails to confirm ... minutes after invoice expiration")]
|
2018-04-07 11:53:33 +09:00
|
|
|
|
[Range(10, 60 * 24 * 24)]
|
2017-12-03 14:43:52 +09:00
|
|
|
|
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
|
|
|
|
|
2019-01-05 00:37:09 +09:00
|
|
|
|
[Display(Name = "Add additional fee (network fee) to invoice...")]
|
|
|
|
|
public Data.NetworkFeeMode NetworkFeeMode
|
2017-10-27 17:53:04 +09:00
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
2017-10-23 19:27:22 +09:00
|
|
|
|
|
2018-04-07 16:27:46 +09:00
|
|
|
|
[Display(Name = "Description template of the lightning invoice")]
|
|
|
|
|
public string LightningDescriptionTemplate { get; set; }
|
|
|
|
|
|
2018-02-26 00:48:12 +09:00
|
|
|
|
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; }
|
2018-02-26 00:48:12 +09:00
|
|
|
|
}
|
|
|
|
|
public List<LightningNode> LightningNodes
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
} = new List<LightningNode>();
|
2018-05-04 16:15:34 +02:00
|
|
|
|
|
|
|
|
|
[Display(Name = "Consider the invoice paid even if the paid amount is ... % less than expected")]
|
|
|
|
|
[Range(0, 100)]
|
|
|
|
|
public double PaymentTolerance
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
2017-10-27 17:53:04 +09:00
|
|
|
|
}
|
2017-09-13 23:50:36 +09:00
|
|
|
|
}
|