mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
replaces #1591 and #1592 , closes #1571 Replaces the Currencies.txt to a json format which includes the networks too ( there is also a test to check now) Also makes CurrencyPair not depend on network and instead use CurrencyNameTable
35 lines
927 B
C#
35 lines
927 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
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}";
|
|
}
|
|
}
|
|
}
|