mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Remove redundant payment methods from store settings (#3323)
* Add enabled toggle to wallet settings view * Add enabled toggle to Lightning settings view * Remove redundant payment methods from store settings * Rename Payment Methods to Payments * Adapt tests * Fix invoice state toggle on details page * Add spacing on Lightning sett8ings page
This commit is contained in:
@@ -589,19 +589,17 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("{storeId}/payment-methods")]
|
||||
public IActionResult PaymentMethods()
|
||||
[HttpGet("{storeId}/payment")]
|
||||
public IActionResult Payment()
|
||||
{
|
||||
var store = HttpContext.GetStoreData();
|
||||
if (store == null)
|
||||
return NotFound();
|
||||
|
||||
var storeBlob = store.GetStoreBlob();
|
||||
var vm = new PaymentMethodsViewModel
|
||||
var vm = new PaymentViewModel
|
||||
{
|
||||
Id = store.Id,
|
||||
HintWallet = storeBlob.Hints.Wallet,
|
||||
HintLightning = storeBlob.Hints.Lightning,
|
||||
NetworkFeeMode = storeBlob.NetworkFeeMode,
|
||||
AnyoneCanCreateInvoice = storeBlob.AnyoneCanInvoice,
|
||||
PaymentTolerance = storeBlob.PaymentTolerance,
|
||||
@@ -609,17 +607,11 @@ namespace BTCPayServer.Controllers
|
||||
DefaultCurrency = storeBlob.DefaultCurrency
|
||||
};
|
||||
|
||||
AddPaymentMethods(store, storeBlob,
|
||||
out var derivationSchemes, out var lightningNodes);
|
||||
|
||||
vm.DerivationSchemes = derivationSchemes;
|
||||
vm.LightningNodes = lightningNodes;
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
[HttpPost("{storeId}/payment-methods")]
|
||||
public async Task<IActionResult> PaymentMethods(PaymentMethodsViewModel model, string command = null)
|
||||
[HttpPost("{storeId}/payment")]
|
||||
public async Task<IActionResult> Payment(PaymentViewModel model, string command = null)
|
||||
{
|
||||
bool needUpdate = false;
|
||||
var blob = CurrentStore.GetStoreBlob();
|
||||
@@ -641,7 +633,7 @@ namespace BTCPayServer.Controllers
|
||||
TempData[WellKnownTempData.SuccessMessage] = "Payment settings successfully updated";
|
||||
}
|
||||
|
||||
return RedirectToAction(nameof(PaymentMethods), new
|
||||
return RedirectToAction(nameof(Payment), new
|
||||
{
|
||||
storeId = CurrentStore.Id
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user