mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
fix refund button part 2
This commit is contained in:
@@ -199,8 +199,9 @@ namespace BTCPayServer.Controllers
|
||||
// TODO: What if no option?
|
||||
var refund = new RefundModel();
|
||||
refund.Title = "Select a payment method";
|
||||
refund.AvailablePaymentMethods = new SelectList(options.Select(id => new SelectListItem(id.ToPrettyString(), id.ToString())), "Value", "Text");
|
||||
refund.SelectedPaymentMethod = defaultRefund?.ToString() ?? invoice.GetBlob(_NetworkProvider).GetPaymentMethods().First().GetId().ToString();
|
||||
refund.AvailablePaymentMethods =
|
||||
new SelectList(options.Select(id => new SelectListItem(id.ToPrettyString(), id.ToString())), "Value", "Text");
|
||||
refund.SelectedPaymentMethod = defaultRefund?.ToString() ?? options.First().ToString();
|
||||
|
||||
// Nothing to select, skip to next
|
||||
if (refund.AvailablePaymentMethods.Count() == 1)
|
||||
|
||||
@@ -56,7 +56,9 @@ namespace BTCPayServer.Data
|
||||
this IEnumerable<IPayoutHandler> payoutHandlers, List<PaymentMethodId> paymentMethodIds = null)
|
||||
{
|
||||
return payoutHandlers.SelectMany(handler => handler.GetSupportedPaymentMethods())
|
||||
.Where(id => paymentMethodIds is null || paymentMethodIds.Contains(id));
|
||||
.Where(id => paymentMethodIds is null || paymentMethodIds.Contains(id) ||
|
||||
//TODO: Handle this condition in a cleaner way
|
||||
(id.PaymentType == LightningPaymentType.Instance && paymentMethodIds.Contains(new PaymentMethodId(id.CryptoCode, PaymentTypes.LNURLPay))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user