Beispiel #1
0
        public static InvoiceEntity GetBlob(this InvoiceData invoiceData, BTCPayNetworkProvider networks)
        {
            var entity = InvoiceRepository.FromBytes <InvoiceEntity>(invoiceData.Blob);

            entity.Networks = networks;
            if (entity.Metadata is null)
            {
                if (entity.Version < InvoiceEntity.GreenfieldInvoices_Version)
                {
                    entity.MigrateLegacyInvoice();
                }
                else
                {
                    entity.Metadata = new InvoiceMetadata();
                }
            }
            return(entity);
        }
Beispiel #2
0
 public static T GetBlob(PayoutProcessorData data)
 {
     return(InvoiceRepository.FromBytes <T>(data.Blob));
 }