mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
23 lines
736 B
C#
23 lines
736 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Services.Invoices;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public static class InvoiceDataExtensions
|
|
{
|
|
public static InvoiceEntity GetBlob(this Data.InvoiceData invoiceData, BTCPayNetworkProvider networks)
|
|
{
|
|
var entity = NBitcoin.JsonConverters.Serializer.ToObject<InvoiceEntity>(ZipUtils.Unzip(invoiceData.Blob), null);
|
|
entity.Networks = networks;
|
|
return entity;
|
|
}
|
|
public static InvoiceState GetInvoiceState(this InvoiceData invoiceData)
|
|
{
|
|
return new InvoiceState(invoiceData.Status, invoiceData.ExceptionStatus);
|
|
}
|
|
}
|
|
}
|