Make sure that lightning payments events are using the state of the invoice when they got issued (#205)

This commit is contained in:
nicolas.dorier
2018-06-21 14:15:36 +09:00
parent db24ab792f
commit 17e914778d
7 changed files with 35 additions and 32 deletions

View File

@@ -209,7 +209,7 @@ namespace BTCPayServer.Controllers
entity.PosData = invoice.PosData;
entity = await _InvoiceRepository.CreateInvoiceAsync(store.Id, entity, paymentMethodErrors, _NetworkProvider);
_EventAggregator.Publish(new Events.InvoiceEvent(entity, 1001, "invoice_created"));
_EventAggregator.Publish(new Events.InvoiceEvent(entity.EntityToDTO(_NetworkProvider), 1001, "invoice_created"));
var resp = entity.EntityToDTO(_NetworkProvider);
return new DataWrapper<InvoiceResponse>(resp) { Facade = "pos/invoice" };
}