mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 17:26:05 +01:00
Fix GetInvoicesWithPendingPayments
This commit is contained in:
parent
2d2c1d5f2d
commit
df651a2157
1 changed files with 2 additions and 1 deletions
|
@ -93,8 +93,9 @@ namespace BTCPayServer.Services.Invoices
|
|||
|
||||
public async Task<InvoiceEntity[]> GetInvoicesWithPendingPayments(PaymentMethodId paymentMethodId, bool includeAddresses = false)
|
||||
{
|
||||
var pmi = paymentMethodId.ToString();
|
||||
using var ctx = _applicationDbContextFactory.CreateContext();
|
||||
var invoiceIds = (await ctx.Payments.Where(p => PaymentData.IsPending(p.Status)).Select(p => p.InvoiceDataId).ToArrayAsync()).Distinct().ToArray();
|
||||
var invoiceIds = (await ctx.Payments.Where(p => PaymentData.IsPending(p.Status) && p.Type == pmi).Select(p => p.InvoiceDataId).ToArrayAsync()).Distinct().ToArray();
|
||||
if (invoiceIds.Length is 0)
|
||||
return Array.Empty<InvoiceEntity>();
|
||||
return await GetInvoices(new InvoiceQuery()
|
||||
|
|
Loading…
Add table
Reference in a new issue