2019-05-29 16:33:31 +02:00
|
|
|
using System;
|
2018-01-18 12:56:55 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
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";
|
|
|
|
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 04:06:13 +01:00
|
|
|
public InvoiceEvent(InvoiceEntity invoice, int code, string name)
|
2018-01-18 12:56:55 +01:00
|
|
|
{
|
2018-06-21 07:15:36 +02:00
|
|
|
Invoice = invoice;
|
2018-01-18 12:56:55 +01:00
|
|
|
EventCode = code;
|
|
|
|
Name = name;
|
|
|
|
}
|
|
|
|
|
2019-02-19 04:06:13 +01:00
|
|
|
public InvoiceEntity Invoice { get; set; }
|
2018-01-18 12:56:55 +01: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 12:56:55 +01:00
|
|
|
public override string ToString()
|
|
|
|
{
|
2018-06-21 07:15:36 +02:00
|
|
|
return $"Invoice {Invoice.Id} new event: {Name} ({EventCode})";
|
2018-01-18 12:56:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|