mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-20 13:34:37 +01:00
Fix crash if refunding an invoice without payment
This commit is contained in:
parent
654cf1982e
commit
4a2f61de9f
1 changed files with 2 additions and 1 deletions
|
@ -353,7 +353,8 @@ namespace BTCPayServer.Controllers
|
|||
return View("_RefundModal", model);
|
||||
}
|
||||
|
||||
var paymentMethodId = PaymentMethodId.GetSimilarities([pmi], invoice.GetPayments(false).Select(p => p.PaymentMethodId))
|
||||
var availablePaymentMethodIds = invoice.GetPaymentPrompts().Select(p => p.PaymentMethodId).Where(p => _handlers.Support(p)).ToArray();
|
||||
var paymentMethodId = PaymentMethodId.GetSimilarities([pmi], availablePaymentMethodIds)
|
||||
.OrderByDescending(o => o.similarity)
|
||||
.Select(o => o.b)
|
||||
.FirstOrDefault();
|
||||
|
|
Loading…
Add table
Reference in a new issue