2018-01-18 20:56:55 +09:00
|
|
|
using BTCPayServer.Services.Invoices;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Events
|
|
|
|
{
|
|
|
|
public class InvoiceEvent
|
|
|
|
{
|
2019-01-06 10:12:45 +01:00
|
|
|
public const string Created = "invoice_created";
|
|
|
|
public const string ReceivedPayment = "invoice_receivedPayment";
|
|
|
|
public const string MarkedCompleted = "invoice_markedComplete";
|
2020-06-28 17:55:27 +09:00
|
|
|
public const string MarkedInvalid = "invoice_markedInvalid";
|
|
|
|
public const string Expired = "invoice_expired";
|
|
|
|
public const string ExpiredPaidPartial = "invoice_expiredPaidPartial";
|
|
|
|
public const string PaidInFull = "invoice_paidInFull";
|
|
|
|
public const string PaidAfterExpiration = "invoice_paidAfterExpiration";
|
|
|
|
public const string FailedToConfirm = "invoice_failedToConfirm";
|
|
|
|
public const string Confirmed = "invoice_confirmed";
|
|
|
|
public const string Completed = "invoice_completed";
|
|
|
|
|
2019-02-19 12:06:13 +09:00
|
|
|
public InvoiceEvent(InvoiceEntity invoice, int code, string name)
|
2018-01-18 20:56:55 +09:00
|
|
|
{
|
2018-06-21 14:15:36 +09:00
|
|
|
Invoice = invoice;
|
2018-01-18 20:56:55 +09:00
|
|
|
EventCode = code;
|
|
|
|
Name = name;
|
|
|
|
}
|
|
|
|
|
2019-02-19 12:06:13 +09:00
|
|
|
public InvoiceEntity Invoice { get; set; }
|
2018-01-18 20:56:55 +09:00
|
|
|
public int EventCode { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
2019-01-06 10:12:45 +01:00
|
|
|
public PaymentEntity Payment { get; set; }
|
|
|
|
|
2018-01-18 20:56:55 +09:00
|
|
|
public override string ToString()
|
|
|
|
{
|
2018-06-21 14:15:36 +09:00
|
|
|
return $"Invoice {Invoice.Id} new event: {Name} ({EventCode})";
|
2018-01-18 20:56:55 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|