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:
d11n
2022-01-19 12:58:02 +01:00
committed by GitHub
parent 51c486c15a
commit c419ad68bb
29 changed files with 223 additions and 428 deletions

View File

@@ -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
});