mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-01 13:14:30 +01:00
Make InvoicePaymentSettled return correct afterExpiration value
fixes #3966
This commit is contained in:
@@ -540,7 +540,7 @@ namespace BTCPayServer.Services.Invoices
|
||||
return invoice;
|
||||
}
|
||||
|
||||
private InvoiceEntity ToEntity(Data.InvoiceData invoice)
|
||||
public InvoiceEntity ToEntity(Data.InvoiceData invoice)
|
||||
{
|
||||
var entity = invoice.GetBlob(_btcPayNetworkProvider);
|
||||
PaymentMethodDictionary paymentMethods = null;
|
||||
|
||||
@@ -15,12 +15,16 @@ namespace BTCPayServer.Services.Invoices
|
||||
{
|
||||
private readonly ApplicationDbContextFactory _applicationDbContextFactory;
|
||||
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
|
||||
private readonly InvoiceRepository _invoiceRepository;
|
||||
private readonly EventAggregator _eventAggregator;
|
||||
|
||||
public PaymentService(EventAggregator eventAggregator, ApplicationDbContextFactory applicationDbContextFactory, BTCPayNetworkProvider btcPayNetworkProvider)
|
||||
public PaymentService(EventAggregator eventAggregator,
|
||||
ApplicationDbContextFactory applicationDbContextFactory,
|
||||
BTCPayNetworkProvider btcPayNetworkProvider, InvoiceRepository invoiceRepository)
|
||||
{
|
||||
_applicationDbContextFactory = applicationDbContextFactory;
|
||||
_btcPayNetworkProvider = btcPayNetworkProvider;
|
||||
_invoiceRepository = invoiceRepository;
|
||||
_eventAggregator = eventAggregator;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -109,7 +113,7 @@ namespace BTCPayServer.Services.Invoices
|
||||
foreach (KeyValuePair<string, (PaymentEntity entity, CryptoPaymentData)> payment in paymentsDict)
|
||||
{
|
||||
var dbPayment = dbPayments[payment.Key];
|
||||
var invBlob = dbPayment.InvoiceData.GetBlob(_btcPayNetworkProvider);
|
||||
var invBlob = _invoiceRepository.ToEntity(dbPayment.InvoiceData);
|
||||
var dbPaymentEntity = dbPayment.GetBlob(_btcPayNetworkProvider);
|
||||
var wasConfirmed = dbPayment.GetBlob(_btcPayNetworkProvider).GetCryptoPaymentData()
|
||||
.PaymentConfirmed(dbPaymentEntity, invBlob.SpeedPolicy);
|
||||
|
||||
Reference in New Issue
Block a user