Rename UI controllers

This commit is contained in:
nicolas.dorier
2022-01-07 12:32:00 +09:00
parent ce43de0c57
commit 7a787fc945
276 changed files with 506 additions and 503 deletions

View File

@@ -1,2 +1,2 @@
<li class="nav-item"><a asp-controller="TestExtension" asp-action="Index" class="nav-link js-scroll-trigger" >Dear Nicolas Dorier</a></li>
<li class="nav-item"><a asp-controller="UITestExtension" asp-action="Index" class="nav-link js-scroll-trigger" >Dear Nicolas Dorier</a></li>

View File

@@ -69,7 +69,7 @@ namespace BTCPayServer.Tests
Assert.Equal(3, invoice.CryptoInfo.Length);
var controller = user.GetController<StoresController>();
var controller = user.GetController<UIStoresController>();
var lightningVm = (LightningNodeViewModel)Assert.IsType<ViewResult>(await controller.SetupLightningNode(user.StoreId, cryptoCode)).Model;
Assert.True(lightningVm.Enabled);
var response = await controller.SetLightningNodeEnabled(user.StoreId, cryptoCode, false);
@@ -200,7 +200,7 @@ namespace BTCPayServer.Tests
invoice = user.BitPay.GetInvoice(invoice.Id);
Assert.Equal("paid", invoice.Status);
});
var wallet = tester.PayTester.GetController<WalletsController>();
var wallet = tester.PayTester.GetController<UIWalletsController>();
var psbt = wallet.CreatePSBT(btcNetwork, onchainBTC,
new WalletSendModel()
{
@@ -310,7 +310,7 @@ namespace BTCPayServer.Tests
Assert.Single(invoice.CryptoInfo); // Only BTC should be presented
var controller = tester.PayTester.GetController<InvoiceController>(null);
var controller = tester.PayTester.GetController<UIInvoiceController>(null);
var checkout =
(Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id)
.GetAwaiter().GetResult()).Value;
@@ -493,7 +493,7 @@ namespace BTCPayServer.Tests
Assert.Single(invoice.CryptoInfo); // Only BTC should be presented
var controller = tester.PayTester.GetController<InvoiceController>(null);
var controller = tester.PayTester.GetController<UIInvoiceController>(null);
var checkout =
(Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id, null)
.GetAwaiter().GetResult()).Value;
@@ -555,7 +555,7 @@ namespace BTCPayServer.Tests
Assert.False((bool)((JValue)invoice.ExceptionStatus).Value);
});
controller = tester.PayTester.GetController<InvoiceController>(null);
controller = tester.PayTester.GetController<UIInvoiceController>(null);
checkout = (Models.InvoicingModels.PaymentModel)((JsonResult)controller.GetStatus(invoice.Id, "LTC")
.GetAwaiter().GetResult()).Value;
Assert.Equal(2, checkout.AvailableCryptos.Count);
@@ -608,7 +608,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
user.RegisterDerivationScheme("LTC");
var apps = user.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.PointOfSale.ToString();
@@ -639,7 +639,7 @@ donation:
.IsType<ViewResult>(apps.UpdatePointOfSale(app.Id)).Model);
Assert.Equal("hello", vmpos.Title);
var publicApps = user.GetController<AppsPublicController>();
var publicApps = user.GetController<UIAppsPublicController>();
var vmview =
Assert.IsType<ViewPointOfSaleViewModel>(Assert
.IsType<ViewResult>(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);
@@ -673,7 +673,7 @@ donation:
// testing custom amount
var action = Assert.IsType<RedirectToActionResult>(publicApps
.ViewPointOfSale(app.Id, PosViewType.Cart, 6.6m, null, null, null, null, "donation").Result);
Assert.Equal(nameof(InvoiceController.Checkout), action.ActionName);
Assert.Equal(nameof(UIInvoiceController.Checkout), action.ActionName);
invoices = user.BitPay.GetInvoices();
var donationInvoice = invoices.Single(i => i.Price == 6.6m);
Assert.NotNull(donationInvoice);
@@ -711,7 +711,7 @@ donation:
custom: true
";
Assert.IsType<RedirectToActionResult>(apps.UpdatePointOfSale(app.Id, vmpos).Result);
publicApps = user.GetController<AppsPublicController>();
publicApps = user.GetController<UIAppsPublicController>();
vmview = Assert.IsType<ViewPointOfSaleViewModel>(Assert
.IsType<ViewResult>(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);
Assert.Equal(test.Code, vmview.CurrencyCode);
@@ -768,7 +768,7 @@ noninventoryitem:
Assert.NotNull(inventoryItemInvoice);
//let's mark the inventoryitem invoice as invalid, this should return the item to back in stock
var controller = tester.PayTester.GetController<InvoiceController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIInvoiceController>(user.UserId, user.StoreId);
var appService = tester.PayTester.GetService<AppService>();
var eventAggregator = tester.PayTester.GetService<EventAggregator>();
Assert.IsType<JsonResult>(await controller.ChangeInvoiceState(inventoryItemInvoice.Id, "invalid"));

View File

@@ -40,7 +40,7 @@ namespace BTCPayServer.Tests
user.RegisterDerivationScheme("BTC");
user.RegisterDerivationScheme("USDT");
Assert.Equal(3, Assert.IsType<ListWalletsViewModel>(Assert.IsType<ViewResult>(await user.GetController<WalletsController>().ListWallets()).Model).Wallets.Count);
Assert.Equal(3, Assert.IsType<ListWalletsViewModel>(Assert.IsType<ViewResult>(await user.GetController<UIWalletsController>().ListWallets()).Model).Wallets.Count);
}
}

View File

@@ -33,8 +33,8 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
var user2 = tester.NewAccount();
await user2.GrantAccessAsync();
var apps = user.GetController<AppsController>();
var apps2 = user2.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var apps2 = user2.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
Assert.NotNull(vm.SelectedAppType);
Assert.Null(vm.AppName);
@@ -72,7 +72,7 @@ namespace BTCPayServer.Tests
var user = tester.NewAccount();
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
var apps = user.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.Crowdfund.ToString();
@@ -90,8 +90,8 @@ namespace BTCPayServer.Tests
Assert.IsType<RedirectToActionResult>(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result);
var anonAppPubsController = tester.PayTester.GetController<AppsPublicController>();
var publicApps = user.GetController<AppsPublicController>();
var anonAppPubsController = tester.PayTester.GetController<UIAppsPublicController>();
var publicApps = user.GetController<UIAppsPublicController>();
Assert.IsType<NotFoundObjectResult>(await anonAppPubsController.ContributeToCrowdfund(app.Id, new ContributeToCrowdfund()
{
@@ -162,7 +162,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
await user.SetNetworkFeeMode(NetworkFeeMode.Never);
var apps = user.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.Crowdfund.ToString();
@@ -182,8 +182,8 @@ namespace BTCPayServer.Tests
crowdfundViewModel.EnforceTargetAmount = true;
Assert.IsType<RedirectToActionResult>(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result);
var anonAppPubsController = tester.PayTester.GetController<AppsPublicController>();
var publicApps = user.GetController<AppsPublicController>();
var anonAppPubsController = tester.PayTester.GetController<UIAppsPublicController>();
var publicApps = user.GetController<UIAppsPublicController>();
var model = Assert.IsType<ViewCrowdfundViewModel>(Assert
.IsType<ViewResult>(publicApps.ViewCrowdfund(app.Id, String.Empty).Result).Model);

View File

@@ -1208,7 +1208,7 @@ namespace BTCPayServer.Tests
testCases.ForEach(tuple =>
{
Assert.Equal(tuple.expectedOutput, InvoiceController.PosDataParser.ParsePosData(tuple.input));
Assert.Equal(tuple.expectedOutput, UIInvoiceController.PosDataParser.ParsePosData(tuple.input));
});
}
[Fact]

View File

@@ -977,7 +977,7 @@ namespace BTCPayServer.Tests
var paymentTestPaymentRequest = await client.CreatePaymentRequest(user.StoreId,
new CreatePaymentRequestRequest() { Amount = 0.1m, Currency = "BTC", Title = "Payment test title" });
var invoiceId = Assert.IsType<string>(Assert.IsType<OkObjectResult>(await user.GetController<PaymentRequestController>()
var invoiceId = Assert.IsType<string>(Assert.IsType<OkObjectResult>(await user.GetController<UIPaymentRequestController>()
.PayPaymentRequest(paymentTestPaymentRequest.Id, false)).Value);
var invoice = user.BitPay.GetInvoice(invoiceId);
await tester.WaitForEvent<InvoiceDataChangedEvent>(async () =>
@@ -1332,7 +1332,7 @@ namespace BTCPayServer.Tests
}
});
Assert.EndsWith($"/i/{newInvoice.Id}", newInvoice.CheckoutLink);
var controller = tester.PayTester.GetController<InvoiceController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIInvoiceController>(user.UserId, user.StoreId);
var model = (PaymentModel)((ViewResult)await controller.Checkout(newInvoice.Id)).Model;
Assert.Equal("it-IT", model.DefaultLang);
Assert.Equal("http://toto.com/lol", model.MerchantRefLink);

View File

@@ -28,7 +28,7 @@ namespace BTCPayServer.Tests
var user = tester.NewAccount();
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
var apps = user.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
vm.AppName = "test";
vm.SelectedAppType = AppType.PointOfSale.ToString();
@@ -52,7 +52,7 @@ donation:
Assert.IsType<RedirectToActionResult>(apps.UpdatePointOfSale(app.Id, vmpos).Result);
vmpos = Assert.IsType<UpdatePointOfSaleViewModel>(Assert
.IsType<ViewResult>(apps.UpdatePointOfSale(app.Id)).Model);
var publicApps = user.GetController<AppsPublicController>();
var publicApps = user.GetController<UIAppsPublicController>();
var vmview =
Assert.IsType<ViewPointOfSaleViewModel>(Assert
.IsType<ViewResult>(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model);

View File

@@ -47,7 +47,7 @@ namespace BTCPayServer.Tests
Assert.Equal("paid", invoice.Status);
});
var walletController = user.GetController<WalletsController>();
var walletController = user.GetController<UIWalletsController>();
var walletId = new WalletId(user.StoreId, "BTC");
var sendDestination = new Key().PubKey.Hash.GetAddress(user.SupportedNetwork.NBitcoinNetwork).ToString();
var sendModel = new WalletSendModel()

View File

@@ -469,7 +469,7 @@ namespace BTCPayServer.Tests
changeIndex = i;
}
var derivationSchemeSettings = alice.GetController<WalletsController>().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC"));
var derivationSchemeSettings = alice.GetController<UIWalletsController>().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC"));
var signingAccount = derivationSchemeSettings.GetSigningAccountKeySettings();
psbt.SignAll(derivationSchemeSettings.AccountDerivation, alice.GenerateWalletResponseV.AccountHDKey, signingAccount.GetRootedKeyPath());
using var fakeServer = new FakeServer();

View File

@@ -35,8 +35,8 @@ namespace BTCPayServer.Tests
await user2.GrantAccessAsync();
var paymentRequestController = user.GetController<PaymentRequestController>();
var guestpaymentRequestController = user2.GetController<PaymentRequestController>();
var paymentRequestController = user.GetController<UIPaymentRequestController>();
var guestpaymentRequestController = user2.GetController<UIPaymentRequestController>();
var request = new UpdatePaymentRequestViewModel
{
@@ -104,7 +104,7 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
user.RegisterDerivationScheme("BTC");
var paymentRequestController = user.GetController<PaymentRequestController>();
var paymentRequestController = user.GetController<UIPaymentRequestController>();
Assert.IsType<NotFoundResult>(
await paymentRequestController.PayPaymentRequest(Guid.NewGuid().ToString()));
@@ -132,7 +132,7 @@ namespace BTCPayServer.Tests
await paymentRequestController.PayPaymentRequest(response.Value.ToString()));
Assert.Equal("Checkout", actionResult.ActionName);
Assert.Equal("Invoice", actionResult.ControllerName);
Assert.Equal("UIInvoice", actionResult.ControllerName);
Assert.Contains(actionResult.RouteValues,
pair => pair.Key == "Id" && pair.Value.ToString() == invoiceId);
@@ -170,7 +170,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
var paymentRequestController = user.GetController<PaymentRequestController>();
var paymentRequestController = user.GetController<UIPaymentRequestController>();
Assert.IsType<NotFoundResult>(await
paymentRequestController.CancelUnpaidPendingInvoice(Guid.NewGuid().ToString(), false));
@@ -209,7 +209,7 @@ namespace BTCPayServer.Tests
await paymentRequestController.PayPaymentRequest(response.Value.ToString()));
Assert.Equal("Checkout", actionResult.ActionName);
Assert.Equal("Invoice", actionResult.ControllerName);
Assert.Equal("UIInvoice", actionResult.ControllerName);
Assert.Contains(actionResult.RouteValues,
pair => pair.Key == "Id" && pair.Value.ToString() == invoiceId);

View File

@@ -150,8 +150,8 @@ namespace BTCPayServer.Tests
s.Driver.AssertNoError();
Assert.Contains("/login", s.Driver.Url);
s.GoToUrl("/Manage/Index");
Assert.Contains("ReturnUrl=%2FManage%2FIndex", s.Driver.Url);
s.GoToUrl("/UIManage/Index");
Assert.Contains("ReturnUrl=%2FUIManage%2FIndex", s.Driver.Url);
// We should be redirected to login
//Same User Can Log Back In
@@ -160,7 +160,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("LoginButton")).Click();
// We should be redirected to invoice
Assert.EndsWith("/Manage/Index", s.Driver.Url);
Assert.EndsWith("/UIManage/Index", s.Driver.Url);
// Should not be able to reach server settings
s.GoToUrl("/server/users");
@@ -668,6 +668,8 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("Amount")).SendKeys("700");
s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC");
s.Driver.FindElement(By.Id("SaveButton")).Click();
var aaa = s.Driver.PageSource;
var url = s.Driver.Url;
s.Driver.FindElement(By.Id("ViewAppButton")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last());
Assert.Equal("Amount due", s.Driver.FindElement(By.CssSelector("[data-test='amount-due-title']")).Text);

View File

@@ -70,9 +70,9 @@ namespace BTCPayServer.Tests
public async Task<BTCPayServerClient> CreateClient(params string[] permissions)
{
var manageController = parent.PayTester.GetController<ManageController>(UserId, StoreId, IsAdmin);
var manageController = parent.PayTester.GetController<UIManageController>(UserId, StoreId, IsAdmin);
var x = Assert.IsType<RedirectToActionResult>(await manageController.AddApiKey(
new ManageController.AddApiKeyViewModel()
new UIManageController.AddApiKeyViewModel()
{
PermissionValues = permissions.Select(s =>
{
@@ -82,11 +82,11 @@ namespace BTCPayServer.Tests
{
var stores = p.Where(permission => !string.IsNullOrEmpty(permission.Scope))
.Select(permission => permission.Scope).ToList();
return new ManageController.AddApiKeyViewModel.PermissionValueItem()
return new UIManageController.AddApiKeyViewModel.PermissionValueItem()
{
Permission = p.Key,
Forbidden = false,
StoreMode = stores.Any() ? ManageController.AddApiKeyViewModel.ApiKeyStoreMode.Specific : ManageController.AddApiKeyViewModel.ApiKeyStoreMode.AllStores,
StoreMode = stores.Any() ? UIManageController.AddApiKeyViewModel.ApiKeyStoreMode.Specific : UIManageController.AddApiKeyViewModel.ApiKeyStoreMode.AllStores,
SpecificStores = stores,
Value = true
};
@@ -109,7 +109,7 @@ namespace BTCPayServer.Tests
{
await RegisterAsync(isAdmin);
await CreateStoreAsync();
var store = GetController<StoresController>();
var store = GetController<UIStoresController>();
var pairingCode = BitPay.RequestClientAuthorization("test", Facade.Merchant);
Assert.IsType<ViewResult>(await store.RequestPairing(pairingCode.ToString()));
await store.Pair(pairingCode.ToString(), StoreId);
@@ -135,7 +135,7 @@ namespace BTCPayServer.Tests
public async Task ModifyPayment(Action<PaymentMethodsViewModel> modify)
{
var storeController = GetController<StoresController>();
var storeController = GetController<UIStoresController>();
var response = storeController.PaymentMethods();
PaymentMethodsViewModel paymentMethods = (PaymentMethodsViewModel)((ViewResult)response).Model;
modify(paymentMethods);
@@ -144,7 +144,7 @@ namespace BTCPayServer.Tests
public async Task ModifyWalletSettings(Action<WalletSettingsViewModel> modify)
{
var storeController = GetController<StoresController>();
var storeController = GetController<UIStoresController>();
var response = await storeController.WalletSettings(StoreId, "BTC");
WalletSettingsViewModel walletSettings = (WalletSettingsViewModel)((ViewResult)response).Model;
modify(walletSettings);
@@ -153,7 +153,7 @@ namespace BTCPayServer.Tests
public async Task ModifyOnchainPaymentSettings(Action<WalletSettingsViewModel> modify)
{
var storeController = GetController<StoresController>();
var storeController = GetController<UIStoresController>();
var response = await storeController.WalletSettings(StoreId, "BTC");
WalletSettingsViewModel walletSettings = (WalletSettingsViewModel)((ViewResult)response).Model;
modify(walletSettings);
@@ -172,7 +172,7 @@ namespace BTCPayServer.Tests
{
await RegisterAsync();
}
var store = GetController<UserStoresController>();
var store = GetController<UIUserStoresController>();
await store.CreateStore(new CreateStoreViewModel { Name = "Test Store" });
StoreId = store.CreatedStoreId;
parent.Stores.Add(StoreId);
@@ -191,7 +191,7 @@ namespace BTCPayServer.Tests
if (StoreId is null)
await CreateStoreAsync();
SupportedNetwork = parent.NetworkProvider.GetNetwork<BTCPayNetwork>(cryptoCode);
var store = parent.PayTester.GetController<StoresController>(UserId, StoreId, true);
var store = parent.PayTester.GetController<UIStoresController>(UserId, StoreId, true);
var generateRequest = new WalletSetupRequest
{
@@ -215,7 +215,7 @@ namespace BTCPayServer.Tests
private async Task RegisterAsync(bool isAdmin = false)
{
var account = parent.PayTester.GetController<AccountController>();
var account = parent.PayTester.GetController<UIAccountController>();
RegisterDetails = new RegisterViewModel()
{
Email = Guid.NewGuid() + "@toto.com",
@@ -271,7 +271,7 @@ namespace BTCPayServer.Tests
}
public async Task RegisterLightningNodeAsync(string cryptoCode, LightningConnectionType? connectionType, bool isMerchant = true, string storeId = null)
{
var storeController = GetController<StoresController>();
var storeController = GetController<UIStoresController>();
var connectionString = parent.GetLightningConnectionString(connectionType, isMerchant);
var nodeType = connectionString == LightningSupportedPaymentMethod.InternalNode ? LightningNodeType.Internal : LightningNodeType.Custom;
@@ -285,7 +285,7 @@ namespace BTCPayServer.Tests
public async Task RegisterInternalLightningNodeAsync(string cryptoCode, string storeId = null)
{
var storeController = GetController<StoresController>();
var storeController = GetController<UIStoresController>();
var vm = new LightningNodeViewModel { ConnectionString = "", LightningNodeType = LightningNodeType.Internal, SkipPortTest = true };
await storeController.SetupLightningNode(storeId ?? StoreId,
vm, "save", cryptoCode);

View File

@@ -42,7 +42,7 @@ namespace BTCPayServer.Tests
await tester.StartAsync();
var user = tester.NewAccount();
user.GrantAccess();
var controller = tester.PayTester.GetController<ServerController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIServerController>(user.UserId, user.StoreId);
var azureBlobStorageConfiguration = Assert.IsType<AzureBlobStorageConfiguration>(Assert
.IsType<ViewResult>(await controller.StorageProvider(StorageProvider.AzureBlobStorage.ToString()))
.Model);
@@ -362,7 +362,7 @@ namespace BTCPayServer.Tests
private static async Task<decimal> CreateInvoice(ServerTester tester, TestAccount user, string exchange,
string currency = "USD")
{
var storeController = user.GetController<StoresController>();
var storeController = user.GetController<UIStoresController>();
var vm = (RatesViewModel)((ViewResult)storeController.Rates()).Model;
vm.PreferredExchange = exchange;
await storeController.Rates(vm);

View File

@@ -140,7 +140,7 @@ namespace BTCPayServer.Tests
var acc = tester.NewAccount();
var sresp = Assert
.IsType<JsonResult>(await tester.PayTester.GetController<HomeController>(acc.UserId, acc.StoreId)
.IsType<JsonResult>(await tester.PayTester.GetController<UIHomeController>(acc.UserId, acc.StoreId)
.Swagger()).Value.ToJson();
JObject swagger = JObject.Parse(sresp);
var schema = JSchema.Parse(File.ReadAllText(TestUtils.GetTestDataFullPath("OpenAPI-Specification-schema.json")));
@@ -173,13 +173,13 @@ namespace BTCPayServer.Tests
"BTCPay Server supports authenticating and authorizing users through an API Key that is generated by them. Send the API Key as a header value to Authorization with the format: `token {token}`. For a smoother experience, you can generate a url that redirects users to an API key creation screen.\n\n The following permissions are available to the context of the user creating the API Key:\n\n#OTHERPERMISSIONS#\n\nThe following permissions are available if the user is an administrator:\n\n#SERVERPERMISSIONS#\n\nThe following permissions applies to all stores of the user, you can limit to a specific store with the following format: `btcpay.store.cancreateinvoice:6HSHAEU4iYWtjxtyRs9KyPjM9GAQp8kw2T9VWbGG1FnZ`:\n\n#STOREPERMISSIONS#\n\nNote that API Keys only limits permission of a user and can never expand it. If an API Key has the permission `btcpay.server.canmodifyserversettings` but that the user account creating this API Key is not administrator, the API Key will not be able to modify the server settings.\nSome permissions may include other permissions, see [this operation](#operation/permissionsMetadata).\n";
var storePolicies =
ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
Policies.IsStorePolicy(pair.Key) && !pair.Key.EndsWith(":", StringComparison.InvariantCulture));
var serverPolicies =
ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
Policies.IsServerPolicy(pair.Key));
var otherPolicies =
ManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
UIManageController.AddApiKeyViewModel.PermissionValueItem.PermissionDescriptions.Where(pair =>
!Policies.IsStorePolicy(pair.Key) && !Policies.IsServerPolicy(pair.Key));
description = description.Replace("#OTHERPERMISSIONS#",
@@ -191,7 +191,7 @@ namespace BTCPayServer.Tests
TestLogs.LogInformation(description);
var sresp = Assert
.IsType<JsonResult>(await tester.PayTester.GetController<HomeController>(acc.UserId, acc.StoreId)
.IsType<JsonResult>(await tester.PayTester.GetController<UIHomeController>(acc.UserId, acc.StoreId)
.Swagger()).Value.ToJson();
JObject json = JObject.Parse(sresp);
@@ -279,7 +279,7 @@ namespace BTCPayServer.Tests
user.RegisterDerivationScheme("BTC");
// Set tolerance to 50%
var stores = user.GetController<StoresController>();
var stores = user.GetController<UIStoresController>();
var response = stores.PaymentMethods();
var vm = Assert.IsType<PaymentMethodsViewModel>(Assert.IsType<ViewResult>(response).Model);
Assert.Equal(0.0, vm.PaymentTolerance);
@@ -425,7 +425,7 @@ namespace BTCPayServer.Tests
await tester.EnsureChannelsSetup();
var user = tester.NewAccount();
user.GrantAccess(true);
var storeController = user.GetController<StoresController>();
var storeController = user.GetController<UIStoresController>();
var storeResponse = storeController.PaymentMethods();
Assert.IsType<ViewResult>(storeResponse);
Assert.IsType<ViewResult>(await storeController.SetupLightningNode(user.StoreId, "BTC"));
@@ -538,7 +538,7 @@ namespace BTCPayServer.Tests
acc.Register();
acc.CreateStore();
var controller = acc.GetController<StoresController>();
var controller = acc.GetController<UIStoresController>();
var token = (RedirectToActionResult)await controller.CreateToken2(
new Models.StoreViewModels.CreateTokenViewModel()
{
@@ -635,14 +635,14 @@ namespace BTCPayServer.Tests
var acc = tester.NewAccount();
acc.Register();
acc.CreateStore();
var store = acc.GetController<StoresController>();
var store = acc.GetController<UIStoresController>();
var pairingCode = acc.BitPay.RequestClientAuthorization("test", Facade.Merchant);
Assert.IsType<RedirectToActionResult>(store.Pair(pairingCode.ToString(), acc.StoreId).GetAwaiter()
.GetResult());
pairingCode = acc.BitPay.RequestClientAuthorization("test1", Facade.Merchant);
acc.CreateStore();
var store2 = acc.GetController<StoresController>();
var store2 = acc.GetController<UIStoresController>();
await store2.Pair(pairingCode.ToString(), store2.CurrentStore.Id);
Assert.Contains(nameof(PairingResult.ReusedKey),
(string)store2.TempData[WellKnownTempData.ErrorMessage], StringComparison.CurrentCultureIgnoreCase);
@@ -703,11 +703,11 @@ namespace BTCPayServer.Tests
acc.RegisterDerivationScheme("BTC", ScriptPubKeyType.Segwit);
var btcDerivationScheme = acc.DerivationScheme;
var walletController = acc.GetController<WalletsController>();
var walletController = acc.GetController<UIWalletsController>();
var walletId = new WalletId(acc.StoreId, "BTC");
acc.IsAdmin = true;
walletController = acc.GetController<WalletsController>();
walletController = acc.GetController<UIWalletsController>();
var rescan =
Assert.IsType<RescanWalletModel>(Assert
@@ -857,7 +857,7 @@ namespace BTCPayServer.Tests
acc.RegisterDerivationScheme("BTC");
const string newVersion = "1.0.4.4";
var ctrl = acc.GetController<NotificationsController>();
var ctrl = acc.GetController<UINotificationsController>();
var resp = await ctrl.Generate(newVersion);
var vm = Assert.IsType<Models.NotificationViewModels.IndexViewModel>(
@@ -903,11 +903,11 @@ namespace BTCPayServer.Tests
// We don't have any default currencies, so this should be failing
Assert.Null(GetRatesResult?.Data);
var store = acc.GetController<StoresController>();
var store = acc.GetController<UIStoresController>();
var ratesVM = (RatesViewModel)(Assert.IsType<ViewResult>(store.Rates()).Model);
ratesVM.DefaultCurrencyPairs = "BTC_USD,LTC_USD";
await store.Rates(ratesVM);
store = acc.GetController<StoresController>();
store = acc.GetController<UIStoresController>();
rateController = acc.GetController<BitpayRateController>();
GetRatesResult = JObject.Parse(((JsonResult)rateController.GetRates(null, default)
.GetAwaiter().GetResult()).Value.ToJson()).ToObject<DataWrapper<Rate[]>>();
@@ -940,7 +940,7 @@ namespace BTCPayServer.Tests
private void AssertSearchInvoice(TestAccount acc, bool expected, string invoiceId, string filter, string storeId = null)
{
var result =
(InvoicesModel)((ViewResult)acc.GetController<InvoiceController>()
(InvoicesModel)((ViewResult)acc.GetController<UIInvoiceController>()
.ListInvoices(new InvoicesModel { SearchTerm = filter, StoreId = storeId }).Result).Model;
Assert.Equal(expected, result.Invoices.Any(i => i.InvoiceId == invoiceId));
}
@@ -1124,7 +1124,7 @@ namespace BTCPayServer.Tests
var payments = Assert.IsType<InvoiceDetailsModel>(
Assert.IsType<ViewResult>(await user.GetController<InvoiceController>().Invoice(invoice.Id)).Model)
Assert.IsType<ViewResult>(await user.GetController<UIInvoiceController>().Invoice(invoice.Id)).Model)
.Payments;
Assert.Single(payments);
var paymentData = payments.First().GetCryptoPaymentData() as BitcoinLikePaymentData;
@@ -1181,7 +1181,7 @@ namespace BTCPayServer.Tests
Assert.True(user.BitPay.TestAccess(Facade.Merchant));
// Test request pairing code client side
var storeController = user.GetController<StoresController>();
var storeController = user.GetController<UIStoresController>();
storeController
.CreateToken(user.StoreId, new CreateTokenViewModel() { Label = "test2", StoreId = user.StoreId })
.GetAwaiter().GetResult();
@@ -1201,14 +1201,14 @@ namespace BTCPayServer.Tests
// Can generate API Key
var repo = tester.PayTester.GetService<TokenRepository>();
Assert.Empty(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>()
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>()
.GenerateAPIKey(user.StoreId).GetAwaiter().GetResult());
var apiKey = Assert.Single(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
///////
// Generating a new one remove the previous
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>()
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>()
.GenerateAPIKey(user.StoreId).GetAwaiter().GetResult());
var apiKey2 = Assert.Single(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult());
Assert.NotEqual(apiKey, apiKey2);
@@ -1320,7 +1320,7 @@ namespace BTCPayServer.Tests
}, Facade.Merchant);
Assert.Equal(Money.Coins(1.0m), invoice1.BtcPrice);
var storeController = user.GetController<StoresController>();
var storeController = user.GetController<UIStoresController>();
var vm = (RatesViewModel)((ViewResult)storeController.Rates()).Model;
Assert.Equal(0.0, vm.Spread);
vm.Spread = 40;
@@ -1439,7 +1439,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
var store = user.GetController<StoresController>();
var store = user.GetController<UIStoresController>();
var rateVm = Assert.IsType<RatesViewModel>(Assert.IsType<ViewResult>(store.Rates()).Model);
Assert.False(rateVm.ShowScripting);
Assert.Equal(CoinGeckoRateProvider.CoinGeckoName, rateVm.PreferredExchange);
@@ -1453,7 +1453,7 @@ namespace BTCPayServer.Tests
rateVm.ScriptTest = "BTC_JPY,BTC_CAD";
rateVm.Spread = 10;
store = user.GetController<StoresController>();
store = user.GetController<UIStoresController>();
rateVm = Assert.IsType<RatesViewModel>(Assert.IsType<ViewResult>(await store.Rates(rateVm, "Test"))
.Model);
Assert.NotNull(rateVm.TestRateRules);
@@ -1466,7 +1466,7 @@ namespace BTCPayServer.Tests
Assert.IsType<RedirectToActionResult>(store.ShowRateRulesPost(true).Result);
Assert.IsType<RedirectToActionResult>(await store.Rates(rateVm, "Save"));
store = user.GetController<StoresController>();
store = user.GetController<UIStoresController>();
rateVm = Assert.IsType<RatesViewModel>(Assert.IsType<ViewResult>(store.Rates()).Model);
Assert.Equal(rateVm.StoreId, user.StoreId);
Assert.Equal(rateVm.DefaultScript, rateVm.Script);
@@ -1487,7 +1487,7 @@ namespace BTCPayServer.Tests
.Model);
Assert.True(rateVm.TestRateRules.All(t => !t.Error));
Assert.IsType<RedirectToActionResult>(await store.Rates(rateVm, "Save"));
store = user.GetController<StoresController>();
store = user.GetController<UIStoresController>();
rateVm = Assert.IsType<RatesViewModel>(Assert.IsType<ViewResult>(store.Rates()).Model);
Assert.Equal(50, rateVm.Spread);
Assert.True(rateVm.ShowScripting);
@@ -1522,7 +1522,7 @@ namespace BTCPayServer.Tests
Assert.Equal("EUR", invoice2.Currency);
// via UI
var controller = user.GetController<InvoiceController>();
var controller = user.GetController<UIInvoiceController>();
var model = await controller.CreateInvoice();
(await controller.CreateInvoice(new CreateInvoiceModel(), default)).AssertType<RedirectToActionResult>();
invoice = await client.GetInvoice(user.StoreId, controller.CreatedInvoiceId);
@@ -1530,7 +1530,7 @@ namespace BTCPayServer.Tests
Assert.Equal(InvoiceType.TopUp, invoice.Type);
// Check that the SendWallet use the default currency
var walletController = user.GetController<WalletsController>();
var walletController = user.GetController<UIWalletsController>();
var walletSend = await walletController.WalletSend(new WalletId(user.StoreId, "BTC")).AssertViewModelAsync<WalletSendModel>();
Assert.Equal("EUR", walletSend.Fiat);
}
@@ -1555,13 +1555,13 @@ namespace BTCPayServer.Tests
// We allow BTC and LN, but not BTC under 5 USD, so only LN should be in the invoice
var vm = Assert.IsType<CheckoutAppearanceViewModel>(Assert
.IsType<ViewResult>(user.GetController<StoresController>().CheckoutAppearance()).Model);
.IsType<ViewResult>(user.GetController<UIStoresController>().CheckoutAppearance()).Model);
Assert.Equal(2, vm.PaymentMethodCriteria.Count);
var criteria = Assert.Single(vm.PaymentMethodCriteria.Where(m => m.PaymentMethod == btcMethod.ToString()));
Assert.Equal(new PaymentMethodId("BTC", BitcoinPaymentType.Instance).ToString(), criteria.PaymentMethod);
criteria.Value = "5 USD";
criteria.Type = PaymentMethodCriteriaViewModel.CriteriaType.GreaterThan;
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().CheckoutAppearance(vm)
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().CheckoutAppearance(vm)
.Result);
var invoice = user.BitPay.CreateInvoice(
@@ -1582,7 +1582,7 @@ namespace BTCPayServer.Tests
// We allow BTC for more than 5 USD, and LN for less than 150. The default is LN, so the default
// payment method should be LN.
vm = Assert.IsType<CheckoutAppearanceViewModel>(Assert
.IsType<ViewResult>(user.GetController<StoresController>().CheckoutAppearance()).Model);
.IsType<ViewResult>(user.GetController<UIStoresController>().CheckoutAppearance()).Model);
vm.DefaultPaymentMethod = lnMethod;
criteria = vm.PaymentMethodCriteria.First();
criteria.Value = "150 USD";
@@ -1590,7 +1590,7 @@ namespace BTCPayServer.Tests
criteria = vm.PaymentMethodCriteria.Skip(1).First();
criteria.Value = "5 USD";
criteria.Type = PaymentMethodCriteriaViewModel.CriteriaType.GreaterThan;
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().CheckoutAppearance(vm)
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().CheckoutAppearance(vm)
.Result);
invoice = user.BitPay.CreateInvoice(
new Invoice()
@@ -1602,14 +1602,14 @@ namespace BTCPayServer.Tests
ItemDesc = "Some description",
FullNotifications = true
}, Facade.Merchant);
var checkout = (await user.GetController<InvoiceController>().Checkout(invoice.Id)).AssertViewModel<PaymentModel>();
var checkout = (await user.GetController<UIInvoiceController>().Checkout(invoice.Id)).AssertViewModel<PaymentModel>();
Assert.Equal(lnMethod, checkout.PaymentMethodId);
// If we change store's default, it should change the checkout's default
vm.DefaultPaymentMethod = btcMethod;
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().CheckoutAppearance(vm)
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().CheckoutAppearance(vm)
.Result);
checkout = (await user.GetController<InvoiceController>().Checkout(invoice.Id)).AssertViewModel<PaymentModel>();
checkout = (await user.GetController<UIInvoiceController>().Checkout(invoice.Id)).AssertViewModel<PaymentModel>();
Assert.Equal(btcMethod, checkout.PaymentMethodId);
}
}
@@ -1641,7 +1641,7 @@ namespace BTCPayServer.Tests
}, Facade.Merchant);
// validate that invoice data model doesn't have lightning string initially
var res = await user.GetController<InvoiceController>().Checkout(invoice.Id);
var res = await user.GetController<UIInvoiceController>().Checkout(invoice.Id);
var paymentMethodFirst = Assert.IsType<PaymentModel>(
Assert.IsType<ViewResult>(res).Model
);
@@ -1649,15 +1649,15 @@ namespace BTCPayServer.Tests
// enable unified QR code in settings
var vm = Assert.IsType<LightningSettingsViewModel>(Assert
.IsType<ViewResult>(await user.GetController<StoresController>().LightningSettings(user.StoreId, cryptoCode)).Model
.IsType<ViewResult>(await user.GetController<UIStoresController>().LightningSettings(user.StoreId, cryptoCode)).Model
);
vm.OnChainWithLnInvoiceFallback = true;
Assert.IsType<RedirectToActionResult>(
user.GetController<StoresController>().LightningSettings(vm).Result
user.GetController<UIStoresController>().LightningSettings(vm).Result
);
// validate that QR code now has both onchain and offchain payment urls
res = await user.GetController<InvoiceController>().Checkout(invoice.Id);
res = await user.GetController<UIInvoiceController>().Checkout(invoice.Id);
var paymentMethodSecond = Assert.IsType<PaymentModel>(
Assert.IsType<ViewResult>(res).Model
);
@@ -1689,12 +1689,12 @@ namespace BTCPayServer.Tests
var cryptoCode = "BTC";
user.GrantAccess(true);
user.RegisterLightningNode(cryptoCode, LightningConnectionType.Charge);
var vm = user.GetController<StoresController>().CheckoutAppearance().AssertViewModel<CheckoutAppearanceViewModel>();
var vm = user.GetController<UIStoresController>().CheckoutAppearance().AssertViewModel<CheckoutAppearanceViewModel>();
var criteria = Assert.Single(vm.PaymentMethodCriteria);
Assert.Equal(new PaymentMethodId(cryptoCode, LightningPaymentType.Instance).ToString(), criteria.PaymentMethod);
criteria.Value = "2 USD";
criteria.Type = PaymentMethodCriteriaViewModel.CriteriaType.LessThan;
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().CheckoutAppearance(vm)
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().CheckoutAppearance(vm)
.Result);
var invoice = user.BitPay.CreateInvoice(
@@ -1709,14 +1709,14 @@ namespace BTCPayServer.Tests
// Activating LNUrl, we should still have only 1 payment criteria that can be set.
user.RegisterLightningNode(cryptoCode, LightningConnectionType.Charge);
var lnSettingsVm = await user.GetController<StoresController>().LightningSettings(user.StoreId, cryptoCode).AssertViewModelAsync<LightningSettingsViewModel>();
var lnSettingsVm = await user.GetController<UIStoresController>().LightningSettings(user.StoreId, cryptoCode).AssertViewModelAsync<LightningSettingsViewModel>();
lnSettingsVm.LNURLEnabled = true;
lnSettingsVm.LNURLStandardInvoiceEnabled = true;
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().LightningSettings(lnSettingsVm).Result);
vm = user.GetController<StoresController>().CheckoutAppearance().AssertViewModel<CheckoutAppearanceViewModel>();
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().LightningSettings(lnSettingsVm).Result);
vm = user.GetController<UIStoresController>().CheckoutAppearance().AssertViewModel<CheckoutAppearanceViewModel>();
criteria = Assert.Single(vm.PaymentMethodCriteria);
Assert.Equal(new PaymentMethodId(cryptoCode, LightningPaymentType.Instance).ToString(), criteria.PaymentMethod);
Assert.IsType<RedirectToActionResult>(user.GetController<StoresController>().CheckoutAppearance(vm).Result);
Assert.IsType<RedirectToActionResult>(user.GetController<UIStoresController>().CheckoutAppearance(vm).Result);
// However, creating an invoice should show LNURL
invoice = user.BitPay.CreateInvoice(
@@ -1748,7 +1748,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
var controller = tester.PayTester.GetController<InvoiceController>(null);
var controller = tester.PayTester.GetController<UIInvoiceController>(null);
var testCases =
new List<(string input, Dictionary<string, object> expectedOutput)>()
@@ -1818,7 +1818,7 @@ namespace BTCPayServer.Tests
var networkFee = new FeeRate(invoice.MinerFees["BTC"].SatoshiPerBytes).GetFee(100);
// ensure 0 invoices exported because there are no payments yet
var jsonResult = user.GetController<InvoiceController>().Export("json").GetAwaiter().GetResult();
var jsonResult = user.GetController<UIInvoiceController>().Export("json").GetAwaiter().GetResult();
var result = Assert.IsType<ContentResult>(jsonResult);
Assert.Equal("application/json", result.ContentType);
Assert.Equal("[]", result.Content);
@@ -1842,7 +1842,7 @@ namespace BTCPayServer.Tests
TestUtils.Eventually(() =>
{
var jsonResultPaid =
user.GetController<InvoiceController>().Export("json").GetAwaiter().GetResult();
user.GetController<UIInvoiceController>().Export("json").GetAwaiter().GetResult();
var paidresult = Assert.IsType<ContentResult>(jsonResultPaid);
Assert.Equal("application/json", paidresult.ContentType);
@@ -1986,7 +1986,7 @@ namespace BTCPayServer.Tests
TestUtils.Eventually(() =>
{
var exportResultPaid =
user.GetController<InvoiceController>().Export("csv").GetAwaiter().GetResult();
user.GetController<UIInvoiceController>().Export("csv").GetAwaiter().GetResult();
var paidresult = Assert.IsType<ContentResult>(exportResultPaid);
Assert.Equal("application/csv", paidresult.ContentType);
Assert.Contains($",orderId,{invoice.Id},", paidresult.Content);
@@ -2009,8 +2009,8 @@ namespace BTCPayServer.Tests
await user.GrantAccessAsync();
var user2 = tester.NewAccount();
await user2.GrantAccessAsync();
var apps = user.GetController<AppsController>();
var apps2 = user2.GetController<AppsController>();
var apps = user.GetController<UIAppsController>();
var apps2 = user2.GetController<UIAppsController>();
var vm = Assert.IsType<CreateAppViewModel>(Assert.IsType<ViewResult>(apps.CreateApp(user.StoreId)).Model);
Assert.NotNull(vm.SelectedAppType);
Assert.Null(vm.AppName);
@@ -2348,7 +2348,7 @@ namespace BTCPayServer.Tests
user.GrantAccess();
user.RegisterDerivationScheme("BTC");
var serverController = user.GetController<ServerController>();
var serverController = user.GetController<UIServerController>();
var vm = Assert.IsType<LogsViewModel>(
Assert.IsType<ViewResult>(await serverController.LogsView()).Model);
}
@@ -2364,17 +2364,17 @@ namespace BTCPayServer.Tests
var user = tester.NewAccount();
user.GrantAccess();
var accountController = tester.PayTester.GetController<AccountController>();
var accountController = tester.PayTester.GetController<UIAccountController>();
//no 2fa or fido2 enabled, login should work
Assert.Equal(nameof(HomeController.Index),
Assert.Equal(nameof(UIHomeController.Index),
Assert.IsType<RedirectToActionResult>(await accountController.Login(new LoginViewModel()
{
Email = user.RegisterDetails.Email,
Password = user.RegisterDetails.Password
})).ActionName);
var listController = user.GetController<ManageController>();
var listController = user.GetController<UIManageController>();
var manageController = user.GetController<Fido2Controller>();
//by default no fido2 devices available
@@ -2500,7 +2500,7 @@ namespace BTCPayServer.Tests
Assert.Equal(MockVersionFetcher.MOCK_NEW_VERSION, lastVersion.LastVersion);
// we should also have notification in UI
var ctrl = acc.GetController<NotificationsController>();
var ctrl = acc.GetController<UINotificationsController>();
var newVersion = MockVersionFetcher.MOCK_NEW_VERSION;
var vm = Assert.IsType<Models.NotificationViewModels.IndexViewModel>(
@@ -2715,7 +2715,7 @@ namespace BTCPayServer.Tests
Assert.Equal("admin@admin.com", (await Assert.IsType<ServerEmailSender>(await emailSenderFactory.GetEmailSender()).GetEmailSettings()).Login);
Assert.Null(await Assert.IsType<StoreEmailSender>(await emailSenderFactory.GetEmailSender(acc.StoreId)).GetEmailSettings());
Assert.IsType<RedirectToActionResult>(await acc.GetController<StoresController>().Emails(acc.StoreId, new EmailsViewModel(new EmailSettings()
Assert.IsType<RedirectToActionResult>(await acc.GetController<UIStoresController>().Emails(acc.StoreId, new EmailsViewModel(new EmailSettings()
{
From = "store@store.com",
Login = "store@store.com",
@@ -2738,7 +2738,7 @@ namespace BTCPayServer.Tests
await tester.StartAsync();
var user = tester.NewAccount();
user.GrantAccess();
var controller = tester.PayTester.GetController<ServerController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIServerController>(user.UserId, user.StoreId);
//Once we select a provider, redirect to its view
@@ -2747,7 +2747,7 @@ namespace BTCPayServer.Tests
{
Provider = StorageProvider.FileSystem
}));
Assert.Equal(nameof(ServerController.StorageProvider), localResult.ActionName);
Assert.Equal(nameof(UIServerController.StorageProvider), localResult.ActionName);
Assert.Equal(StorageProvider.FileSystem.ToString(), localResult.RouteValues["provider"]);
@@ -2756,7 +2756,7 @@ namespace BTCPayServer.Tests
{
Provider = StorageProvider.AmazonS3
}));
Assert.Equal(nameof(ServerController.StorageProvider), AmazonS3result.ActionName);
Assert.Equal(nameof(UIServerController.StorageProvider), AmazonS3result.ActionName);
Assert.Equal(StorageProvider.AmazonS3.ToString(), AmazonS3result.RouteValues["provider"]);
var GoogleResult = Assert
@@ -2764,7 +2764,7 @@ namespace BTCPayServer.Tests
{
Provider = StorageProvider.GoogleCloudStorage
}));
Assert.Equal(nameof(ServerController.StorageProvider), GoogleResult.ActionName);
Assert.Equal(nameof(UIServerController.StorageProvider), GoogleResult.ActionName);
Assert.Equal(StorageProvider.GoogleCloudStorage.ToString(), GoogleResult.RouteValues["provider"]);
@@ -2773,7 +2773,7 @@ namespace BTCPayServer.Tests
{
Provider = StorageProvider.AzureBlobStorage
}));
Assert.Equal(nameof(ServerController.StorageProvider), AzureResult.ActionName);
Assert.Equal(nameof(UIServerController.StorageProvider), AzureResult.ActionName);
Assert.Equal(StorageProvider.AzureBlobStorage.ToString(), AzureResult.RouteValues["provider"]);
//Cool, we get redirected to the config pages
@@ -2821,7 +2821,7 @@ namespace BTCPayServer.Tests
await tester.StartAsync();
var user = tester.NewAccount();
user.GrantAccess();
var controller = tester.PayTester.GetController<ServerController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIServerController>(user.UserId, user.StoreId);
var fileSystemStorageConfiguration = Assert.IsType<FileSystemStorageConfiguration>(Assert
.IsType<ViewResult>(await controller.StorageProvider(StorageProvider.FileSystem.ToString()))
@@ -2840,7 +2840,7 @@ namespace BTCPayServer.Tests
}
}
internal static async Task CanUploadRemoveFiles(ServerController controller)
internal static async Task CanUploadRemoveFiles(UIServerController controller)
{
var fileContent = "content";
List<IFormFile> fileList = new List<IFormFile>();
@@ -2868,11 +2868,11 @@ namespace BTCPayServer.Tests
//create a temporary link to file
var tmpLinkGenerate = Assert.IsType<RedirectToActionResult>(await controller.CreateTemporaryFileUrl(fileId,
new ServerController.CreateTemporaryFileUrlViewModel()
new UIServerController.CreateTemporaryFileUrlViewModel()
{
IsDownload = true,
TimeAmount = 1,
TimeType = ServerController.CreateTemporaryFileUrlViewModel.TmpFileTimeType.Minutes
TimeType = UIServerController.CreateTemporaryFileUrlViewModel.TmpFileTimeType.Minutes
}));
var statusMessageModel = controller.TempData.GetStatusMessageModel();
Assert.NotNull(statusMessageModel);

View File

@@ -20,13 +20,13 @@
<None Remove="Build\**" />
<None Remove="wwwroot\bundles\jqueryvalidate\**" />
<None Remove="wwwroot\vendor\jquery-nice-select\**" />
<Content Update="Views\StorePullPayments\NewPullPayment.cshtml">
<Content Update="Views\UIStorePullPayments\NewPullPayment.cshtml">
<Pack>false</Pack>
</Content>
<Content Update="Views\StorePullPayments\PullPayments.cshtml">
<Content Update="Views\UIStorePullPayments\PullPayments.cshtml">
<Pack>false</Pack>
</Content>
<Content Update="Views\Account\_ViewImports.cshtml">
<Content Update="Views\UIAccount\_ViewImports.cshtml">
<Pack>false</Pack>
</Content>
</ItemGroup>
@@ -39,7 +39,7 @@
<ItemGroup Condition="'$(Altcoins)' != 'true'">
<Content Remove="Services\Altcoins\**\*" />
<Content Remove="Views\MoneroLikeStore\**\*" />
<Content Remove="Views\UIMoneroLikeStore\**\*" />
<Content Remove="Views\Shared\Monero\**\*" />
</ItemGroup>
@@ -148,83 +148,83 @@
<ItemGroup>
<Watch Include="Views\**\*.*"></Watch>
<Content Update="Views\Apps\_ViewImports.cshtml">
<Content Update="Views\UIApps\_ViewImports.cshtml">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\DynamicDnsServices.cshtml">
<Content Update="Views\UIServer\DynamicDnsServices.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\LightningChargeServices.cshtml">
<Content Update="Views\UIServer\LightningChargeServices.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\LightningWalletServices.cshtml">
<Content Update="Views\UIServer\LightningWalletServices.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\LndSeedBackup.cshtml">
<Content Update="Views\UIServer\LndSeedBackup.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\RPCService.cshtml">
<Content Update="Views\UIServer\RPCService.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\P2PService.cshtml">
<Content Update="Views\UIServer\P2PService.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\DynamicDnsService.cshtml">
<Content Update="Views\UIServer\DynamicDnsService.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\SSHService.cshtml">
<Content Update="Views\UIServer\SSHService.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Stores\ShowToken.cshtml">
<Content Update="Views\UIStores\ShowToken.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Stores\PayButtonEnable.cshtml">
<Content Update="Views\UIStores\PayButtonEnable.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Stores\PayButton.cshtml">
<Content Update="Views\UIStores\PayButton.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Public\PayButtonHandle.cshtml">
<Content Update="Views\UIPublic\PayButtonHandle.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\LndServices.cshtml">
<Content Update="Views\UIServer\LndServices.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\Maintenance.cshtml">
<Content Update="Views\UIServer\Maintenance.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Server\Services.cshtml">
<Content Update="Views\UIServer\Services.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\ListWallets.cshtml">
<Content Update="Views\UIWallets\ListWallets.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletPSBTCombine.cshtml">
<Content Update="Views\UIWallets\WalletPSBTCombine.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletPSBTReady.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletPSBT.cshtml">
<Content Update="Views\UIWallets\WalletPSBT.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletRescan.cshtml">
<Content Update="Views\UIWallets\WalletRescan.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletSendVault.cshtml">
<Content Update="Views\UIWallets\WalletSendVault.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\WalletTransactions.cshtml">
<Content Update="Views\UIWallets\WalletTransactions.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\_Nav.cshtml">
<Content Update="Views\UIWallets\_Nav.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\_ViewImports.cshtml">
<Content Update="Views\UIWallets\_ViewImports.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Update="Views\Wallets\_ViewStart.cshtml">
<Content Update="Views\UIWallets\_ViewStart.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
</ItemGroup>

View File

@@ -29,13 +29,13 @@
<div class="accordion-body">
<ul class="navbar-nav">
<li class="nav-item">
<a asp-area="" asp-controller="Stores" asp-action="Dashboard" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Dashboard)" id="StoreNav-Dashboard">
<a asp-area="" asp-controller="UIStores" asp-action="Dashboard" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Dashboard)" id="StoreNav-Dashboard">
<vc:icon symbol="home"/>
<span>Dashboard</span>
</a>
</li>
<li class="nav-item">
<a asp-area="" asp-controller="Stores" asp-action="PaymentMethods" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.PaymentMethods) @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.GeneralSettings) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Integrations) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
<a asp-area="" asp-controller="UIStores" asp-action="PaymentMethods" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.PaymentMethods) @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.GeneralSettings) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Integrations) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
<vc:icon symbol="settings"/>
<span>Settings</span>
</a>
@@ -58,14 +58,14 @@
<li class="nav-item">
@if (isSetUp && scheme.WalletSupported)
{
<a asp-area="" asp-controller="Wallets" asp-action="WalletTransactions" asp-route-walletId="@scheme.WalletId" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(WalletsNavPages), scheme.WalletId.ToString()) @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Wallet{scheme.Crypto}")">
<a asp-area="" asp-controller="UIWallets" asp-action="WalletTransactions" asp-route-walletId="@scheme.WalletId" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(WalletsNavPages), scheme.WalletId.ToString()) @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Wallet{scheme.Crypto}")">
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "disabled")"></span>
<span>@(Model.AltcoinsBuild ? $"{scheme.Crypto} " : "")Wallet</span>
</a>
}
else
{
<a asp-area="" asp-controller="Stores" asp-action="SetupWallet" asp-route-cryptoCode="@scheme.Crypto" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Modify{scheme.Crypto}")">
<a asp-area="" asp-controller="UIStores" asp-action="SetupWallet" asp-route-cryptoCode="@scheme.Crypto" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.OnchainSettings)" id="@($"StoreNav-Modify{scheme.Crypto}")">
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "disabled")"></span>
<span>@(Model.AltcoinsBuild ? $"{scheme.Crypto} " : "")Wallet</span>
</a>
@@ -78,14 +78,14 @@
<li class="nav-item">
@if (isSetUp)
{
<a asp-area="" asp-controller="Stores" asp-action="LightningSettings" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
<a asp-area="" asp-controller="UIStores" asp-action="LightningSettings" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
<span class="me-2 btcpay-status btcpay-status--@(scheme.Enabled ? "enabled" : "disabled")"></span>
<span>@(Model.AltcoinsBuild ? $"{scheme.CryptoCode} " : "")Lightning</span>
</a>
}
else
{
<a asp-area="" asp-controller="Stores" asp-action="SetupLightningNode" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
<a asp-area="" asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.LightningSettings)" id="@($"StoreNav-Lightning{scheme.CryptoCode}")">
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
<span>@(Model.AltcoinsBuild ? $"{scheme.CryptoCode} " : "")Lightning</span>
</a>
@@ -107,31 +107,31 @@
<div class="accordion-body">
<ul class="navbar-nav">
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
<a asp-area="" asp-controller="Invoice" asp-action="ListInvoices" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(InvoiceNavPages))" id="StoreNav-Invoices">
<a asp-area="" asp-controller="UIInvoice" asp-action="ListInvoices" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(InvoiceNavPages))" id="StoreNav-Invoices">
<vc:icon symbol="invoice"/>
<span>Invoices</span>
</a>
</li>
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
<a asp-area="" asp-controller="PaymentRequest" asp-action="GetPaymentRequests" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(PaymentRequestsNavPages))" id="StoreNav-PaymentRequests">
<a asp-area="" asp-controller="UIPaymentRequest" asp-action="GetPaymentRequests" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(PaymentRequestsNavPages))" id="StoreNav-PaymentRequests">
<vc:icon symbol="payment-1"/>
<span>Requests</span>
</a>
</li>
<li class="nav-item">
<a asp-area="" asp-controller="StorePullPayments" asp-action="PullPayments" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.PullPayments)" id="StoreNav-PullPayments">
<a asp-area="" asp-controller="UIStorePullPayments" asp-action="PullPayments" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.PullPayments)" id="StoreNav-PullPayments">
<vc:icon symbol="payment-2"/>
<span>Pull Payments</span>
</a>
</li>
<li class="nav-item">
<a asp-area="" asp-controller="StorePullPayments" asp-action="Payouts" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.Payouts)" id="StoreNav-Payouts">
<a asp-area="" asp-controller="UIStorePullPayments" asp-action="Payouts" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.Payouts)" id="StoreNav-Payouts">
<vc:icon symbol="payment-2"/>
<span>Payouts</span>
</a>
</li>
<li class="nav-item" permission="@Policies.CanModifyStoreSettings">
<a asp-area="" asp-controller="Stores" asp-action="PayButton" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.PayButton)" id="StoreNav-PayButton">
<a asp-area="" asp-controller="UIStores" asp-action="PayButton" asp-route-storeId="@Model.Store.Id" class="nav-link @ViewData.IsActivePage(StoreNavPages.PayButton)" id="StoreNav-PayButton">
<vc:icon symbol="payment-2"/>
<span>Pay Button</span>
</a>
@@ -154,14 +154,14 @@
@foreach (var app in Model.Apps)
{
<li class="nav-item">
<a asp-area="" asp-controller="Apps" asp-action="@app.Action" asp-route-appId="@app.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(AppsNavPages.Update, app.Id)" id="@($"StoreNav-App-{app.Id}")">
<a asp-area="" asp-controller="UIApps" asp-action="@app.Action" asp-route-appId="@app.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(AppsNavPages.Update, app.Id)" id="@($"StoreNav-App-{app.Id}")">
<vc:icon symbol="@app.AppType.ToLower()"/>
<span>@app.AppName</span>
</a>
</li>
}
<li class="nav-item">
<a asp-area="" asp-controller="Apps" asp-action="CreateApp" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(AppsNavPages.Create)" id="StoreNav-CreateApp">
<a asp-area="" asp-controller="UIApps" asp-action="CreateApp" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(AppsNavPages.Create)" id="StoreNav-CreateApp">
<vc:icon symbol="new"/>
<span>New App</span>
</a>
@@ -183,7 +183,7 @@
<vc:ui-extension-point location="header-nav" model="@Model"/>
<vc:ui-extension-point location="store-integrations-nav" model="@Model" />
<li class="nav-item" permission="@Policies.CanModifyServerSettings">
<a asp-area="" asp-controller="Server" asp-action="ListPlugins" class="nav-link js-scroll-trigger @ViewData.IsActivePage(ServerNavPages.Plugins)" id="Nav-AddPlugin">
<a asp-area="" asp-controller="UIServer" asp-action="ListPlugins" class="nav-link js-scroll-trigger @ViewData.IsActivePage(ServerNavPages.Plugins)" id="Nav-AddPlugin">
<vc:icon symbol="new"/>
<span>Add Plugin</span>
</a>
@@ -213,11 +213,11 @@
@if (!(await SettingsRepository.GetPolicies()).LockSubscription)
{
<li class="nav-item">
<a asp-area="" asp-controller="Account" asp-action="Register" class="nav-link js-scroll-trigger" id="Nav-Register">Register</a>
<a asp-area="" asp-controller="UIAccount" asp-action="Register" class="nav-link js-scroll-trigger" id="Nav-Register">Register</a>
</li>
}
<li class="nav-item">
<a asp-area="" asp-controller="Account" asp-action="Login" class="nav-link js-scroll-trigger" id="Nav-Login">Log in</a>
<a asp-area="" asp-controller="UIAccount" asp-action="Login" class="nav-link js-scroll-trigger" id="Nav-Login">Log in</a>
</li>
</ul>
}
@@ -226,7 +226,7 @@
{
<ul id="mainNavSettings" class="navbar-nav border-top p-3 px-lg-4">
<li class="nav-item" permission="@Policies.CanModifyServerSettings">
<a asp-area="" asp-controller="Server" asp-action="ListUsers" class="nav-link js-scroll-trigger @ViewData.IsActivePage(ServerNavPages.Users) @ViewData.IsActivePage(ServerNavPages.Emails) @ViewData.IsActivePage(ServerNavPages.Policies) @ViewData.IsActivePage(ServerNavPages.Services) @ViewData.IsActivePage(ServerNavPages.Theme) @ViewData.IsActivePage(ServerNavPages.Maintenance) @ViewData.IsActivePage(ServerNavPages.Logs) @ViewData.IsActivePage(ServerNavPages.Files)" id="Nav-ServerSettings">
<a asp-area="" asp-controller="UIServer" asp-action="ListUsers" class="nav-link js-scroll-trigger @ViewData.IsActivePage(ServerNavPages.Users) @ViewData.IsActivePage(ServerNavPages.Emails) @ViewData.IsActivePage(ServerNavPages.Policies) @ViewData.IsActivePage(ServerNavPages.Services) @ViewData.IsActivePage(ServerNavPages.Theme) @ViewData.IsActivePage(ServerNavPages.Maintenance) @ViewData.IsActivePage(ServerNavPages.Logs) @ViewData.IsActivePage(ServerNavPages.Files)" id="Nav-ServerSettings">
<vc:icon symbol="server-settings"/>
<span>Server Settings</span>
</a>
@@ -251,13 +251,13 @@
</li>
}
<li class="border-top py-1 px-3">
<a asp-area="" asp-controller="Manage" asp-action="Index" class="nav-link @ViewData.IsActiveCategory(typeof(ManageNavPages))" id="Nav-ManageAccount">
<a asp-area="" asp-controller="UIManage" asp-action="Index" class="nav-link @ViewData.IsActiveCategory(typeof(ManageNavPages))" id="Nav-ManageAccount">
<vc:icon symbol="account"/>
<span class="text-truncate" style="max-width:195px">Manage Account</span>
</a>
</li>
<li class="border-top py-1 px-3">
<a asp-area="" asp-controller="Account" asp-action="Logout" class="nav-link text-danger" id="Nav-Logout">
<a asp-area="" asp-controller="UIAccount" asp-action="Logout" class="nav-link text-danger" id="Nav-Logout">
<i class="fa fa-sign-out"></i>
<span>Logout</span>
</a>

View File

@@ -22,7 +22,7 @@ namespace BTCPayServer.Components.MainNav
private const string RootName = "Global";
private readonly AppService _appService;
private readonly StoreRepository _storeRepo;
private readonly StoresController _storesController;
private readonly UIStoresController _storesController;
private readonly BTCPayNetworkProvider _networkProvider;
private readonly UserManager<ApplicationUser> _userManager;
private readonly PaymentMethodHandlerDictionary _paymentMethodHandlerDictionary;
@@ -30,7 +30,7 @@ namespace BTCPayServer.Components.MainNav
public MainNav(
AppService appService,
StoreRepository storeRepo,
StoresController storesController,
UIStoresController storesController,
BTCPayNetworkProvider networkProvider,
UserManager<ApplicationUser> userManager,
PaymentMethodHandlerDictionary paymentMethodHandlerDictionary)

View File

@@ -13,19 +13,19 @@
<div class="dropdown-menu text-center" id="NotificationsDropdown" aria-labelledby="NotificationsHandle">
<div class="d-flex align-items-center justify-content-between py-3 px-4 border-bottom border-light">
<h5 class="m-0">Notifications</h5>
<form id="notificationsForm" asp-controller="Notifications" asp-action="MarkAllAsSeen" asp-route-returnUrl="@Context.Request.GetCurrentPathWithQueryString()" method="post">
<form id="notificationsForm" asp-controller="UINotifications" asp-action="MarkAllAsSeen" asp-route-returnUrl="@Context.Request.GetCurrentPathWithQueryString()" method="post">
<button class="btn btn-link p-0" type="submit">Mark all as seen</button>
</form>
</div>
<partial name="Components/Notifications/List" model="Model"/>
<div class="p-3">
<a asp-controller="Notifications" asp-action="Index">View all</a>
<a asp-controller="UINotifications" asp-action="Index">View all</a>
</div>
</div>
}
else
{
<a asp-controller="Notifications" asp-action="Index" id="NotificationsHandle" class="mainMenuButton @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" title="Notifications">
<a asp-controller="UINotifications" asp-action="Index" id="NotificationsHandle" class="mainMenuButton @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" title="Notifications">
<vc:icon symbol="notifications" />
</a>
}

View File

@@ -5,7 +5,7 @@
<div id="NotificationsList">
@foreach (var n in Model.Last5)
{
<a asp-action="NotificationPassThrough" asp-controller="Notifications" asp-route-id="@n.Id" class="notification d-flex align-items-center dropdown-item border-bottom border-light py-3 px-4">
<a asp-action="NotificationPassThrough" asp-controller="UINotifications" asp-route-id="@n.Id" class="notification d-flex align-items-center dropdown-item border-bottom border-light py-3 px-4">
<div class="me-3">
<vc:icon symbol="note" />
</div>

View File

@@ -7,7 +7,7 @@
{
<div class="d-flex align-items-center justify-content-between mb-3">
<h4 class="mb-0">Recent Notifications</h4>
<a asp-controller="Notifications" asp-action="Index">View all</a>
<a asp-controller="UINotifications" asp-action="Index">View all</a>
</div>
<partial name="Components/Notifications/List" model="Model"/>
}

View File

@@ -12,21 +12,21 @@
<li>
@if (option.WalletId != null)
{
<a asp-controller="Wallets" asp-action="WalletTransactions" asp-route-walletId="@option.WalletId" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@option.Text</a>
<a asp-controller="UIWallets" asp-action="WalletTransactions" asp-route-walletId="@option.WalletId" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@option.Text</a>
}
else
{
<a asp-controller="Stores" asp-action="Dashboard" asp-route-storeId="@option.Value" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@option.Text</a>
<a asp-controller="UIStores" asp-action="Dashboard" asp-route-storeId="@option.Value" class="dropdown-item@(option.Selected ? " active" : "")" id="StoreSelectorMenuItem-@option.Value">@option.Text</a>
}
</li>
}
<li><hr class="dropdown-divider"></li>
<li><a asp-controller="UserStores" asp-action="CreateStore" class="dropdown-item" id="StoreSelectorCreate">Create Store</a></li>
<li><a asp-controller="UIUserStores" asp-action="CreateStore" class="dropdown-item" id="StoreSelectorCreate">Create Store</a></li>
</ul>
</div>
}
else
{
<a asp-controller="UserStores" asp-action="CreateStore" class="btn btn-primary w-100 rounded-pill" id="StoreSelectorCreate">Create Store</a>
<a asp-controller="UIUserStores" asp-action="CreateStore" class="btn btn-primary w-100 rounded-pill" id="StoreSelectorCreate">Create Store</a>
}
</div>

View File

@@ -18,10 +18,10 @@ namespace BTCPayServer.Controllers
[Authorize(Policies.CanCreateInvoice, AuthenticationSchemes = AuthenticationSchemes.Bitpay)]
public class BitpayInvoiceController : Controller
{
private readonly InvoiceController _InvoiceController;
private readonly UIInvoiceController _InvoiceController;
private readonly InvoiceRepository _InvoiceRepository;
public BitpayInvoiceController(InvoiceController invoiceController,
public BitpayInvoiceController(UIInvoiceController invoiceController,
InvoiceRepository invoiceRepository)
{
_InvoiceController = invoiceController;

View File

@@ -24,7 +24,7 @@ namespace BTCPayServer.Controllers.GreenField
[EnableCors(CorsPolicies.All)]
public class GreenfieldInvoiceController : Controller
{
private readonly InvoiceController _invoiceController;
private readonly UIInvoiceController _invoiceController;
private readonly InvoiceRepository _invoiceRepository;
private readonly LinkGenerator _linkGenerator;
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
@@ -33,7 +33,7 @@ namespace BTCPayServer.Controllers.GreenField
public LanguageService LanguageService { get; }
public GreenfieldInvoiceController(InvoiceController invoiceController, InvoiceRepository invoiceRepository,
public GreenfieldInvoiceController(UIInvoiceController invoiceController, InvoiceRepository invoiceRepository,
LinkGenerator linkGenerator, LanguageService languageService, BTCPayNetworkProvider btcPayNetworkProvider,
EventAggregator eventAggregator, PaymentMethodHandlerDictionary paymentMethodHandlerDictionary)
{

View File

@@ -151,8 +151,8 @@ namespace BTCPayServer.Controllers.GreenField
Period = ppBlob.Period,
Archived = pp.Archived,
ViewLink = _linkGenerator.GetUriByAction(
nameof(PullPaymentController.ViewPullPayment),
"PullPayment",
nameof(UIPullPaymentController.ViewPullPayment),
"UIPullPayment",
new { pullPaymentId = pp.Id },
Request.Scheme,
Request.Host,

View File

@@ -43,7 +43,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly ExplorerClientProvider _explorerClientProvider;
private readonly ISettingsRepository _settingsRepository;
private readonly NBXplorerDashboard _nbXplorerDashboard;
private readonly WalletsController _walletsController;
private readonly UIWalletsController _walletsController;
private readonly PayjoinClient _payjoinClient;
private readonly DelayedTransactionBroadcaster _delayedTransactionBroadcaster;
private readonly EventAggregator _eventAggregator;
@@ -58,7 +58,7 @@ namespace BTCPayServer.Controllers.GreenField
ExplorerClientProvider explorerClientProvider,
ISettingsRepository settingsRepository,
NBXplorerDashboard nbXplorerDashboard,
WalletsController walletsController,
UIWalletsController walletsController,
PayjoinClient payjoinClient,
DelayedTransactionBroadcaster delayedTransactionBroadcaster,
EventAggregator eventAggregator,

View File

@@ -26,14 +26,14 @@ namespace BTCPayServer.Controllers.GreenField
[EnableCors(CorsPolicies.All)]
public class GreenfieldStoreWebhooksController : ControllerBase
{
public StoreWebhooksController(StoreRepository storeRepository, WebhookSender webhookNotificationManager)
public GreenfieldStoreWebhooksController(StoreRepository storeRepository, WebhookSender webhookSender)
{
StoreRepository = storeRepository;
WebhookNotificationManager = webhookNotificationManager;
WebhookSender = webhookSender;
}
public StoreRepository StoreRepository { get; }
public WebhookSender WebhookNotificationManager { get; }
public WebhookSender WebhookSender { get; }
[HttpGet("~/api/v1/stores/{storeId}/webhooks/{webhookId?}")]
public async Task<IActionResult> ListWebhooks(string storeId, string webhookId)
@@ -152,7 +152,7 @@ namespace BTCPayServer.Controllers.GreenField
var delivery = await StoreRepository.GetWebhookDelivery(CurrentStoreId, webhookId, deliveryId);
if (delivery is null)
return WebhookDeliveryNotFound();
return this.Ok(new JValue(await WebhookNotificationManager.Redeliver(deliveryId)));
return this.Ok(new JValue(await WebhookSender.Redeliver(deliveryId)));
}
[HttpGet("~/api/v1/stores/{storeId}/webhooks/{webhookId}/deliveries/{deliveryId}/request")]

View File

@@ -50,7 +50,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly GreenfieldServerInfoController _greenFieldServerInfoController;
private readonly GreenfieldStoreWebhooksController _storeWebhooksController;
private readonly GreenfieldPullPaymentController _greenfieldPullPaymentController;
private readonly HomeController _homeController;
private readonly UIHomeController _homeController;
private readonly GreenfieldStorePaymentMethodsController _storePaymentMethodsController;
public BTCPayServerClientFactory(StoreRepository storeRepository,
@@ -72,7 +72,7 @@ namespace BTCPayServer.Controllers.GreenField
GreenfieldServerInfoController greenFieldServerInfoController,
GreenfieldStoreWebhooksController storeWebhooksController,
GreenfieldPullPaymentController greenfieldPullPaymentController,
HomeController homeController,
UIHomeController homeController,
GreenfieldStorePaymentMethodsController storePaymentMethodsController)
{
_storeRepository = storeRepository;
@@ -173,7 +173,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly GreenfieldServerInfoController _greenFieldServerInfoController;
private readonly GreenfieldStoreWebhooksController _storeWebhooksController;
private readonly GreenfieldPullPaymentController _greenfieldPullPaymentController;
private readonly HomeController _homeController;
private readonly UIHomeController _homeController;
private readonly GreenfieldStorePaymentMethodsController _storePaymentMethodsController;
public LocalBTCPayServerClient(GreenfieldStoreOnChainPaymentMethodsController chainPaymentMethodsController,
@@ -192,7 +192,7 @@ namespace BTCPayServer.Controllers.GreenField
GreenfieldServerInfoController greenFieldServerInfoController,
GreenfieldStoreWebhooksController storeWebhooksController,
GreenfieldPullPaymentController greenfieldPullPaymentController,
HomeController homeController,
UIHomeController homeController,
GreenfieldStorePaymentMethodsController storePaymentMethodsController,
IHttpContextAccessor httpContextAccessor) : base(new Uri("https://dummy.local"), "", "")
{

View File

@@ -24,7 +24,7 @@ using NicolasDorier.RateLimits;
namespace BTCPayServer.Controllers
{
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
public class AccountController : Controller
public class UIAccountController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager;
@@ -39,7 +39,7 @@ namespace BTCPayServer.Controllers
public Logs Logs { get; }
public AccountController(
public UIAccountController(
UserManager<ApplicationUser> userManager,
RoleManager<IdentityRole> roleManager,
SignInManager<ApplicationUser> signInManager,
@@ -432,7 +432,7 @@ namespace BTCPayServer.Controllers
}
var policies = await _SettingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
if (policies.LockSubscription && !User.IsInRole(Roles.ServerAdmin))
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
ViewData["ReturnUrl"] = returnUrl;
return View();
}
@@ -451,7 +451,7 @@ namespace BTCPayServer.Controllers
ViewData["Logon"] = logon.ToString(CultureInfo.InvariantCulture).ToLowerInvariant();
var policies = await _SettingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
if (policies.LockSubscription && !User.IsInRole(Roles.ServerAdmin))
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
if (ModelState.IsValid)
{
var user = new ApplicationUser
@@ -513,7 +513,7 @@ namespace BTCPayServer.Controllers
{
await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
[HttpGet("/register/confirm-email")]
@@ -522,7 +522,7 @@ namespace BTCPayServer.Controllers
{
if (userId == null || code == null)
{
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
@@ -663,7 +663,7 @@ namespace BTCPayServer.Controllers
}
else
{
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
}

View File

@@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public partial class AppsController
public partial class UIAppsController
{
public class AppUpdated
{

View File

@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public partial class AppsController
public partial class UIAppsController
{
public class PointOfSaleSettings
{

View File

@@ -18,9 +18,9 @@ namespace BTCPayServer.Controllers
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[AutoValidateAntiforgeryToken]
[Route("apps")]
public partial class AppsController : Controller
public partial class UIAppsController : Controller
{
public AppsController(
public UIAppsController(
UserManager<ApplicationUser> userManager,
EventAggregator eventAggregator,
CurrencyNameTable currencies,

View File

@@ -18,15 +18,15 @@ using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using NBitpayClient;
using static BTCPayServer.Controllers.AppsController;
using static BTCPayServer.Controllers.UIAppsController;
namespace BTCPayServer.Controllers
{
public class AppsPublicController : Controller
public class UIAppsPublicController : Controller
{
public AppsPublicController(AppService appService,
public UIAppsPublicController(AppService appService,
BTCPayServerOptions btcPayServerOptions,
InvoiceController invoiceController,
UIInvoiceController invoiceController,
UserManager<ApplicationUser> userManager)
{
_AppService = appService;
@@ -37,7 +37,7 @@ namespace BTCPayServer.Controllers
private readonly AppService _AppService;
private readonly BTCPayServerOptions _BtcPayServerOptions;
private readonly InvoiceController _InvoiceController;
private readonly UIInvoiceController _InvoiceController;
private readonly UserManager<ApplicationUser> _UserManager;
[HttpGet("/apps/{appId}")]
@@ -236,7 +236,7 @@ namespace BTCPayServer.Controllers
}, store, HttpContext.Request.GetAbsoluteRoot(),
new List<string>() { AppService.GetAppInternalTag(appId) },
cancellationToken);
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice", new { invoiceId = invoice.Data.Id });
return RedirectToAction(nameof(UIInvoiceController.Checkout), "UIInvoice", new { invoiceId = invoice.Data.Id });
}
catch (BitpayHttpException e)
{
@@ -390,7 +390,7 @@ namespace BTCPayServer.Controllers
cancellationToken: cancellationToken);
if (request.RedirectToCheckout)
{
return RedirectToAction(nameof(InvoiceController.Checkout), "Invoice",
return RedirectToAction(nameof(UIInvoiceController.Checkout), "UIInvoice",
new { invoiceId = invoice.Data.Id });
}
else

View File

@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public class ErrorController : Controller
public class UIErrorController : Controller
{
[Route("/errors/{statusCode:int}")]
public IActionResult Handle(int? statusCode = null)

View File

@@ -36,7 +36,7 @@ using Newtonsoft.Json.Linq;
namespace BTCPayServer.Controllers
{
public class HomeController : Controller
public class UIHomeController : Controller
{
private readonly ISettingsRepository _settingsRepository;
private readonly StoreRepository _storeRepository;
@@ -46,7 +46,7 @@ namespace BTCPayServer.Controllers
private SignInManager<ApplicationUser> SignInManager { get; }
public LanguageService LanguageService { get; }
public HomeController(IHttpClientFactory httpClientFactory,
public UIHomeController(IHttpClientFactory httpClientFactory,
ISettingsRepository settingsRepository,
IWebHostEnvironment webHostEnvironment,
LanguageService languageService,
@@ -69,7 +69,7 @@ namespace BTCPayServer.Controllers
{
if ((await _settingsRepository.GetTheme()).FirstRun)
{
return RedirectToAction(nameof(AccountController.Register), "Account");
return RedirectToAction(nameof(UIAccountController.Register), "UIAccount");
}
if (SignInManager.IsSignedIn(User))

View File

@@ -10,7 +10,7 @@ using NBitcoin;
namespace BTCPayServer.Controllers
{
public partial class InvoiceController
public partial class UIInvoiceController
{
public class FakePaymentRequest
{

View File

@@ -35,7 +35,7 @@ using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers
{
public partial class InvoiceController
public partial class UIInvoiceController
{
[HttpGet("invoices/{invoiceId}/deliveries/{deliveryId}/request")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
@@ -101,8 +101,8 @@ namespace BTCPayServer.Controllers
{
StoreId = store.Id,
StoreName = store.StoreName,
StoreLink = Url.Action(nameof(StoresController.PaymentMethods), "Stores", new { storeId = store.Id }),
PaymentRequestLink = Url.Action(nameof(PaymentRequestController.ViewPaymentRequest), "PaymentRequest", new { payReqId = invoice.Metadata.PaymentRequestId }),
StoreLink = Url.Action(nameof(UIStoresController.PaymentMethods), "UIStores", new { storeId = store.Id }),
PaymentRequestLink = Url.Action(nameof(UIPaymentRequestController.ViewPaymentRequest), "UIPaymentRequest", new { payReqId = invoice.Metadata.PaymentRequestId }),
Id = invoice.Id,
State = invoiceState,
TransactionSpeed = invoice.SpeedPolicy == SpeedPolicy.HighSpeed ? "high" :
@@ -178,8 +178,8 @@ namespace BTCPayServer.Controllers
if (invoice.CurrentRefund?.PullPaymentDataId is string ppId && !invoice.CurrentRefund.PullPaymentData.Archived)
{
// TODO: Having dedicated UI later on
return RedirectToAction(nameof(PullPaymentController.ViewPullPayment),
"PullPayment",
return RedirectToAction(nameof(UIPullPaymentController.ViewPullPayment),
"UIPullPayment",
new { pullPaymentId = ppId });
}
@@ -369,8 +369,8 @@ namespace BTCPayServer.Controllers
});
await ctx.SaveChangesAsync(cancellationToken);
// TODO: Having dedicated UI later on
return RedirectToAction(nameof(PullPaymentController.ViewPullPayment),
"PullPayment",
return RedirectToAction(nameof(UIPullPaymentController.ViewPullPayment),
"UIPullPayment",
new { pullPaymentId = ppId });
}
@@ -857,7 +857,7 @@ namespace BTCPayServer.Controllers
if (!stores.Any())
{
TempData[WellKnownTempData.ErrorMessage] = "You need to create at least one store before creating a transaction";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
if (model?.StoreId != null)
@@ -898,7 +898,7 @@ namespace BTCPayServer.Controllers
TempData.SetStatusMessageModel(new StatusMessageModel
{
Severity = StatusMessageModel.StatusSeverity.Error,
Html = $"To create an invoice, you need to <a href='{Url.Action(nameof(StoresController.PaymentMethods), "Stores", new { storeId = store.Id })}' class='alert-link'>set up a payment method</a> first",
Html = $"To create an invoice, you need to <a href='{Url.Action(nameof(UIStoresController.PaymentMethods), "UIStores", new { storeId = store.Id })}' class='alert-link'>set up a payment method</a> first",
AllowDismiss = false
});
return View(model);

View File

@@ -29,7 +29,7 @@ using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers
{
[Filters.BitpayAPIConstraint(false)]
public partial class InvoiceController : Controller
public partial class UIInvoiceController : Controller
{
readonly InvoiceRepository _InvoiceRepository;
readonly RateFetcher _RateProvider;
@@ -45,7 +45,7 @@ namespace BTCPayServer.Controllers
public WebhookSender WebhookNotificationManager { get; }
public InvoiceController(
public UIInvoiceController(
InvoiceRepository invoiceRepository,
CurrencyNameTable currencyNameTable,
UserManager<ApplicationUser> userManager,

View File

@@ -35,7 +35,8 @@ using Newtonsoft.Json;
namespace BTCPayServer
{
[Route("~/{cryptoCode}/[controller]/")]
public class LNURLController : Controller
[Route("~/{cryptoCode}/lnurl/")]
public class UILNURLController : Controller
{
private readonly InvoiceRepository _invoiceRepository;
private readonly EventAggregator _eventAggregator;
@@ -43,17 +44,17 @@ namespace BTCPayServer
private readonly LightningLikePaymentHandler _lightningLikePaymentHandler;
private readonly StoreRepository _storeRepository;
private readonly AppService _appService;
private readonly InvoiceController _invoiceController;
private readonly UIInvoiceController _invoiceController;
private readonly SettingsRepository _settingsRepository;
private readonly LinkGenerator _linkGenerator;
public LNURLController(InvoiceRepository invoiceRepository,
public UILNURLController(InvoiceRepository invoiceRepository,
EventAggregator eventAggregator,
BTCPayNetworkProvider btcPayNetworkProvider,
LightningLikePaymentHandler lightningLikePaymentHandler,
StoreRepository storeRepository,
AppService appService,
InvoiceController invoiceController,
UIInvoiceController invoiceController,
SettingsRepository settingsRepository,
LinkGenerator linkGenerator)
{
@@ -115,7 +116,7 @@ namespace BTCPayServer
items = _appService.Parse(cfS.PerksTemplate, cfS.TargetCurrency);
break;
case nameof(AppType.PointOfSale):
var posS = app.GetSettings<AppsController.PointOfSaleSettings>();
var posS = app.GetSettings<UIAppsController.PointOfSaleSettings>();
currencyCode = posS.Currency;
items = _appService.Parse(posS.Template, posS.Currency);
break;
@@ -285,7 +286,7 @@ namespace BTCPayServer
Metadata = JsonConvert.SerializeObject(lnurlMetadata),
Callback = new Uri(_linkGenerator.GetUriByAction(
action: nameof(GetLNURLForInvoice),
controller: "LNURL",
controller: "UILNURL",
values: new { cryptoCode, invoiceId = i.Id }, Request.Scheme, Request.Host, Request.PathBase))
});
}
@@ -462,7 +463,7 @@ namespace BTCPayServer
Message = "LNURL is required for lightning addresses but has not yet been enabled.",
Severity = StatusMessageModel.StatusSeverity.Error
});
return RedirectToAction("PaymentMethods", "Stores", new { storeId });
return RedirectToAction("PaymentMethods", "UIStores", new { storeId });
}
var lightningAddressSettings = await _settingsRepository.GetSettingAsync<LightningAddressSettings>() ??
new LightningAddressSettings();

View File

@@ -11,7 +11,7 @@ using Microsoft.Extensions.Logging;
namespace BTCPayServer.Controllers
{
public partial class ManageController
public partial class UIManageController
{
private const string RecoveryCodesKey = nameof(RecoveryCodesKey);
private const string AuthenicatorUriFormat = "otpauth://totp/{0}:{1}?secret={2}&issuer={0}&digits=6";

View File

@@ -16,7 +16,7 @@ using NBitcoin.DataEncoders;
namespace BTCPayServer.Controllers
{
public partial class ManageController
public partial class UIManageController
{
[HttpGet]
public async Task<IActionResult> APIKeys()

View File

@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public partial class ManageController
public partial class UIManageController
{
[HttpGet]
public async Task<IActionResult> LoginCodes()

View File

@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
namespace BTCPayServer.Controllers
{
public partial class ManageController
public partial class UIManageController
{
[HttpGet("notifications")]
public async Task<IActionResult> NotificationSettings([FromServices] IEnumerable<INotificationHandler> notificationHandlers)

View File

@@ -24,7 +24,7 @@ namespace BTCPayServer.Controllers
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewProfile)]
[Route("[controller]/[action]")]
public partial class ManageController : Controller
public partial class UIManageController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager;
@@ -40,11 +40,11 @@ namespace BTCPayServer.Controllers
private readonly UserService _userService;
readonly StoreRepository _StoreRepository;
public ManageController(
public UIManageController(
UserManager<ApplicationUser> userManager,
SignInManager<ApplicationUser> signInManager,
EmailSenderFactory emailSenderFactory,
ILogger<ManageController> logger,
ILogger<UIManageController> logger,
UrlEncoder urlEncoder,
StoreRepository storeRepository,
BTCPayServerEnvironment btcPayServerEnvironment,
@@ -278,7 +278,7 @@ namespace BTCPayServer.Controllers
await _userService.DeleteUserAndAssociatedData(user);
TempData[WellKnownTempData.SuccessMessage] = "Account successfully deleted.";
await _signInManager.SignOutAsync();
return RedirectToAction(nameof(AccountController.Login), "Account");
return RedirectToAction(nameof(UIAccountController.Login), "UIAccount");
}

View File

@@ -21,7 +21,7 @@ namespace BTCPayServer.Controllers
[BitpayAPIConstraint(false)]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewNotificationsForUser)]
[Route("[controller]/[action]")]
public class NotificationsController : Controller
public class UINotificationsController : Controller
{
private readonly BTCPayServerEnvironment _env;
private readonly NotificationSender _notificationSender;
@@ -29,7 +29,7 @@ namespace BTCPayServer.Controllers
private readonly NotificationManager _notificationManager;
private readonly EventAggregator _eventAggregator;
public NotificationsController(BTCPayServerEnvironment env,
public UINotificationsController(BTCPayServerEnvironment env,
NotificationSender notificationSender,
UserManager<ApplicationUser> userManager,
NotificationManager notificationManager,
@@ -106,7 +106,7 @@ namespace BTCPayServer.Controllers
public async Task<IActionResult> Index(int skip = 0, int count = 50, int timezoneOffset = 0)
{
if (!ValidUserClaim(out var userId))
return RedirectToAction("Index", "Home");
return RedirectToAction("Index", "UIHome");
var res = await _notificationManager.GetNotifications(new NotificationsQuery()
{

View File

@@ -25,9 +25,9 @@ namespace BTCPayServer.Controllers
{
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Route("payment-requests")]
public class PaymentRequestController : Controller
public class UIPaymentRequestController : Controller
{
private readonly InvoiceController _InvoiceController;
private readonly UIInvoiceController _InvoiceController;
private readonly UserManager<ApplicationUser> _UserManager;
private readonly PaymentRequestRepository _PaymentRequestRepository;
private readonly PaymentRequestService _PaymentRequestService;
@@ -36,8 +36,8 @@ namespace BTCPayServer.Controllers
private readonly InvoiceRepository _InvoiceRepository;
private readonly LinkGenerator _linkGenerator;
public PaymentRequestController(
InvoiceController invoiceController,
public UIPaymentRequestController(
UIInvoiceController invoiceController,
UserManager<ApplicationUser> userManager,
PaymentRequestRepository paymentRequestRepository,
PaymentRequestService paymentRequestService,
@@ -220,7 +220,7 @@ namespace BTCPayServer.Controllers
{
if (redirectToInvoice)
{
return RedirectToAction("Checkout", "Invoice", new { currentInvoice.Id });
return RedirectToAction("Checkout", "UIInvoice", new { currentInvoice.Id });
}
return Ok(currentInvoice.Id);
@@ -260,7 +260,7 @@ namespace BTCPayServer.Controllers
if (redirectToInvoice)
{
return RedirectToAction("Checkout", "Invoice", new { newInvoice.Id });
return RedirectToAction("Checkout", "UIInvoice", new { newInvoice.Id });
}
return Ok(newInvoice.Id);

View File

@@ -11,16 +11,16 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public class PublicController : Controller
public class UIPublicController : Controller
{
public PublicController(InvoiceController invoiceController,
public UIPublicController(UIInvoiceController invoiceController,
StoreRepository storeRepository)
{
_InvoiceController = invoiceController;
_StoreRepository = storeRepository;
}
private readonly InvoiceController _InvoiceController;
private readonly UIInvoiceController _InvoiceController;
private readonly StoreRepository _StoreRepository;
[HttpGet]

View File

@@ -16,13 +16,13 @@ namespace BTCPayServer.Controllers
[Route("embed/{storeId}/{cryptoCode}/ln")]
[AllowAnonymous]
public class PublicLightningNodeInfoController : Controller
public class UIPublicLightningNodeInfoController : Controller
{
private readonly BTCPayNetworkProvider _BtcPayNetworkProvider;
private readonly LightningLikePaymentHandler _LightningLikePaymentHandler;
private readonly StoreRepository _StoreRepository;
public PublicLightningNodeInfoController(BTCPayNetworkProvider btcPayNetworkProvider,
public UIPublicLightningNodeInfoController(BTCPayNetworkProvider btcPayNetworkProvider,
LightningLikePaymentHandler lightningLikePaymentHandler, StoreRepository storeRepository)
{
_BtcPayNetworkProvider = btcPayNetworkProvider;

View File

@@ -19,7 +19,7 @@ using Microsoft.EntityFrameworkCore;
namespace BTCPayServer.Controllers
{
[AllowAnonymous]
public class PullPaymentController : Controller
public class UIPullPaymentController : Controller
{
private readonly ApplicationDbContextFactory _dbContextFactory;
private readonly BTCPayNetworkProvider _networkProvider;
@@ -28,7 +28,7 @@ namespace BTCPayServer.Controllers
private readonly BTCPayNetworkJsonSerializerSettings _serializerSettings;
private readonly IEnumerable<IPayoutHandler> _payoutHandlers;
public PullPaymentController(ApplicationDbContextFactory dbContextFactory,
public UIPullPaymentController(ApplicationDbContextFactory dbContextFactory,
BTCPayNetworkProvider networkProvider,
CurrencyNameTable currencyNameTable,
PullPaymentHostedService pullPaymentHostedService,

View File

@@ -13,7 +13,7 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public partial class ServerController
public partial class UIServerController
{
[HttpGet("server/plugins")]
public async Task<IActionResult> ListPlugins(

View File

@@ -27,7 +27,7 @@ using Newtonsoft.Json.Linq;
namespace BTCPayServer.Controllers
{
public partial class ServerController
public partial class UIServerController
{
[HttpGet("server/files")]
public async Task<IActionResult> Files([FromQuery] string[] fileIds = null)
@@ -260,7 +260,7 @@ namespace BTCPayServer.Controllers
[HttpPost("server/storage")]
public IActionResult Storage(StorageSettings viewModel)
{
return RedirectToAction("StorageProvider", "Server", new
return RedirectToAction("StorageProvider", "UIServer", new
{
provider = viewModel.Provider.ToString()
});

View File

@@ -16,7 +16,7 @@ using Microsoft.EntityFrameworkCore;
namespace BTCPayServer.Controllers
{
public partial class ServerController
public partial class UIServerController
{
[Route("server/users")]
public async Task<IActionResult> ListUsers(

View File

@@ -42,7 +42,7 @@ namespace BTCPayServer.Controllers
{
[Authorize(Policy = BTCPayServer.Client.Policies.CanModifyServerSettings,
AuthenticationSchemes = AuthenticationSchemes.Cookie)]
public partial class ServerController : Controller
public partial class UIServerController : Controller
{
private readonly UserManager<ApplicationUser> _UserManager;
private readonly UserService _userService;
@@ -61,7 +61,7 @@ namespace BTCPayServer.Controllers
private readonly FileService _FileService;
private readonly IEnumerable<IStorageProviderService> _StorageProviderServices;
public ServerController(
public UIServerController(
UserManager<ApplicationUser> userManager,
UserService userService,
StoredFileRepository storedFileRepository,

View File

@@ -5,11 +5,11 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Storage
{
[Route("Storage")]
public class StorageController : Controller
public class UIStorageController : Controller
{
private readonly FileService _FileService;
public StorageController(FileService fileService)
public UIStorageController(FileService fileService)
{
_FileService = fileService;
}

View File

@@ -28,7 +28,7 @@ namespace BTCPayServer.Controllers
[Route("stores/{storeId}/pull-payments")]
[Authorize(Policy = Policies.CanViewStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[AutoValidateAntiforgeryToken]
public class StorePullPaymentsController : Controller
public class UIStorePullPaymentsController : Controller
{
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
private readonly IEnumerable<IPayoutHandler> _payoutHandlers;
@@ -44,7 +44,7 @@ namespace BTCPayServer.Controllers
return HttpContext.GetStoreData();
}
}
public StorePullPaymentsController(BTCPayNetworkProvider btcPayNetworkProvider,
public UIStorePullPaymentsController(BTCPayNetworkProvider btcPayNetworkProvider,
IEnumerable<IPayoutHandler> payoutHandlers,
CurrencyNameTable currencyNameTable,
PullPaymentHostedService pullPaymentHostedService,
@@ -74,7 +74,7 @@ namespace BTCPayServer.Controllers
Message = "You must enable at least one payment method before creating a pull payment.",
Severity = StatusMessageModel.StatusSeverity.Error
});
return RedirectToAction("PaymentMethods", "Stores", new { storeId });
return RedirectToAction("PaymentMethods", "UIStores", new { storeId });
}
return View(new NewPullPaymentModel
{
@@ -439,7 +439,7 @@ namespace BTCPayServer.Controllers
Message = "You must enable at least one payment method before creating a payout.",
Severity = StatusMessageModel.StatusSeverity.Error
});
return RedirectToAction("PaymentMethods", "Stores", new { storeId });
return RedirectToAction("PaymentMethods", "UIStores", new { storeId });
}
var vm = this.ParseListQuery(new PayoutsModel

View File

@@ -9,7 +9,7 @@ using MimeKit;
namespace BTCPayServer.Controllers
{
public partial class StoresController
public partial class UIStoresController
{
[Route("{storeId}/emails")]

View File

@@ -12,7 +12,7 @@ using NBitcoin.DataEncoders;
namespace BTCPayServer.Controllers
{
public partial class StoresController
public partial class UIStoresController
{
[HttpGet("{storeId}/integrations")]
public IActionResult Integrations()

View File

@@ -13,7 +13,7 @@ using Microsoft.Extensions.DependencyInjection;
namespace BTCPayServer.Controllers
{
public partial class StoresController
public partial class UIStoresController
{
[HttpGet("{storeId}/lightning/{cryptoCode}")]
public async Task<IActionResult> SetupLightningNode(string storeId, string cryptoCode)

View File

@@ -26,7 +26,7 @@ using NBXplorer.Models;
namespace BTCPayServer.Controllers
{
public partial class StoresController
public partial class UIStoresController
{
[HttpGet("{storeId}/onchain/{cryptoCode}")]
public ActionResult SetupWallet(WalletSetupViewModel vm)

View File

@@ -36,11 +36,11 @@ namespace BTCPayServer.Controllers
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[AutoValidateAntiforgeryToken]
public partial class StoresController : Controller
public partial class UIStoresController : Controller
{
readonly RateFetcher _RateFactory;
public string CreatedStoreId { get; set; }
public StoresController(
public UIStoresController(
IServiceProvider serviceProvider,
BTCPayServerOptions btcpayServerOptions,
BTCPayServerEnvironment btcpayEnv,
@@ -701,7 +701,7 @@ namespace BTCPayServer.Controllers
{
await _Repo.DeleteStore(CurrentStore.Id);
TempData[WellKnownTempData.SuccessMessage] = "Store successfully deleted.";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
private IEnumerable<AvailableRateProvider> GetSupportedExchanges()
@@ -873,7 +873,7 @@ namespace BTCPayServer.Controllers
if (!model.Stores.Any())
{
TempData[WellKnownTempData.ErrorMessage] = "You need to be owner of at least one store before pairing";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
return View(model);
}
@@ -932,7 +932,7 @@ namespace BTCPayServer.Controllers
if (pairing == null)
{
TempData[WellKnownTempData.ErrorMessage] = "Unknown pairing code";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
else
{

View File

@@ -16,12 +16,12 @@ namespace BTCPayServer.Controllers
{
[Route("stores")]
[AutoValidateAntiforgeryToken]
public class UserStoresController : Controller
public class UIUserStoresController : Controller
{
private readonly StoreRepository _repo;
private readonly UserManager<ApplicationUser> _userManager;
public UserStoresController(
public UIUserStoresController(
UserManager<ApplicationUser> userManager,
StoreRepository storeRepository)
{
@@ -47,7 +47,7 @@ namespace BTCPayServer.Controllers
var store = await _repo.CreateStore(GetUserId(), vm.Name);
CreatedStoreId = store.Id;
TempData[WellKnownTempData.SuccessMessage] = "Store successfully created";
return RedirectToAction(nameof(StoresController.Dashboard), "Stores", new
return RedirectToAction(nameof(UIStoresController.Dashboard), "UIStores", new
{
storeId = store.Id
});
@@ -78,7 +78,7 @@ namespace BTCPayServer.Controllers
return NotFound();
await _repo.RemoveStore(storeId, userId);
TempData[WellKnownTempData.SuccessMessage] = "Store removed successfully";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
private string GetUserId() => _userManager.GetUserId(User);

View File

@@ -20,11 +20,11 @@ namespace BTCPayServer.Controllers
{
[Route("vault")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanModifyStoreSettings)]
public class VaultController : Controller
public class UIVaultController : Controller
{
private readonly IAuthorizationService _authorizationService;
public VaultController(BTCPayNetworkProvider networks, IAuthorizationService authorizationService)
public UIVaultController(BTCPayNetworkProvider networks, IAuthorizationService authorizationService)
{
Networks = networks;
_authorizationService = authorizationService;

View File

@@ -20,7 +20,7 @@ using NBXplorer.Models;
namespace BTCPayServer.Controllers
{
public partial class WalletsController
public partial class UIWalletsController
{
[NonAction]

View File

@@ -37,7 +37,7 @@ namespace BTCPayServer.Controllers
[Route("wallets")]
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[AutoValidateAntiforgeryToken]
public partial class WalletsController : Controller
public partial class UIWalletsController : Controller
{
private StoreRepository Repository { get; }
private WalletRepository WalletRepository { get; }
@@ -64,7 +64,7 @@ namespace BTCPayServer.Controllers
private readonly IEnumerable<IPayoutHandler> _payoutHandlers;
readonly CurrencyNameTable _currencyTable;
public WalletsController(StoreRepository repo,
public UIWalletsController(StoreRepository repo,
WalletRepository walletRepository,
CurrencyNameTable currencyTable,
BTCPayNetworkProvider networkProvider,
@@ -802,7 +802,7 @@ namespace BTCPayServer.Controllers
{
SigningContext = signingContext,
WalletId = walletId.ToString(),
WebsocketPath = this.Url.Action(nameof(VaultController.VaultBridgeConnection), "Vault", new { walletId = walletId.ToString() })
WebsocketPath = this.Url.Action(nameof(UIVaultController.VaultBridgeConnection), "UIVault", new { walletId = walletId.ToString() })
});
}
@@ -821,7 +821,7 @@ namespace BTCPayServer.Controllers
{
var redirectVm = new PostRedirectViewModel
{
AspController = "Wallets",
AspController = "UIWallets",
AspAction = nameof(WalletPSBTReady),
Parameters =
{
@@ -854,7 +854,7 @@ namespace BTCPayServer.Controllers
{
var redirectVm = new PostRedirectViewModel
{
AspController = "Wallets",
AspController = "UIWallets",
AspAction = nameof(WalletPSBT),
Parameters =
{

View File

@@ -264,8 +264,8 @@ public class BitcoinLikePayoutHandler : IPayoutHandler
}
}
if (bip21.Any())
return new RedirectToActionResult("WalletSend", "Wallets", new { walletId = new WalletId(storeId, paymentMethodId.CryptoCode).ToString(), bip21 });
return new RedirectToActionResult("Payouts", "Wallets", new
return new RedirectToActionResult("WalletSend", "UIWallets", new { walletId = new WalletId(storeId, paymentMethodId.CryptoCode).ToString(), bip21 });
return new RedirectToActionResult("Payouts", "UIWallets", new
{
walletId = new WalletId(storeId, paymentMethodId.CryptoCode).ToString(),
pullPaymentId = pullPaymentIds.Length == 1 ? pullPaymentIds.First() : null

View File

@@ -165,7 +165,7 @@ namespace BTCPayServer.Data.Payouts.LightningLike
public Task<IActionResult> InitiatePayment(PaymentMethodId paymentMethodId, string[] payoutIds)
{
return Task.FromResult<IActionResult>(new RedirectToActionResult("ConfirmLightningPayout",
"LightningLikePayout", new { cryptoCode = paymentMethodId.CryptoCode, payoutIds }));
"UILightningLikePayout", new { cryptoCode = paymentMethodId.CryptoCode, payoutIds }));
}
}
}

View File

@@ -23,7 +23,7 @@ namespace BTCPayServer.Data.Payouts.LightningLike
{
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[AutoValidateAntiforgeryToken]
public class LightningLikePayoutController : Controller
public class UILightningLikePayoutController : Controller
{
private readonly ApplicationDbContextFactory _applicationDbContextFactory;
private readonly UserManager<ApplicationUser> _userManager;
@@ -34,7 +34,7 @@ namespace BTCPayServer.Data.Payouts.LightningLike
private readonly IOptions<LightningNetworkOptions> _options;
private readonly IAuthorizationService _authorizationService;
public LightningLikePayoutController(ApplicationDbContextFactory applicationDbContextFactory,
public UILightningLikePayoutController(ApplicationDbContextFactory applicationDbContextFactory,
UserManager<ApplicationUser> userManager,
BTCPayNetworkJsonSerializerSettings btcPayNetworkJsonSerializerSettings,
IEnumerable<IPayoutHandler> payoutHandlers,

View File

@@ -45,7 +45,7 @@ namespace BTCPayServer
public static bool TryGetPayjoinEndpoint(this BitcoinUrlBuilder bip21, out Uri endpoint)
{
endpoint = bip21.UnknowParameters.TryGetValue($"{PayjoinClient.BIP21EndpointKey}", out var uri) ? new Uri(uri, UriKind.Absolute) : null;
endpoint = bip21.UnknownParameters.TryGetValue($"{PayjoinClient.BIP21EndpointKey}", out var uri) ? new Uri(uri, UriKind.Absolute) : null;
return endpoint != null;
}
@@ -493,7 +493,7 @@ namespace BTCPayServer
{
var redirectVm = new PostRedirectViewModel
{
AspController = "Home",
AspController = "UIHome",
AspAction = "RecoverySeedBackup",
Parameters =
{

View File

@@ -11,15 +11,15 @@ namespace Microsoft.AspNetCore.Mvc
{
public static string EmailConfirmationLink(this LinkGenerator urlHelper, string userId, string code, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(nameof(AccountController.ConfirmEmail), "Account",
return urlHelper.GetUriByAction(nameof(UIAccountController.ConfirmEmail), "UIAccount",
new { userId, code }, scheme, host, pathbase);
}
public static string ResetPasswordCallbackLink(this LinkGenerator urlHelper, string userId, string code, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(
action: nameof(AccountController.SetPassword),
controller: "Account",
action: nameof(UIAccountController.SetPassword),
controller: "UIAccount",
values: new { userId, code },
scheme: scheme,
host: host,
@@ -30,8 +30,8 @@ namespace Microsoft.AspNetCore.Mvc
public static string PaymentRequestLink(this LinkGenerator urlHelper, string paymentRequestId, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(
action: nameof(PaymentRequestController.ViewPaymentRequest),
controller: "PaymentRequest",
action: nameof(UIPaymentRequestController.ViewPaymentRequest),
controller: "UIPaymentRequest",
values: new { id = paymentRequestId },
scheme, host, pathbase);
}
@@ -39,8 +39,8 @@ namespace Microsoft.AspNetCore.Mvc
public static string AppLink(this LinkGenerator urlHelper, string appId, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(
action: nameof(AppsPublicController.RedirectToApp),
controller: "AppsPublic",
action: nameof(UIAppsPublicController.RedirectToApp),
controller: "UIAppsPublic",
values: new { appId },
scheme, host, pathbase);
}
@@ -48,8 +48,8 @@ namespace Microsoft.AspNetCore.Mvc
public static string InvoiceLink(this LinkGenerator urlHelper, string invoiceId, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(
action: nameof(InvoiceController.Invoice),
controller: "Invoice",
action: nameof(UIInvoiceController.Invoice),
controller: "UIInvoice",
values: new { invoiceId = invoiceId },
scheme, host, pathbase);
}
@@ -57,8 +57,8 @@ namespace Microsoft.AspNetCore.Mvc
public static string CheckoutLink(this LinkGenerator urlHelper, string invoiceId, string scheme, HostString host, string pathbase)
{
return urlHelper.GetUriByAction(
action: nameof(InvoiceController.Checkout),
controller: "Invoice",
action: nameof(UIInvoiceController.Checkout),
controller: "UIInvoice",
values: new { invoiceId = invoiceId },
scheme, host, pathbase);
}
@@ -67,8 +67,8 @@ namespace Microsoft.AspNetCore.Mvc
{
WalletId.TryParse(walletIdOrStoreId, out var wallet);
return urlHelper.GetUriByAction(
action: nameof(StorePullPaymentsController.Payouts),
controller: "StorePullPayments",
action: nameof(UIStorePullPaymentsController.Payouts),
controller: "UIStorePullPayments",
values: new { storeId = wallet?.StoreId ?? walletIdOrStoreId, pullPaymentId },
scheme, host, pathbase);
}

View File

@@ -90,7 +90,7 @@ namespace BTCPayServer.Fido2
private ActionResult RedirectToList()
{
return RedirectToAction("TwoFactorAuthentication", "Manage");
return RedirectToAction("TwoFactorAuthentication", "UIManage");
}
}
}

View File

@@ -37,7 +37,7 @@ namespace BTCPayServer.HostedServices
switch (Enum.Parse<AppType>(data.AppType))
{
case AppType.PointOfSale:
var possettings = data.GetSettings<AppsController.PointOfSaleSettings>();
var possettings = data.GetSettings<UIAppsController.PointOfSaleSettings>();
return (Data: data, Settings: (object)possettings,
Items: _appService.Parse(possettings.Template, possettings.Currency));
case AppType.Crowdfund:
@@ -69,7 +69,7 @@ namespace BTCPayServer.HostedServices
{
case AppType.PointOfSale:
((AppsController.PointOfSaleSettings)valueTuple.Settings).Template =
((UIAppsController.PointOfSaleSettings)valueTuple.Settings).Template =
_appService.SerializeTemplate(valueTuple.Items);
break;
case AppType.Crowdfund:

View File

@@ -382,9 +382,9 @@ namespace BTCPayServer.Hosting
services.TryAddScoped<IHttpContextAccessor, HttpContextAccessor>();
services.AddTransient<BitpayAccessTokenController>();
services.AddTransient<InvoiceController>();
services.AddTransient<AppsPublicController>();
services.AddTransient<PaymentRequestController>();
services.AddTransient<UIInvoiceController>();
services.AddTransient<UIAppsPublicController>();
services.AddTransient<UIPaymentRequestController>();
// Add application services.
services.AddSingleton<EmailSenderFactory>();

View File

@@ -236,7 +236,7 @@ namespace BTCPayServer.Hosting
case nameof(AppType.PointOfSale):
var settings2 = app.GetSettings<AppsController.PointOfSaleSettings>();
var settings2 = app.GetSettings<UIAppsController.PointOfSaleSettings>();
if (string.IsNullOrEmpty(settings2.Currency))
{
settings2.Currency = app.StoreData.GetStoreBlob().DefaultCurrency;

View File

@@ -270,7 +270,7 @@ namespace BTCPayServer.Hosting
PaymentRequestHub.Register(endpoints);
endpoints.MapRazorPages();
endpoints.MapControllers();
endpoints.MapControllerRoute("default", "{controller:validate=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller:validate=UIHome}/{action=Index}/{id?}");
});
app.UsePlugins();
}

View File

@@ -20,7 +20,7 @@ namespace BTCPayServer.PaymentRequest
{
public class PaymentRequestHub : Hub
{
private readonly PaymentRequestController _PaymentRequestController;
private readonly UIPaymentRequestController _PaymentRequestController;
public const string InvoiceCreated = "InvoiceCreated";
public const string PaymentReceived = "PaymentReceived";
public const string InfoUpdated = "InfoUpdated";
@@ -28,7 +28,7 @@ namespace BTCPayServer.PaymentRequest
public const string CancelInvoiceError = "CancelInvoiceError";
public const string InvoiceCancelled = "InvoiceCancelled";
public PaymentRequestHub(PaymentRequestController paymentRequestController)
public PaymentRequestHub(UIPaymentRequestController paymentRequestController)
{
_PaymentRequestController = paymentRequestController;
}

View File

@@ -38,7 +38,7 @@ namespace BTCPayServer.Plugins.Shopify
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly StoreRepository _storeRepository;
private readonly InvoiceRepository _invoiceRepository;
private readonly InvoiceController _invoiceController;
private readonly UIInvoiceController _invoiceController;
private readonly IJsonHelper _jsonHelper;
private readonly IHttpClientFactory _clientFactory;
@@ -47,7 +47,7 @@ namespace BTCPayServer.Plugins.Shopify
IWebHostEnvironment webHostEnvironment,
StoreRepository storeRepository,
InvoiceRepository invoiceRepository,
InvoiceController invoiceController,
UIInvoiceController invoiceController,
IJsonHelper jsonHelper,
IHttpClientFactory clientFactory)
{

View File

@@ -16,9 +16,9 @@ namespace BTCPayServer.Services.Apps
public const string PaymentReceived = "PaymentReceived";
public const string InfoUpdated = "InfoUpdated";
public const string InvoiceError = "InvoiceError";
private readonly AppsPublicController _AppsPublicController;
private readonly UIAppsPublicController _AppsPublicController;
public AppHub(AppsPublicController appsPublicController)
public AppHub(UIAppsPublicController appsPublicController)
{
_AppsPublicController = appsPublicController;
}

View File

@@ -25,7 +25,7 @@ namespace BTCPayServer.Services.Apps
protected override void SubscribeToEvents()
{
Subscribe<InvoiceEvent>();
Subscribe<AppsController.AppUpdated>();
Subscribe<UIAppsController.AppUpdated>();
}
protected override async Task ProcessEvent(object evt, CancellationToken cancellationToken)
@@ -47,7 +47,7 @@ namespace BTCPayServer.Services.Apps
await InfoUpdated(appId);
}
}
else if (evt is AppsController.AppUpdated app)
else if (evt is UIAppsController.AppUpdated app)
{
await InfoUpdated(app.AppId);
}

View File

@@ -262,7 +262,7 @@ namespace BTCPayServer.Services.Apps
{
AppType appTypeEnum = Enum.Parse<AppType>(appType);
AppData appData = await GetApp(appId, appTypeEnum, false);
var settings = appData.GetSettings<AppsController.PointOfSaleSettings>();
var settings = appData.GetSettings<UIAppsController.PointOfSaleSettings>();
string style;
switch (appTypeEnum)

View File

@@ -37,8 +37,8 @@ namespace BTCPayServer.Services.Notifications.Blobs
{
vm.Body =
"A payment that was made to an approved payout by an external wallet is waiting for your confirmation.";
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(StorePullPaymentsController.Payouts),
"StorePullPayments",
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(UIStorePullPaymentsController.Payouts),
"UIStorePullPayments",
new
{
storeId = notification.StoreId,

View File

@@ -52,8 +52,8 @@ namespace BTCPayServer.Services.Notifications.Blobs
{
vm.Body = $"{baseStr} {TextMapping[notification.Event]}";
}
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(InvoiceController.Invoice),
"Invoice",
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(UIInvoiceController.Invoice),
"UIInvoice",
new { invoiceId = notification.InvoiceId }, _options.RootPath);
}
}

View File

@@ -33,8 +33,8 @@ namespace BTCPayServer.Services.Notifications.Blobs
protected override void FillViewModel(PayoutNotification notification, NotificationViewModel vm)
{
vm.Body = "A new payout is awaiting for approval";
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(StorePullPaymentsController.Payouts),
"StorePullPayments",
vm.ActionLink = _linkGenerator.GetPathByAction(nameof(UIStorePullPaymentsController.Payouts),
"UIStorePullPayments",
new { storeId = notification.StoreId, paymentMethodId = notification.PaymentMethod }, _options.RootPath);
}
}

View File

@@ -1,18 +0,0 @@
@model BTCPayServer.Models.AppViewModels.ViewPointOfSaleViewModel
@{
Layout = "_LayoutPos";
}
<partial name="_StatusMessage" />
@if (Context.Request.Query.ContainsKey("simple"))
{
<partial name="/Views/AppsPublic/PointOfSale/MinimalLight.cshtml" model="Model" />
}
else
{
<noscript>
<partial name="/Views/AppsPublic/PointOfSale/MinimalLight.cshtml" model="Model" />
</noscript>
<partial name="/Views/AppsPublic/PointOfSale/VueLight.cshtml" model="Model" />
}

View File

@@ -1,4 +0,0 @@
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData["NavPartialName"] = "../Manage/_Nav";
}

View File

@@ -1,18 +0,0 @@
@using BTCPayServer.Configuration
@inject BTCPayServerOptions BTCPayServerOptions
<nav id="SectionNav" class="nav">
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Users" class="nav-link @ViewData.IsActivePage(ServerNavPages.Users)" asp-action="ListUsers">Users</a>
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Emails" class="nav-link @ViewData.IsActivePage(ServerNavPages.Emails)" asp-action="Emails">Email Server</a>
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Policies" class="nav-link @ViewData.IsActivePage(ServerNavPages.Policies)" asp-action="Policies">Policies</a>
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Services" class="nav-link @ViewData.IsActivePage(ServerNavPages.Services)" asp-action="Services">Services</a>
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Theme" class="nav-link @ViewData.IsActivePage(ServerNavPages.Theme)" asp-action="Theme">Theme</a>
@if (BTCPayServerOptions.DockerDeployment)
{
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Maintenance" class="nav-link @ViewData.IsActivePage(ServerNavPages.Maintenance)" asp-action="Maintenance">Maintenance</a>
}
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Logs" class="nav-link @ViewData.IsActivePage(ServerNavPages.Logs)" asp-action="LogsView">Logs</a>
<a asp-controller="Server" id="SectionNav-@ServerNavPages.Files" class="nav-link @ViewData.IsActivePage(ServerNavPages.Files)" asp-action="Files">Files</a>
<vc:ui-extension-point location="server-nav" model="@Model"/>
</nav>

View File

@@ -15,7 +15,7 @@
@if (possible)
{
<li class="nav-item">
<a asp-area="" asp-controller="LNURL" asp-action="EditLightningAddress" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("LightningAddress", nameof(StoreNavPages))" id="StoreNav-LightningAddress">
<a asp-area="" asp-controller="UILNURL" asp-action="EditLightningAddress" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("LightningAddress", nameof(StoreNavPages))" id="StoreNav-LightningAddress">
<vc:icon symbol="wallet-lightning"/>
<span>Lightning Address</span>
</a>

View File

@@ -22,7 +22,7 @@
<span class="d-flex align-items-center fw-semibold">
@if (possible)
{
<a id="lightning-address-setup-link" class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="LNURL" asp-action="EditLightningAddress" asp-route-storeId="@Context.GetRouteValue("storeId")">
<a id="lightning-address-setup-link" class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UILNURL" asp-action="EditLightningAddress" asp-route-storeId="@Context.GetRouteValue("storeId")">
Setup
</a>
}
@@ -30,7 +30,7 @@
{
if (!isLightningEnabled)
{
<a asp-action="PaymentMethods" asp-controller="Stores" asp-route-storeId="@store.Id" class="btn btn-link p-0">
<a asp-action="PaymentMethods" asp-controller="UIStores" asp-route-storeId="@store.Id" class="btn btn-link p-0">
You need to setup Lightning first
</a>
}

View File

@@ -8,5 +8,5 @@
}
@if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.ServerAdmin) && MoneroLikeConfiguration.MoneroLikeConfigurationItems.Any())
{
<a class="nav-link @(isMonero ? "active" : string.Empty)" asp-route-storeId="@this.Context.GetRouteValue("storeId")" asp-action="GetStoreMoneroLikePaymentMethods" asp-controller="MoneroLikeStore">Monero</a>
<a class="nav-link @(isMonero ? "active" : string.Empty)" asp-route-storeId="@this.Context.GetRouteValue("storeId")" asp-action="GetStoreMoneroLikePaymentMethods" asp-controller="UIMoneroLikeStore">Monero</a>
}

View File

@@ -2,5 +2,5 @@
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close" />
</button>
The Email settings have not been configured on this server or store yet. Setting this field will not send emails until then. <a asp-action="Emails" asp-controller="Stores" asp-route-storeId="@Model" class="alert-link">Configure store email settings</a>
The Email settings have not been configured on this server or store yet. Setting this field will not send emails until then. <a asp-action="Emails" asp-controller="UIStores" asp-route-storeId="@Model" class="alert-link">Configure store email settings</a>
</div>

View File

@@ -6,8 +6,8 @@
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="spiral-gradient" x1="81.36" y1="311.35" x2="541.35" y2="311.35" gradientUnits="userSpaceOnUse"><stop offset=".18" stop-color="#00f"/><stop offset="1" stop-color="#f0f"/></linearGradient>
<linearGradient id="pnxbet-a" x1="108.127" y1="162.181" x2="74.499" y2="305.982" gradientUnits="userSpaceOnUse"><stop stop-color="#FA1366"/><stop offset="1" stop-color="#FD6E06"/></linearGradient>
<linearGradient id="pnxbet-c" x1="152.732" y1="33.344" x2="2.684" y2="194.507" gradientUnits="userSpaceOnUse"><stop stop-color="#F91500"/><stop offset="1" stop-color="#FDD140"/></linearGradient>
<linearGradient id="pnxbet-a" x1="108.127" y1="162.181" x2="74.499" y2="305.982" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#FA1366"/><stop offset="1" stop-color="#FD6E06"/></linearGradient>
<linearGradient id="pnxbet-c" x1="152.732" y1="33.344" x2="2.684" y2="194.507" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#F91500"/><stop offset="1" stop-color="#FDD140"/></linearGradient>
<filter id="pnxbet-b" x="35.029" y="154.606" width="85.36" height="85.36" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation=".5" result="effect1_foregroundBlur"/></filter>
<filter id="pnxbet-d" x="8.414" y="53.573" width="93.523" height="181.835" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="1" result="effect1_foregroundBlur"/></filter>
</defs>

View File

@@ -81,9 +81,9 @@
<script>
if ('WebSocket' in window && window.WebSocket.CLOSING === 2) {
const { host, protocol } = window.location;
var wsUri = "@_linkGenerator.GetPathByAction("SubscribeUpdates", "Notifications", pathBase: this.Context.Request.PathBase)";
var wsUri = "@_linkGenerator.GetPathByAction("SubscribeUpdates", "UINotifications", pathBase: this.Context.Request.PathBase)";
wsUri = (protocol === "https:" ? "wss:" : "ws:") + "//" + host + wsUri;
const newDataEndpoint = "@_linkGenerator.GetPathByAction("GetNotificationDropdownUI", "Notifications", pathBase: this.Context.Request.PathBase)";
const newDataEndpoint = "@_linkGenerator.GetPathByAction("GetNotificationDropdownUI", "UINotifications", pathBase: this.Context.Request.PathBase)";
try {
socket = new WebSocket(wsUri);
socket.onmessage = e => {

View File

@@ -9,7 +9,7 @@
<div class="row justify-content-center mb-2">
<div class="col text-center">
<a asp-controller="Home" asp-action="Index" tabindex="-1">
<a asp-controller="UIHome" asp-action="Index" tabindex="-1">
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="mb-4" height="70" asp-append-version="true"/>
</a>

View File

@@ -11,7 +11,7 @@
<div class="row justify-content-center mb-2">
<div class="col text-center">
<a asp-controller="Home" asp-action="Index">
<a asp-controller="UIHome" asp-action="Index">
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="mb-4" height="70" asp-append-version="true"/>
</a>

View File

@@ -10,7 +10,7 @@
<div class="row justify-content-center mb-2">
<div class="col text-center">
<a asp-controller="Home" asp-action="Index">
<a asp-controller="UIHome" asp-action="Index">
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="mb-4" height="70" asp-append-version="true"/>
</a>

Some files were not shown because too many files have changed in this diff Show More