btcpayserver/BTCPayServer.Client/Models/InvoiceData.cs
Andrew Camilleri 8f4f87cd8f
Update BTCPayServer.Client/Models/InvoiceData.cs
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
2020-08-26 21:36:30 +09:00

72 lines
2.5 KiB
C#

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; }
[JsonConverter(typeof(StringEnumConverter))]
public InvoiceStatus Status { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public InvoiceExceptionStatus ExceptionStatus { get; set; }
public Dictionary<string, PaymentMethodDataModel> PaymentMethodData { get; set; }
public class PaymentMethodDataModel
{
public string Destination { get; set; }
public string PaymentLink { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal Rate { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal PaymentMethodPaid { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal TotalPaid { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal Due { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal Amount { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
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; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
public decimal Value { get; set; }
[JsonProperty(ItemConverterType = typeof(NumericStringJsonConverter))]
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
}
}
}
}
}