2017-12-17 14:17:42 +09:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
2018-02-17 13:18:16 +09:00
|
|
|
|
using BTCPayServer.Services.Invoices;
|
2017-12-17 14:17:42 +09:00
|
|
|
|
|
|
|
|
|
namespace BTCPayServer.Events
|
|
|
|
|
{
|
|
|
|
|
public class InvoiceDataChangedEvent
|
|
|
|
|
{
|
2018-02-17 13:18:16 +09:00
|
|
|
|
public InvoiceDataChangedEvent(InvoiceEntity invoice)
|
|
|
|
|
{
|
|
|
|
|
InvoiceId = invoice.Id;
|
|
|
|
|
Status = invoice.Status;
|
|
|
|
|
ExceptionStatus = invoice.ExceptionStatus;
|
|
|
|
|
}
|
2017-12-17 14:17:42 +09:00
|
|
|
|
public string InvoiceId { get; set; }
|
2018-01-14 21:48:23 +09:00
|
|
|
|
public string Status { get; internal set; }
|
|
|
|
|
public string ExceptionStatus { get; internal set; }
|
2017-12-17 14:17:42 +09:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
2018-01-14 21:48:23 +09:00
|
|
|
|
if (string.IsNullOrEmpty(ExceptionStatus) || ExceptionStatus == "false")
|
|
|
|
|
{
|
|
|
|
|
return $"Invoice status is {Status}";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return $"Invoice status is {Status} (Exception status: {ExceptionStatus})";
|
|
|
|
|
}
|
2017-12-17 14:17:42 +09:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|