mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
31 lines
830 B
C#
31 lines
830 B
C#
namespace BTCPayServer.Events
|
|
{
|
|
public class InvoiceIPNEvent
|
|
{
|
|
public InvoiceIPNEvent(string invoiceId, int? eventCode, string name)
|
|
{
|
|
InvoiceId = invoiceId;
|
|
EventCode = eventCode;
|
|
Name = name;
|
|
}
|
|
|
|
public int? EventCode { get; set; }
|
|
public string Name { get; set; }
|
|
|
|
public string InvoiceId { get; set; }
|
|
public string Error { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
string ipnType = "IPN";
|
|
if (EventCode.HasValue)
|
|
{
|
|
ipnType = $"IPN ({EventCode.Value} {Name})";
|
|
}
|
|
if (Error == null)
|
|
return $"{ipnType} sent for invoice {InvoiceId}";
|
|
return $"Error while sending {ipnType}: {Error}";
|
|
}
|
|
}
|
|
}
|