btcpayserver/BTCPayServer.Client/Models/InvoiceData.cs

73 lines
2.5 KiB
C#
Raw Normal View History

2020-07-22 13:58:41 +02:00
using System;
using System.Collections.Generic;
using BTCPayServer.JsonConverters;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace BTCPayServer.Client.Models
{
public class InvoiceData : CreateInvoiceRequest
{
public string Id { get; set; }
2020-07-24 09:40:37 +02:00
[JsonConverter(typeof(StringEnumConverter))]
public InvoiceStatus Status { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
2020-07-27 10:43:35 +02:00
public InvoiceExceptionStatus AdditionalStatus { get; set; }
2020-07-22 13:58:41 +02:00
public Dictionary<string, PaymentMethodDataModel> PaymentMethodData { get; set; }
public class PaymentMethodDataModel
{
public string Destination { get; set; }
public string PaymentLink { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal Rate { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal PaymentMethodPaid { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal TotalPaid { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal Due { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal Amount { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal NetworkFee { get; set; }
public List<Payment> Payments { get; set; }
public class Payment
{
public string Id { get; set; }
[JsonConverter(typeof(NBitcoin.JsonConverters.DateTimeToUnixTimeConverter))]
public DateTime ReceivedDate { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal Value { get; set; }
2020-07-24 10:53:31 +02:00
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
2020-07-22 13:58:41 +02:00
public decimal Fee { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public PaymentStatus Status { get; set; }
public string Destination { get; set; }
public enum PaymentStatus
{
Invalid,
AwaitingConfirmation,
AwaitingCompletion,
Complete
}
}
}
}
}