Fix: Refund flow failed when lnurl was the only payment method

This commit is contained in:
Kukks 2022-06-30 08:52:56 +02:00
parent 27b6cf436b
commit e5a1da7136
No known key found for this signature in database
GPG Key ID: 8E5530D9D1C93097

View File

@ -187,7 +187,10 @@ namespace BTCPayServer.Controllers
var paymentMethods = invoice.GetBlob(_NetworkProvider).GetPaymentMethods();
var pmis = paymentMethods.Select(method => method.GetId()).ToList();
var options = (await payoutHandlers.GetSupportedPaymentMethods(invoice.StoreData)).Where(id => pmis.Contains(id)).ToList();
pmis = pmis.Concat(pmis.Where(id => id.PaymentType == LNURLPayPaymentType.Instance)
.Select(id => new PaymentMethodId(id.CryptoCode, LightningPaymentType.Instance))).ToList();
var relevant = payoutHandlers.Where(handler => pmis.Any(handler.CanHandle));
var options = (await relevant.GetSupportedPaymentMethods(invoice.StoreData)).Where(id => pmis.Contains(id)).ToList();
if (!options.Any())
{
TempData.SetStatusMessageModel(new StatusMessageModel()