From 9e73260230b2fff2b2ba9ea2d415f6aded0e5722 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 27 Oct 2022 13:17:18 +0900 Subject: [PATCH] Fix: Invoice's orderId equals to payreq id shouldn't appear part of the payreq --- .../Services/PaymentRequests/PaymentRequestRepository.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Services/PaymentRequests/PaymentRequestRepository.cs b/BTCPayServer/Services/PaymentRequests/PaymentRequestRepository.cs index fc219a95f..611e34ba4 100644 --- a/BTCPayServer/Services/PaymentRequests/PaymentRequestRepository.cs +++ b/BTCPayServer/Services/PaymentRequests/PaymentRequestRepository.cs @@ -133,7 +133,9 @@ namespace BTCPayServer.Services.PaymentRequests } invoiceQuery.OrderId = new[] { GetOrderIdForPaymentRequest(paymentRequestId) }; - return await _InvoiceRepository.GetInvoices(invoiceQuery); + return (await _InvoiceRepository.GetInvoices(invoiceQuery)) + .Where(i => i.InternalTags.Contains(GetInternalTag(paymentRequestId))) + .ToArray(); } public static string GetOrderIdForPaymentRequest(string paymentRequestId)