[UI] Do not show unabled payment methods in invoice creation (#6272)

This commit is contained in:
Nicolas Dorier
2024-10-03 21:34:09 +09:00
committed by GitHub
parent 413a9b4269
commit 2f2b4094f6
4 changed files with 15 additions and 10 deletions

View File

@@ -1177,7 +1177,7 @@ namespace BTCPayServer.Controllers
if (store == null)
return NotFound();
if (!store.AnyPaymentMethodAvailable())
if (!store.AnyPaymentMethodAvailable(_handlers))
{
return NoPaymentMethodResult(store.Id);
}
@@ -1200,7 +1200,7 @@ namespace BTCPayServer.Controllers
public async Task<IActionResult> CreateInvoice(CreateInvoiceModel model, CancellationToken cancellationToken)
{
var store = HttpContext.GetStoreData();
if (!store.AnyPaymentMethodAvailable())
if (!store.AnyPaymentMethodAvailable(_handlers))
{
return NoPaymentMethodResult(store.Id);
}
@@ -1370,9 +1370,7 @@ namespace BTCPayServer.Controllers
private SelectList GetPaymentMethodsSelectList(StoreData store)
{
var excludeFilter = store.GetStoreBlob().GetExcludedPaymentMethods();
return new SelectList(store.GetPaymentMethodConfigs()
.Where(s => !excludeFilter.Match(s.Key))
return new SelectList(store.GetPaymentMethodConfigs(_handlers, true)
.Select(method => new SelectListItem(method.Key.ToString(), method.Key.ToString())),
nameof(SelectListItem.Value),
nameof(SelectListItem.Text));