From df651a2157b048ab7fc2c8578adc6494d955ef73 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 18 Sep 2024 18:11:15 +0900 Subject: [PATCH] Fix GetInvoicesWithPendingPayments --- BTCPayServer/Services/Invoices/InvoiceRepository.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Services/Invoices/InvoiceRepository.cs b/BTCPayServer/Services/Invoices/InvoiceRepository.cs index 8e7717495..584dd7d06 100644 --- a/BTCPayServer/Services/Invoices/InvoiceRepository.cs +++ b/BTCPayServer/Services/Invoices/InvoiceRepository.cs @@ -93,8 +93,9 @@ namespace BTCPayServer.Services.Invoices public async Task 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(); return await GetInvoices(new InvoiceQuery()