diff --git a/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml b/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml index 37530f946..9a7c63ae5 100644 --- a/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml +++ b/BTCPayServer.Plugins.Test/Views/Shared/TestExtensionNavExtension.cshtml @@ -1,2 +1,2 @@ - + diff --git a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs index 5e7598f76..8167d685c 100644 --- a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs +++ b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs @@ -69,7 +69,7 @@ namespace BTCPayServer.Tests Assert.Equal(3, invoice.CryptoInfo.Length); - var controller = user.GetController(); + var controller = user.GetController(); var lightningVm = (LightningNodeViewModel)Assert.IsType(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(); + var wallet = tester.PayTester.GetController(); 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(null); + var controller = tester.PayTester.GetController(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(null); + var controller = tester.PayTester.GetController(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(null); + controller = tester.PayTester.GetController(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(); + var apps = user.GetController(); var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model); vm.AppName = "test"; vm.SelectedAppType = AppType.PointOfSale.ToString(); @@ -639,7 +639,7 @@ donation: .IsType(apps.UpdatePointOfSale(app.Id)).Model); Assert.Equal("hello", vmpos.Title); - var publicApps = user.GetController(); + var publicApps = user.GetController(); var vmview = Assert.IsType(Assert .IsType(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model); @@ -673,7 +673,7 @@ donation: // testing custom amount var action = Assert.IsType(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(apps.UpdatePointOfSale(app.Id, vmpos).Result); - publicApps = user.GetController(); + publicApps = user.GetController(); vmview = Assert.IsType(Assert .IsType(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(user.UserId, user.StoreId); + var controller = tester.PayTester.GetController(user.UserId, user.StoreId); var appService = tester.PayTester.GetService(); var eventAggregator = tester.PayTester.GetService(); Assert.IsType(await controller.ChangeInvoiceState(inventoryItemInvoice.Id, "invalid")); diff --git a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs index 39bf31e29..bf48dc56f 100644 --- a/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs +++ b/BTCPayServer.Tests/AltcoinTests/ElementsTests.cs @@ -40,7 +40,7 @@ namespace BTCPayServer.Tests user.RegisterDerivationScheme("BTC"); user.RegisterDerivationScheme("USDT"); - Assert.Equal(3, Assert.IsType(Assert.IsType(await user.GetController().ListWallets()).Model).Wallets.Count); + Assert.Equal(3, Assert.IsType(Assert.IsType(await user.GetController().ListWallets()).Model).Wallets.Count); } } diff --git a/BTCPayServer.Tests/CrowdfundTests.cs b/BTCPayServer.Tests/CrowdfundTests.cs index 98fa79c7c..0f6454579 100644 --- a/BTCPayServer.Tests/CrowdfundTests.cs +++ b/BTCPayServer.Tests/CrowdfundTests.cs @@ -33,8 +33,8 @@ namespace BTCPayServer.Tests await user.GrantAccessAsync(); var user2 = tester.NewAccount(); await user2.GrantAccessAsync(); - var apps = user.GetController(); - var apps2 = user2.GetController(); + var apps = user.GetController(); + var apps2 = user2.GetController(); var vm = Assert.IsType(Assert.IsType(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(); + var apps = user.GetController(); var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model); vm.AppName = "test"; vm.SelectedAppType = AppType.Crowdfund.ToString(); @@ -90,8 +90,8 @@ namespace BTCPayServer.Tests Assert.IsType(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result); - var anonAppPubsController = tester.PayTester.GetController(); - var publicApps = user.GetController(); + var anonAppPubsController = tester.PayTester.GetController(); + var publicApps = user.GetController(); Assert.IsType(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(); + var apps = user.GetController(); var vm = Assert.IsType(Assert.IsType(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(apps.UpdateCrowdfund(app.Id, crowdfundViewModel, "save").Result); - var anonAppPubsController = tester.PayTester.GetController(); - var publicApps = user.GetController(); + var anonAppPubsController = tester.PayTester.GetController(); + var publicApps = user.GetController(); var model = Assert.IsType(Assert .IsType(publicApps.ViewCrowdfund(app.Id, String.Empty).Result).Model); diff --git a/BTCPayServer.Tests/FastTests.cs b/BTCPayServer.Tests/FastTests.cs index cbda65097..fda520e03 100644 --- a/BTCPayServer.Tests/FastTests.cs +++ b/BTCPayServer.Tests/FastTests.cs @@ -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] diff --git a/BTCPayServer.Tests/GreenfieldAPITests.cs b/BTCPayServer.Tests/GreenfieldAPITests.cs index aa63f320d..386e18295 100644 --- a/BTCPayServer.Tests/GreenfieldAPITests.cs +++ b/BTCPayServer.Tests/GreenfieldAPITests.cs @@ -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(Assert.IsType(await user.GetController() + var invoiceId = Assert.IsType(Assert.IsType(await user.GetController() .PayPaymentRequest(paymentTestPaymentRequest.Id, false)).Value); var invoice = user.BitPay.GetInvoice(invoiceId); await tester.WaitForEvent(async () => @@ -1332,7 +1332,7 @@ namespace BTCPayServer.Tests } }); Assert.EndsWith($"/i/{newInvoice.Id}", newInvoice.CheckoutLink); - var controller = tester.PayTester.GetController(user.UserId, user.StoreId); + var controller = tester.PayTester.GetController(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); diff --git a/BTCPayServer.Tests/POSTests.cs b/BTCPayServer.Tests/POSTests.cs index 34d8817fd..603345419 100644 --- a/BTCPayServer.Tests/POSTests.cs +++ b/BTCPayServer.Tests/POSTests.cs @@ -28,7 +28,7 @@ namespace BTCPayServer.Tests var user = tester.NewAccount(); await user.GrantAccessAsync(); user.RegisterDerivationScheme("BTC"); - var apps = user.GetController(); + var apps = user.GetController(); var vm = Assert.IsType(Assert.IsType(apps.CreateApp(user.StoreId)).Model); vm.AppName = "test"; vm.SelectedAppType = AppType.PointOfSale.ToString(); @@ -52,7 +52,7 @@ donation: Assert.IsType(apps.UpdatePointOfSale(app.Id, vmpos).Result); vmpos = Assert.IsType(Assert .IsType(apps.UpdatePointOfSale(app.Id)).Model); - var publicApps = user.GetController(); + var publicApps = user.GetController(); var vmview = Assert.IsType(Assert .IsType(publicApps.ViewPointOfSale(app.Id, PosViewType.Cart).Result).Model); diff --git a/BTCPayServer.Tests/PSBTTests.cs b/BTCPayServer.Tests/PSBTTests.cs index bc594bc38..e240753d9 100644 --- a/BTCPayServer.Tests/PSBTTests.cs +++ b/BTCPayServer.Tests/PSBTTests.cs @@ -47,7 +47,7 @@ namespace BTCPayServer.Tests Assert.Equal("paid", invoice.Status); }); - var walletController = user.GetController(); + var walletController = user.GetController(); var walletId = new WalletId(user.StoreId, "BTC"); var sendDestination = new Key().PubKey.Hash.GetAddress(user.SupportedNetwork.NBitcoinNetwork).ToString(); var sendModel = new WalletSendModel() diff --git a/BTCPayServer.Tests/PayJoinTests.cs b/BTCPayServer.Tests/PayJoinTests.cs index c6c64527d..f2f599f1a 100644 --- a/BTCPayServer.Tests/PayJoinTests.cs +++ b/BTCPayServer.Tests/PayJoinTests.cs @@ -469,7 +469,7 @@ namespace BTCPayServer.Tests changeIndex = i; } - var derivationSchemeSettings = alice.GetController().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC")); + var derivationSchemeSettings = alice.GetController().GetDerivationSchemeSettings(new WalletId(alice.StoreId, "BTC")); var signingAccount = derivationSchemeSettings.GetSigningAccountKeySettings(); psbt.SignAll(derivationSchemeSettings.AccountDerivation, alice.GenerateWalletResponseV.AccountHDKey, signingAccount.GetRootedKeyPath()); using var fakeServer = new FakeServer(); diff --git a/BTCPayServer.Tests/PaymentRequestTests.cs b/BTCPayServer.Tests/PaymentRequestTests.cs index 265a0afab..8c1746b7b 100644 --- a/BTCPayServer.Tests/PaymentRequestTests.cs +++ b/BTCPayServer.Tests/PaymentRequestTests.cs @@ -35,8 +35,8 @@ namespace BTCPayServer.Tests await user2.GrantAccessAsync(); - var paymentRequestController = user.GetController(); - var guestpaymentRequestController = user2.GetController(); + var paymentRequestController = user.GetController(); + var guestpaymentRequestController = user2.GetController(); var request = new UpdatePaymentRequestViewModel { @@ -104,7 +104,7 @@ namespace BTCPayServer.Tests await user.GrantAccessAsync(); user.RegisterDerivationScheme("BTC"); - var paymentRequestController = user.GetController(); + var paymentRequestController = user.GetController(); Assert.IsType( 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(); + var paymentRequestController = user.GetController(); Assert.IsType(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); diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 100ec9cb4..24e166302 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -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); diff --git a/BTCPayServer.Tests/TestAccount.cs b/BTCPayServer.Tests/TestAccount.cs index 0abe095b5..275665494 100644 --- a/BTCPayServer.Tests/TestAccount.cs +++ b/BTCPayServer.Tests/TestAccount.cs @@ -70,9 +70,9 @@ namespace BTCPayServer.Tests public async Task CreateClient(params string[] permissions) { - var manageController = parent.PayTester.GetController(UserId, StoreId, IsAdmin); + var manageController = parent.PayTester.GetController(UserId, StoreId, IsAdmin); var x = Assert.IsType(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(); + var store = GetController(); var pairingCode = BitPay.RequestClientAuthorization("test", Facade.Merchant); Assert.IsType(await store.RequestPairing(pairingCode.ToString())); await store.Pair(pairingCode.ToString(), StoreId); @@ -135,7 +135,7 @@ namespace BTCPayServer.Tests public async Task ModifyPayment(Action modify) { - var storeController = GetController(); + var storeController = GetController(); var response = storeController.PaymentMethods(); PaymentMethodsViewModel paymentMethods = (PaymentMethodsViewModel)((ViewResult)response).Model; modify(paymentMethods); @@ -144,7 +144,7 @@ namespace BTCPayServer.Tests public async Task ModifyWalletSettings(Action modify) { - var storeController = GetController(); + var storeController = GetController(); 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 modify) { - var storeController = GetController(); + var storeController = GetController(); 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(); + var store = GetController(); 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(cryptoCode); - var store = parent.PayTester.GetController(UserId, StoreId, true); + var store = parent.PayTester.GetController(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(); + var account = parent.PayTester.GetController(); 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(); + var storeController = GetController(); 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(); + var storeController = GetController(); var vm = new LightningNodeViewModel { ConnectionString = "", LightningNodeType = LightningNodeType.Internal, SkipPortTest = true }; await storeController.SetupLightningNode(storeId ?? StoreId, vm, "save", cryptoCode); diff --git a/BTCPayServer.Tests/ThirdPartyTests.cs b/BTCPayServer.Tests/ThirdPartyTests.cs index 484461a6d..49fc997cd 100644 --- a/BTCPayServer.Tests/ThirdPartyTests.cs +++ b/BTCPayServer.Tests/ThirdPartyTests.cs @@ -42,7 +42,7 @@ namespace BTCPayServer.Tests await tester.StartAsync(); var user = tester.NewAccount(); user.GrantAccess(); - var controller = tester.PayTester.GetController(user.UserId, user.StoreId); + var controller = tester.PayTester.GetController(user.UserId, user.StoreId); var azureBlobStorageConfiguration = Assert.IsType(Assert .IsType(await controller.StorageProvider(StorageProvider.AzureBlobStorage.ToString())) .Model); @@ -362,7 +362,7 @@ namespace BTCPayServer.Tests private static async Task CreateInvoice(ServerTester tester, TestAccount user, string exchange, string currency = "USD") { - var storeController = user.GetController(); + var storeController = user.GetController(); var vm = (RatesViewModel)((ViewResult)storeController.Rates()).Model; vm.PreferredExchange = exchange; await storeController.Rates(vm); diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index bd2922f8e..fe83b3744 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -140,7 +140,7 @@ namespace BTCPayServer.Tests var acc = tester.NewAccount(); var sresp = Assert - .IsType(await tester.PayTester.GetController(acc.UserId, acc.StoreId) + .IsType(await tester.PayTester.GetController(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(await tester.PayTester.GetController(acc.UserId, acc.StoreId) + .IsType(await tester.PayTester.GetController(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(); + var stores = user.GetController(); var response = stores.PaymentMethods(); var vm = Assert.IsType(Assert.IsType(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(); + var storeController = user.GetController(); var storeResponse = storeController.PaymentMethods(); Assert.IsType(storeResponse); Assert.IsType(await storeController.SetupLightningNode(user.StoreId, "BTC")); @@ -538,7 +538,7 @@ namespace BTCPayServer.Tests acc.Register(); acc.CreateStore(); - var controller = acc.GetController(); + var controller = acc.GetController(); 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(); + var store = acc.GetController(); var pairingCode = acc.BitPay.RequestClientAuthorization("test", Facade.Merchant); Assert.IsType(store.Pair(pairingCode.ToString(), acc.StoreId).GetAwaiter() .GetResult()); pairingCode = acc.BitPay.RequestClientAuthorization("test1", Facade.Merchant); acc.CreateStore(); - var store2 = acc.GetController(); + var store2 = acc.GetController(); 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(); + var walletController = acc.GetController(); var walletId = new WalletId(acc.StoreId, "BTC"); acc.IsAdmin = true; - walletController = acc.GetController(); + walletController = acc.GetController(); var rescan = Assert.IsType(Assert @@ -857,7 +857,7 @@ namespace BTCPayServer.Tests acc.RegisterDerivationScheme("BTC"); const string newVersion = "1.0.4.4"; - var ctrl = acc.GetController(); + var ctrl = acc.GetController(); var resp = await ctrl.Generate(newVersion); var vm = Assert.IsType( @@ -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(); + var store = acc.GetController(); var ratesVM = (RatesViewModel)(Assert.IsType(store.Rates()).Model); ratesVM.DefaultCurrencyPairs = "BTC_USD,LTC_USD"; await store.Rates(ratesVM); - store = acc.GetController(); + store = acc.GetController(); rateController = acc.GetController(); GetRatesResult = JObject.Parse(((JsonResult)rateController.GetRates(null, default) .GetAwaiter().GetResult()).Value.ToJson()).ToObject>(); @@ -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() + (InvoicesModel)((ViewResult)acc.GetController() .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( - Assert.IsType(await user.GetController().Invoice(invoice.Id)).Model) + Assert.IsType(await user.GetController().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(); + var storeController = user.GetController(); 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(); Assert.Empty(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult()); - Assert.IsType(user.GetController() + Assert.IsType(user.GetController() .GenerateAPIKey(user.StoreId).GetAwaiter().GetResult()); var apiKey = Assert.Single(repo.GetLegacyAPIKeys(user.StoreId).GetAwaiter().GetResult()); /////// // Generating a new one remove the previous - Assert.IsType(user.GetController() + Assert.IsType(user.GetController() .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(); + var storeController = user.GetController(); 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(); + var store = user.GetController(); var rateVm = Assert.IsType(Assert.IsType(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(); + store = user.GetController(); rateVm = Assert.IsType(Assert.IsType(await store.Rates(rateVm, "Test")) .Model); Assert.NotNull(rateVm.TestRateRules); @@ -1466,7 +1466,7 @@ namespace BTCPayServer.Tests Assert.IsType(store.ShowRateRulesPost(true).Result); Assert.IsType(await store.Rates(rateVm, "Save")); - store = user.GetController(); + store = user.GetController(); rateVm = Assert.IsType(Assert.IsType(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(await store.Rates(rateVm, "Save")); - store = user.GetController(); + store = user.GetController(); rateVm = Assert.IsType(Assert.IsType(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(); + var controller = user.GetController(); var model = await controller.CreateInvoice(); (await controller.CreateInvoice(new CreateInvoiceModel(), default)).AssertType(); 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(); + var walletController = user.GetController(); var walletSend = await walletController.WalletSend(new WalletId(user.StoreId, "BTC")).AssertViewModelAsync(); 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(Assert - .IsType(user.GetController().CheckoutAppearance()).Model); + .IsType(user.GetController().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(user.GetController().CheckoutAppearance(vm) + Assert.IsType(user.GetController().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(Assert - .IsType(user.GetController().CheckoutAppearance()).Model); + .IsType(user.GetController().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(user.GetController().CheckoutAppearance(vm) + Assert.IsType(user.GetController().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().Checkout(invoice.Id)).AssertViewModel(); + var checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel(); Assert.Equal(lnMethod, checkout.PaymentMethodId); // If we change store's default, it should change the checkout's default vm.DefaultPaymentMethod = btcMethod; - Assert.IsType(user.GetController().CheckoutAppearance(vm) + Assert.IsType(user.GetController().CheckoutAppearance(vm) .Result); - checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel(); + checkout = (await user.GetController().Checkout(invoice.Id)).AssertViewModel(); 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().Checkout(invoice.Id); + var res = await user.GetController().Checkout(invoice.Id); var paymentMethodFirst = Assert.IsType( Assert.IsType(res).Model ); @@ -1649,15 +1649,15 @@ namespace BTCPayServer.Tests // enable unified QR code in settings var vm = Assert.IsType(Assert - .IsType(await user.GetController().LightningSettings(user.StoreId, cryptoCode)).Model + .IsType(await user.GetController().LightningSettings(user.StoreId, cryptoCode)).Model ); vm.OnChainWithLnInvoiceFallback = true; Assert.IsType( - user.GetController().LightningSettings(vm).Result + user.GetController().LightningSettings(vm).Result ); // validate that QR code now has both onchain and offchain payment urls - res = await user.GetController().Checkout(invoice.Id); + res = await user.GetController().Checkout(invoice.Id); var paymentMethodSecond = Assert.IsType( Assert.IsType(res).Model ); @@ -1689,12 +1689,12 @@ namespace BTCPayServer.Tests var cryptoCode = "BTC"; user.GrantAccess(true); user.RegisterLightningNode(cryptoCode, LightningConnectionType.Charge); - var vm = user.GetController().CheckoutAppearance().AssertViewModel(); + var vm = user.GetController().CheckoutAppearance().AssertViewModel(); 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(user.GetController().CheckoutAppearance(vm) + Assert.IsType(user.GetController().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().LightningSettings(user.StoreId, cryptoCode).AssertViewModelAsync(); + var lnSettingsVm = await user.GetController().LightningSettings(user.StoreId, cryptoCode).AssertViewModelAsync(); lnSettingsVm.LNURLEnabled = true; lnSettingsVm.LNURLStandardInvoiceEnabled = true; - Assert.IsType(user.GetController().LightningSettings(lnSettingsVm).Result); - vm = user.GetController().CheckoutAppearance().AssertViewModel(); + Assert.IsType(user.GetController().LightningSettings(lnSettingsVm).Result); + vm = user.GetController().CheckoutAppearance().AssertViewModel(); criteria = Assert.Single(vm.PaymentMethodCriteria); Assert.Equal(new PaymentMethodId(cryptoCode, LightningPaymentType.Instance).ToString(), criteria.PaymentMethod); - Assert.IsType(user.GetController().CheckoutAppearance(vm).Result); + Assert.IsType(user.GetController().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(null); + var controller = tester.PayTester.GetController(null); var testCases = new List<(string input, Dictionary 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().Export("json").GetAwaiter().GetResult(); + var jsonResult = user.GetController().Export("json").GetAwaiter().GetResult(); var result = Assert.IsType(jsonResult); Assert.Equal("application/json", result.ContentType); Assert.Equal("[]", result.Content); @@ -1842,7 +1842,7 @@ namespace BTCPayServer.Tests TestUtils.Eventually(() => { var jsonResultPaid = - user.GetController().Export("json").GetAwaiter().GetResult(); + user.GetController().Export("json").GetAwaiter().GetResult(); var paidresult = Assert.IsType(jsonResultPaid); Assert.Equal("application/json", paidresult.ContentType); @@ -1986,7 +1986,7 @@ namespace BTCPayServer.Tests TestUtils.Eventually(() => { var exportResultPaid = - user.GetController().Export("csv").GetAwaiter().GetResult(); + user.GetController().Export("csv").GetAwaiter().GetResult(); var paidresult = Assert.IsType(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(); - var apps2 = user2.GetController(); + var apps = user.GetController(); + var apps2 = user2.GetController(); var vm = Assert.IsType(Assert.IsType(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(); + var serverController = user.GetController(); var vm = Assert.IsType( Assert.IsType(await serverController.LogsView()).Model); } @@ -2364,17 +2364,17 @@ namespace BTCPayServer.Tests var user = tester.NewAccount(); user.GrantAccess(); - var accountController = tester.PayTester.GetController(); + var accountController = tester.PayTester.GetController(); //no 2fa or fido2 enabled, login should work - Assert.Equal(nameof(HomeController.Index), + Assert.Equal(nameof(UIHomeController.Index), Assert.IsType(await accountController.Login(new LoginViewModel() { Email = user.RegisterDetails.Email, Password = user.RegisterDetails.Password })).ActionName); - var listController = user.GetController(); + var listController = user.GetController(); var manageController = user.GetController(); //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(); + var ctrl = acc.GetController(); var newVersion = MockVersionFetcher.MOCK_NEW_VERSION; var vm = Assert.IsType( @@ -2715,7 +2715,7 @@ namespace BTCPayServer.Tests Assert.Equal("admin@admin.com", (await Assert.IsType(await emailSenderFactory.GetEmailSender()).GetEmailSettings()).Login); Assert.Null(await Assert.IsType(await emailSenderFactory.GetEmailSender(acc.StoreId)).GetEmailSettings()); - Assert.IsType(await acc.GetController().Emails(acc.StoreId, new EmailsViewModel(new EmailSettings() + Assert.IsType(await acc.GetController().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(user.UserId, user.StoreId); + var controller = tester.PayTester.GetController(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(user.UserId, user.StoreId); + var controller = tester.PayTester.GetController(user.UserId, user.StoreId); var fileSystemStorageConfiguration = Assert.IsType(Assert .IsType(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 fileList = new List(); @@ -2868,11 +2868,11 @@ namespace BTCPayServer.Tests //create a temporary link to file var tmpLinkGenerate = Assert.IsType(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); diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 663b529b4..6eb799fe4 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -20,13 +20,13 @@ - + false - + false - + false @@ -39,7 +39,7 @@ - + @@ -148,83 +148,83 @@ - + PreserveNewest $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) - + $(IncludeRazorContentInPack) diff --git a/BTCPayServer/Components/MainNav/Default.cshtml b/BTCPayServer/Components/MainNav/Default.cshtml index d8a4924c7..94d269d16 100644 --- a/BTCPayServer/Components/MainNav/Default.cshtml +++ b/BTCPayServer/Components/MainNav/Default.cshtml @@ -29,13 +29,13 @@
diff --git a/BTCPayServer/Controllers/BitpayInvoiceController.cs b/BTCPayServer/Controllers/BitpayInvoiceController.cs index 0affe1e93..c389faa3b 100644 --- a/BTCPayServer/Controllers/BitpayInvoiceController.cs +++ b/BTCPayServer/Controllers/BitpayInvoiceController.cs @@ -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; diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs index 1f5dc272a..9ae511319 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldInvoiceController.cs @@ -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) { diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldPullPaymentController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldPullPaymentController.cs index 37b6b168d..4aef72365 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldPullPaymentController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldPullPaymentController.cs @@ -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, diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldStoreOnChainWalletsController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldStoreOnChainWalletsController.cs index 96be0ba35..751837ef6 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldStoreOnChainWalletsController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldStoreOnChainWalletsController.cs @@ -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, diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldStoreWebhooksController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldStoreWebhooksController.cs index f497e7792..129b1ba2f 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldStoreWebhooksController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldStoreWebhooksController.cs @@ -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 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")] diff --git a/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs b/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs index fce28fcd7..2b02a157c 100644 --- a/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs +++ b/BTCPayServer/Controllers/GreenField/LocalBTCPayServerClient.cs @@ -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"), "", "") { diff --git a/BTCPayServer/Controllers/AccountController.cs b/BTCPayServer/Controllers/UIAccountController.cs similarity index 98% rename from BTCPayServer/Controllers/AccountController.cs rename to BTCPayServer/Controllers/UIAccountController.cs index 02462bf20..78ac68c08 100644 --- a/BTCPayServer/Controllers/AccountController.cs +++ b/BTCPayServer/Controllers/UIAccountController.cs @@ -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 _userManager; private readonly SignInManager _signInManager; @@ -39,7 +39,7 @@ namespace BTCPayServer.Controllers public Logs Logs { get; } - public AccountController( + public UIAccountController( UserManager userManager, RoleManager roleManager, SignInManager signInManager, @@ -432,7 +432,7 @@ namespace BTCPayServer.Controllers } var policies = await _SettingsRepository.GetSettingAsync() ?? 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() ?? 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"); } } diff --git a/BTCPayServer/Controllers/AppsController.Crowdfund.cs b/BTCPayServer/Controllers/UIAppsController.Crowdfund.cs similarity index 99% rename from BTCPayServer/Controllers/AppsController.Crowdfund.cs rename to BTCPayServer/Controllers/UIAppsController.Crowdfund.cs index 3d417bde8..0688bc849 100644 --- a/BTCPayServer/Controllers/AppsController.Crowdfund.cs +++ b/BTCPayServer/Controllers/UIAppsController.Crowdfund.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Mvc; namespace BTCPayServer.Controllers { - public partial class AppsController + public partial class UIAppsController { public class AppUpdated { diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/UIAppsController.PointOfSale.cs similarity index 99% rename from BTCPayServer/Controllers/AppsController.PointOfSale.cs rename to BTCPayServer/Controllers/UIAppsController.PointOfSale.cs index f85f94e60..bf652f2a7 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/UIAppsController.PointOfSale.cs @@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Mvc; namespace BTCPayServer.Controllers { - public partial class AppsController + public partial class UIAppsController { public class PointOfSaleSettings { diff --git a/BTCPayServer/Controllers/AppsController.cs b/BTCPayServer/Controllers/UIAppsController.cs similarity index 98% rename from BTCPayServer/Controllers/AppsController.cs rename to BTCPayServer/Controllers/UIAppsController.cs index 6b501e92b..678c14b0f 100644 --- a/BTCPayServer/Controllers/AppsController.cs +++ b/BTCPayServer/Controllers/UIAppsController.cs @@ -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 userManager, EventAggregator eventAggregator, CurrencyNameTable currencies, diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/UIAppsPublicController.cs similarity index 97% rename from BTCPayServer/Controllers/AppsPublicController.cs rename to BTCPayServer/Controllers/UIAppsPublicController.cs index f631a902a..f1a0a4fbc 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/UIAppsPublicController.cs @@ -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 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 _UserManager; [HttpGet("/apps/{appId}")] @@ -236,7 +236,7 @@ namespace BTCPayServer.Controllers }, store, HttpContext.Request.GetAbsoluteRoot(), new List() { 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 diff --git a/BTCPayServer/Controllers/ErrorController.cs b/BTCPayServer/Controllers/UIErrorController.cs similarity index 94% rename from BTCPayServer/Controllers/ErrorController.cs rename to BTCPayServer/Controllers/UIErrorController.cs index 8fcdc00f2..7eb250b2c 100644 --- a/BTCPayServer/Controllers/ErrorController.cs +++ b/BTCPayServer/Controllers/UIErrorController.cs @@ -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) diff --git a/BTCPayServer/Controllers/HomeController.cs b/BTCPayServer/Controllers/UIHomeController.cs similarity index 96% rename from BTCPayServer/Controllers/HomeController.cs rename to BTCPayServer/Controllers/UIHomeController.cs index 53a9f2286..26cbec145 100644 --- a/BTCPayServer/Controllers/HomeController.cs +++ b/BTCPayServer/Controllers/UIHomeController.cs @@ -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 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)) diff --git a/BTCPayServer/Controllers/InvoiceController.Testing.cs b/BTCPayServer/Controllers/UIInvoiceController.Testing.cs similarity index 98% rename from BTCPayServer/Controllers/InvoiceController.Testing.cs rename to BTCPayServer/Controllers/UIInvoiceController.Testing.cs index 57595b5f9..b7a94d5d5 100644 --- a/BTCPayServer/Controllers/InvoiceController.Testing.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.Testing.cs @@ -10,7 +10,7 @@ using NBitcoin; namespace BTCPayServer.Controllers { - public partial class InvoiceController + public partial class UIInvoiceController { public class FakePaymentRequest { diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs similarity index 98% rename from BTCPayServer/Controllers/InvoiceController.UI.cs rename to BTCPayServer/Controllers/UIInvoiceController.UI.cs index d05aff47f..bc8611e8a 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -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 set up a payment method first", + Html = $"To create an invoice, you need to set up a payment method first", AllowDismiss = false }); return View(model); diff --git a/BTCPayServer/Controllers/InvoiceController.cs b/BTCPayServer/Controllers/UIInvoiceController.cs similarity index 99% rename from BTCPayServer/Controllers/InvoiceController.cs rename to BTCPayServer/Controllers/UIInvoiceController.cs index e9bfd5d58..adb8e2b51 100644 --- a/BTCPayServer/Controllers/InvoiceController.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.cs @@ -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 userManager, diff --git a/BTCPayServer/LNURL/LNURLController.cs b/BTCPayServer/Controllers/UILNURLController.cs similarity index 98% rename from BTCPayServer/LNURL/LNURLController.cs rename to BTCPayServer/Controllers/UILNURLController.cs index 9de779409..5fa81f82a 100644 --- a/BTCPayServer/LNURL/LNURLController.cs +++ b/BTCPayServer/Controllers/UILNURLController.cs @@ -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(); + var posS = app.GetSettings(); 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() ?? new LightningAddressSettings(); diff --git a/BTCPayServer/Controllers/ManageController.2FA.cs b/BTCPayServer/Controllers/UIManageController.2FA.cs similarity index 99% rename from BTCPayServer/Controllers/ManageController.2FA.cs rename to BTCPayServer/Controllers/UIManageController.2FA.cs index c5eb7d865..4500573ac 100644 --- a/BTCPayServer/Controllers/ManageController.2FA.cs +++ b/BTCPayServer/Controllers/UIManageController.2FA.cs @@ -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"; diff --git a/BTCPayServer/Controllers/ManageController.APIKeys.cs b/BTCPayServer/Controllers/UIManageController.APIKeys.cs similarity index 99% rename from BTCPayServer/Controllers/ManageController.APIKeys.cs rename to BTCPayServer/Controllers/UIManageController.APIKeys.cs index fba6c9d8a..0d4471156 100644 --- a/BTCPayServer/Controllers/ManageController.APIKeys.cs +++ b/BTCPayServer/Controllers/UIManageController.APIKeys.cs @@ -16,7 +16,7 @@ using NBitcoin.DataEncoders; namespace BTCPayServer.Controllers { - public partial class ManageController + public partial class UIManageController { [HttpGet] public async Task APIKeys() diff --git a/BTCPayServer/Controllers/ManageController.LoginCodes.cs b/BTCPayServer/Controllers/UIManageController.LoginCodes.cs similarity index 92% rename from BTCPayServer/Controllers/ManageController.LoginCodes.cs rename to BTCPayServer/Controllers/UIManageController.LoginCodes.cs index 71104a49b..655085a81 100644 --- a/BTCPayServer/Controllers/ManageController.LoginCodes.cs +++ b/BTCPayServer/Controllers/UIManageController.LoginCodes.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc; namespace BTCPayServer.Controllers { - public partial class ManageController + public partial class UIManageController { [HttpGet] public async Task LoginCodes() diff --git a/BTCPayServer/Controllers/ManageController.Notifications.cs b/BTCPayServer/Controllers/UIManageController.Notifications.cs similarity index 98% rename from BTCPayServer/Controllers/ManageController.Notifications.cs rename to BTCPayServer/Controllers/UIManageController.Notifications.cs index 79bcc4b8c..12aca90ad 100644 --- a/BTCPayServer/Controllers/ManageController.Notifications.cs +++ b/BTCPayServer/Controllers/UIManageController.Notifications.cs @@ -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 NotificationSettings([FromServices] IEnumerable notificationHandlers) diff --git a/BTCPayServer/Controllers/ManageController.cs b/BTCPayServer/Controllers/UIManageController.cs similarity index 97% rename from BTCPayServer/Controllers/ManageController.cs rename to BTCPayServer/Controllers/UIManageController.cs index 4575e628a..aa76fd2a9 100644 --- a/BTCPayServer/Controllers/ManageController.cs +++ b/BTCPayServer/Controllers/UIManageController.cs @@ -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 _userManager; private readonly SignInManager _signInManager; @@ -40,11 +40,11 @@ namespace BTCPayServer.Controllers private readonly UserService _userService; readonly StoreRepository _StoreRepository; - public ManageController( + public UIManageController( UserManager userManager, SignInManager signInManager, EmailSenderFactory emailSenderFactory, - ILogger logger, + ILogger 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"); } diff --git a/BTCPayServer/Controllers/NotificationsController.cs b/BTCPayServer/Controllers/UINotificationsController.cs similarity index 97% rename from BTCPayServer/Controllers/NotificationsController.cs rename to BTCPayServer/Controllers/UINotificationsController.cs index 789cdaba7..cb6bd3629 100644 --- a/BTCPayServer/Controllers/NotificationsController.cs +++ b/BTCPayServer/Controllers/UINotificationsController.cs @@ -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 userManager, NotificationManager notificationManager, @@ -106,7 +106,7 @@ namespace BTCPayServer.Controllers public async Task 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() { diff --git a/BTCPayServer/Controllers/PaymentRequestController.cs b/BTCPayServer/Controllers/UIPaymentRequestController.cs similarity index 97% rename from BTCPayServer/Controllers/PaymentRequestController.cs rename to BTCPayServer/Controllers/UIPaymentRequestController.cs index 5e48ace3e..8e681e6d2 100644 --- a/BTCPayServer/Controllers/PaymentRequestController.cs +++ b/BTCPayServer/Controllers/UIPaymentRequestController.cs @@ -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 _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 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); diff --git a/BTCPayServer/Controllers/PublicController.cs b/BTCPayServer/Controllers/UIPublicController.cs similarity index 95% rename from BTCPayServer/Controllers/PublicController.cs rename to BTCPayServer/Controllers/UIPublicController.cs index 488c2ec11..3b5c6b68a 100644 --- a/BTCPayServer/Controllers/PublicController.cs +++ b/BTCPayServer/Controllers/UIPublicController.cs @@ -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] diff --git a/BTCPayServer/Controllers/PublicLightningNodeInfoController.cs b/BTCPayServer/Controllers/UIPublicLightningNodeInfoController.cs similarity index 96% rename from BTCPayServer/Controllers/PublicLightningNodeInfoController.cs rename to BTCPayServer/Controllers/UIPublicLightningNodeInfoController.cs index 71ddca35e..b7201fe45 100644 --- a/BTCPayServer/Controllers/PublicLightningNodeInfoController.cs +++ b/BTCPayServer/Controllers/UIPublicLightningNodeInfoController.cs @@ -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; diff --git a/BTCPayServer/Controllers/PullPaymentController.cs b/BTCPayServer/Controllers/UIPullPaymentController.cs similarity index 98% rename from BTCPayServer/Controllers/PullPaymentController.cs rename to BTCPayServer/Controllers/UIPullPaymentController.cs index 773f1fa2c..64c26e9be 100644 --- a/BTCPayServer/Controllers/PullPaymentController.cs +++ b/BTCPayServer/Controllers/UIPullPaymentController.cs @@ -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 _payoutHandlers; - public PullPaymentController(ApplicationDbContextFactory dbContextFactory, + public UIPullPaymentController(ApplicationDbContextFactory dbContextFactory, BTCPayNetworkProvider networkProvider, CurrencyNameTable currencyNameTable, PullPaymentHostedService pullPaymentHostedService, diff --git a/BTCPayServer/Controllers/ServerController.Plugins.cs b/BTCPayServer/Controllers/UIServerController.Plugins.cs similarity index 99% rename from BTCPayServer/Controllers/ServerController.Plugins.cs rename to BTCPayServer/Controllers/UIServerController.Plugins.cs index 81cb1ec58..6788b630d 100644 --- a/BTCPayServer/Controllers/ServerController.Plugins.cs +++ b/BTCPayServer/Controllers/UIServerController.Plugins.cs @@ -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 ListPlugins( diff --git a/BTCPayServer/Controllers/ServerController.Storage.cs b/BTCPayServer/Controllers/UIServerController.Storage.cs similarity index 99% rename from BTCPayServer/Controllers/ServerController.Storage.cs rename to BTCPayServer/Controllers/UIServerController.Storage.cs index b32139c84..42770710b 100644 --- a/BTCPayServer/Controllers/ServerController.Storage.cs +++ b/BTCPayServer/Controllers/UIServerController.Storage.cs @@ -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 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() }); diff --git a/BTCPayServer/Controllers/ServerController.Users.cs b/BTCPayServer/Controllers/UIServerController.Users.cs similarity index 99% rename from BTCPayServer/Controllers/ServerController.Users.cs rename to BTCPayServer/Controllers/UIServerController.Users.cs index c52625526..1893e2773 100644 --- a/BTCPayServer/Controllers/ServerController.Users.cs +++ b/BTCPayServer/Controllers/UIServerController.Users.cs @@ -16,7 +16,7 @@ using Microsoft.EntityFrameworkCore; namespace BTCPayServer.Controllers { - public partial class ServerController + public partial class UIServerController { [Route("server/users")] public async Task ListUsers( diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/UIServerController.cs similarity index 99% rename from BTCPayServer/Controllers/ServerController.cs rename to BTCPayServer/Controllers/UIServerController.cs index 31e912cd3..2285011de 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/UIServerController.cs @@ -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 _UserManager; private readonly UserService _userService; @@ -61,7 +61,7 @@ namespace BTCPayServer.Controllers private readonly FileService _FileService; private readonly IEnumerable _StorageProviderServices; - public ServerController( + public UIServerController( UserManager userManager, UserService userService, StoredFileRepository storedFileRepository, diff --git a/BTCPayServer/Controllers/StorageController.cs b/BTCPayServer/Controllers/UIStorageController.cs similarity index 82% rename from BTCPayServer/Controllers/StorageController.cs rename to BTCPayServer/Controllers/UIStorageController.cs index 835baa45c..6ae747151 100644 --- a/BTCPayServer/Controllers/StorageController.cs +++ b/BTCPayServer/Controllers/UIStorageController.cs @@ -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; } diff --git a/BTCPayServer/Controllers/StorePullPaymentsController.PullPayments.cs b/BTCPayServer/Controllers/UIStorePullPaymentsController.PullPayments.cs similarity index 98% rename from BTCPayServer/Controllers/StorePullPaymentsController.PullPayments.cs rename to BTCPayServer/Controllers/UIStorePullPaymentsController.PullPayments.cs index 57b78e234..7ae4c3104 100644 --- a/BTCPayServer/Controllers/StorePullPaymentsController.PullPayments.cs +++ b/BTCPayServer/Controllers/UIStorePullPaymentsController.PullPayments.cs @@ -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 _payoutHandlers; @@ -44,7 +44,7 @@ namespace BTCPayServer.Controllers return HttpContext.GetStoreData(); } } - public StorePullPaymentsController(BTCPayNetworkProvider btcPayNetworkProvider, + public UIStorePullPaymentsController(BTCPayNetworkProvider btcPayNetworkProvider, IEnumerable 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 diff --git a/BTCPayServer/Controllers/StoresController.Email.cs b/BTCPayServer/Controllers/UIStoresController.Email.cs similarity index 98% rename from BTCPayServer/Controllers/StoresController.Email.cs rename to BTCPayServer/Controllers/UIStoresController.Email.cs index b9fbeb9ba..6ecaeb3fc 100644 --- a/BTCPayServer/Controllers/StoresController.Email.cs +++ b/BTCPayServer/Controllers/UIStoresController.Email.cs @@ -9,7 +9,7 @@ using MimeKit; namespace BTCPayServer.Controllers { - public partial class StoresController + public partial class UIStoresController { [Route("{storeId}/emails")] diff --git a/BTCPayServer/Controllers/StoresController.Integrations.cs b/BTCPayServer/Controllers/UIStoresController.Integrations.cs similarity index 99% rename from BTCPayServer/Controllers/StoresController.Integrations.cs rename to BTCPayServer/Controllers/UIStoresController.Integrations.cs index ed5d2cf19..f46ba076c 100644 --- a/BTCPayServer/Controllers/StoresController.Integrations.cs +++ b/BTCPayServer/Controllers/UIStoresController.Integrations.cs @@ -12,7 +12,7 @@ using NBitcoin.DataEncoders; namespace BTCPayServer.Controllers { - public partial class StoresController + public partial class UIStoresController { [HttpGet("{storeId}/integrations")] public IActionResult Integrations() diff --git a/BTCPayServer/Controllers/StoresController.LightningLike.cs b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs similarity index 99% rename from BTCPayServer/Controllers/StoresController.LightningLike.cs rename to BTCPayServer/Controllers/UIStoresController.LightningLike.cs index 2b1423547..edfc9b1f1 100644 --- a/BTCPayServer/Controllers/StoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs @@ -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 SetupLightningNode(string storeId, string cryptoCode) diff --git a/BTCPayServer/Controllers/StoresController.Onchain.cs b/BTCPayServer/Controllers/UIStoresController.Onchain.cs similarity index 99% rename from BTCPayServer/Controllers/StoresController.Onchain.cs rename to BTCPayServer/Controllers/UIStoresController.Onchain.cs index eaa12f1f1..fc9891659 100644 --- a/BTCPayServer/Controllers/StoresController.Onchain.cs +++ b/BTCPayServer/Controllers/UIStoresController.Onchain.cs @@ -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) diff --git a/BTCPayServer/Controllers/StoresController.cs b/BTCPayServer/Controllers/UIStoresController.cs similarity index 99% rename from BTCPayServer/Controllers/StoresController.cs rename to BTCPayServer/Controllers/UIStoresController.cs index f128c041a..31e69174b 100644 --- a/BTCPayServer/Controllers/StoresController.cs +++ b/BTCPayServer/Controllers/UIStoresController.cs @@ -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 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 { diff --git a/BTCPayServer/Controllers/UserStoresController.cs b/BTCPayServer/Controllers/UIUserStoresController.cs similarity index 91% rename from BTCPayServer/Controllers/UserStoresController.cs rename to BTCPayServer/Controllers/UIUserStoresController.cs index 03ba145ee..188580751 100644 --- a/BTCPayServer/Controllers/UserStoresController.cs +++ b/BTCPayServer/Controllers/UIUserStoresController.cs @@ -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 _userManager; - public UserStoresController( + public UIUserStoresController( UserManager 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); diff --git a/BTCPayServer/Controllers/VaultController.cs b/BTCPayServer/Controllers/UIVaultController.cs similarity index 99% rename from BTCPayServer/Controllers/VaultController.cs rename to BTCPayServer/Controllers/UIVaultController.cs index d2d39a448..73f0db864 100644 --- a/BTCPayServer/Controllers/VaultController.cs +++ b/BTCPayServer/Controllers/UIVaultController.cs @@ -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; diff --git a/BTCPayServer/Controllers/WalletsController.PSBT.cs b/BTCPayServer/Controllers/UIWalletsController.PSBT.cs similarity index 99% rename from BTCPayServer/Controllers/WalletsController.PSBT.cs rename to BTCPayServer/Controllers/UIWalletsController.PSBT.cs index ee12e3c8f..8e23247ee 100644 --- a/BTCPayServer/Controllers/WalletsController.PSBT.cs +++ b/BTCPayServer/Controllers/UIWalletsController.PSBT.cs @@ -20,7 +20,7 @@ using NBXplorer.Models; namespace BTCPayServer.Controllers { - public partial class WalletsController + public partial class UIWalletsController { [NonAction] diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/UIWalletsController.cs similarity index 99% rename from BTCPayServer/Controllers/WalletsController.cs rename to BTCPayServer/Controllers/UIWalletsController.cs index a0404dfad..55940ad85 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/UIWalletsController.cs @@ -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 _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 = { diff --git a/BTCPayServer/Data/Payouts/BitcoinLike/BitcoinLikePayoutHandler.cs b/BTCPayServer/Data/Payouts/BitcoinLike/BitcoinLikePayoutHandler.cs index 7af811ab8..401e6c012 100644 --- a/BTCPayServer/Data/Payouts/BitcoinLike/BitcoinLikePayoutHandler.cs +++ b/BTCPayServer/Data/Payouts/BitcoinLike/BitcoinLikePayoutHandler.cs @@ -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 diff --git a/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutHandler.cs b/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutHandler.cs index 0d1242664..baf4a0e84 100644 --- a/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutHandler.cs +++ b/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutHandler.cs @@ -165,7 +165,7 @@ namespace BTCPayServer.Data.Payouts.LightningLike public Task InitiatePayment(PaymentMethodId paymentMethodId, string[] payoutIds) { return Task.FromResult(new RedirectToActionResult("ConfirmLightningPayout", - "LightningLikePayout", new { cryptoCode = paymentMethodId.CryptoCode, payoutIds })); + "UILightningLikePayout", new { cryptoCode = paymentMethodId.CryptoCode, payoutIds })); } } } diff --git a/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutController.cs b/BTCPayServer/Data/Payouts/LightningLike/UILightningLikePayoutController.cs similarity index 98% rename from BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutController.cs rename to BTCPayServer/Data/Payouts/LightningLike/UILightningLikePayoutController.cs index ff01e35d5..f376fc845 100644 --- a/BTCPayServer/Data/Payouts/LightningLike/LightningLikePayoutController.cs +++ b/BTCPayServer/Data/Payouts/LightningLike/UILightningLikePayoutController.cs @@ -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 _userManager; @@ -34,7 +34,7 @@ namespace BTCPayServer.Data.Payouts.LightningLike private readonly IOptions _options; private readonly IAuthorizationService _authorizationService; - public LightningLikePayoutController(ApplicationDbContextFactory applicationDbContextFactory, + public UILightningLikePayoutController(ApplicationDbContextFactory applicationDbContextFactory, UserManager userManager, BTCPayNetworkJsonSerializerSettings btcPayNetworkJsonSerializerSettings, IEnumerable payoutHandlers, diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index 538d38e48..0aebb64b8 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -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 = { diff --git a/BTCPayServer/Extensions/UrlHelperExtensions.cs b/BTCPayServer/Extensions/UrlHelperExtensions.cs index ace01884b..d51394e09 100644 --- a/BTCPayServer/Extensions/UrlHelperExtensions.cs +++ b/BTCPayServer/Extensions/UrlHelperExtensions.cs @@ -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); } diff --git a/BTCPayServer/Fido2/Fido2Controller.cs b/BTCPayServer/Fido2/Fido2Controller.cs index 657bc60eb..adaff945b 100644 --- a/BTCPayServer/Fido2/Fido2Controller.cs +++ b/BTCPayServer/Fido2/Fido2Controller.cs @@ -90,7 +90,7 @@ namespace BTCPayServer.Fido2 private ActionResult RedirectToList() { - return RedirectToAction("TwoFactorAuthentication", "Manage"); + return RedirectToAction("TwoFactorAuthentication", "UIManage"); } } } diff --git a/BTCPayServer/HostedServices/AppInventoryUpdaterHostedService.cs b/BTCPayServer/HostedServices/AppInventoryUpdaterHostedService.cs index 4bfaf235d..c767aff18 100644 --- a/BTCPayServer/HostedServices/AppInventoryUpdaterHostedService.cs +++ b/BTCPayServer/HostedServices/AppInventoryUpdaterHostedService.cs @@ -37,7 +37,7 @@ namespace BTCPayServer.HostedServices switch (Enum.Parse(data.AppType)) { case AppType.PointOfSale: - var possettings = data.GetSettings(); + var possettings = data.GetSettings(); 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: diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index 56a69097d..d8f082132 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -382,9 +382,9 @@ namespace BTCPayServer.Hosting services.TryAddScoped(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); // Add application services. services.AddSingleton(); diff --git a/BTCPayServer/Hosting/MigrationStartupTask.cs b/BTCPayServer/Hosting/MigrationStartupTask.cs index 08ab77445..116140618 100644 --- a/BTCPayServer/Hosting/MigrationStartupTask.cs +++ b/BTCPayServer/Hosting/MigrationStartupTask.cs @@ -236,7 +236,7 @@ namespace BTCPayServer.Hosting case nameof(AppType.PointOfSale): - var settings2 = app.GetSettings(); + var settings2 = app.GetSettings(); if (string.IsNullOrEmpty(settings2.Currency)) { settings2.Currency = app.StoreData.GetStoreBlob().DefaultCurrency; diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index a49946ead..d1f42f969 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -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(); } diff --git a/BTCPayServer/PaymentRequest/PaymentRequestHub.cs b/BTCPayServer/PaymentRequest/PaymentRequestHub.cs index 767b35172..8ad2e6a96 100644 --- a/BTCPayServer/PaymentRequest/PaymentRequestHub.cs +++ b/BTCPayServer/PaymentRequest/PaymentRequestHub.cs @@ -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; } diff --git a/BTCPayServer/Plugins/Shopify/ShopifyController.cs b/BTCPayServer/Plugins/Shopify/ShopifyController.cs index c9c8246b5..af5d3e42f 100644 --- a/BTCPayServer/Plugins/Shopify/ShopifyController.cs +++ b/BTCPayServer/Plugins/Shopify/ShopifyController.cs @@ -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) { diff --git a/BTCPayServer/Services/Apps/AppHub.cs b/BTCPayServer/Services/Apps/AppHub.cs index 14c30c44f..cc281dec6 100644 --- a/BTCPayServer/Services/Apps/AppHub.cs +++ b/BTCPayServer/Services/Apps/AppHub.cs @@ -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; } diff --git a/BTCPayServer/Services/Apps/AppHubStreamer.cs b/BTCPayServer/Services/Apps/AppHubStreamer.cs index 041c30018..03fcbadce 100644 --- a/BTCPayServer/Services/Apps/AppHubStreamer.cs +++ b/BTCPayServer/Services/Apps/AppHubStreamer.cs @@ -25,7 +25,7 @@ namespace BTCPayServer.Services.Apps protected override void SubscribeToEvents() { Subscribe(); - Subscribe(); + Subscribe(); } 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); } diff --git a/BTCPayServer/Services/Apps/AppService.cs b/BTCPayServer/Services/Apps/AppService.cs index dba256fda..f9d5ca0a5 100644 --- a/BTCPayServer/Services/Apps/AppService.cs +++ b/BTCPayServer/Services/Apps/AppService.cs @@ -262,7 +262,7 @@ namespace BTCPayServer.Services.Apps { AppType appTypeEnum = Enum.Parse(appType); AppData appData = await GetApp(appId, appTypeEnum, false); - var settings = appData.GetSettings(); + var settings = appData.GetSettings(); string style; switch (appTypeEnum) diff --git a/BTCPayServer/Services/Notifications/Blobs/ExternalPayoutTransactionNotification.cs b/BTCPayServer/Services/Notifications/Blobs/ExternalPayoutTransactionNotification.cs index b59a452d9..c2d9753b3 100644 --- a/BTCPayServer/Services/Notifications/Blobs/ExternalPayoutTransactionNotification.cs +++ b/BTCPayServer/Services/Notifications/Blobs/ExternalPayoutTransactionNotification.cs @@ -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, diff --git a/BTCPayServer/Services/Notifications/Blobs/InvoiceEventNotification.cs b/BTCPayServer/Services/Notifications/Blobs/InvoiceEventNotification.cs index f97cf0ba5..42bee92bb 100644 --- a/BTCPayServer/Services/Notifications/Blobs/InvoiceEventNotification.cs +++ b/BTCPayServer/Services/Notifications/Blobs/InvoiceEventNotification.cs @@ -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); } } diff --git a/BTCPayServer/Services/Notifications/Blobs/PayoutNotification.cs b/BTCPayServer/Services/Notifications/Blobs/PayoutNotification.cs index 33c92d0ca..614bddcfb 100644 --- a/BTCPayServer/Services/Notifications/Blobs/PayoutNotification.cs +++ b/BTCPayServer/Services/Notifications/Blobs/PayoutNotification.cs @@ -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); } } diff --git a/BTCPayServer/Views/AppsPublic/PointOfSale/Light.cshtml b/BTCPayServer/Views/AppsPublic/PointOfSale/Light.cshtml deleted file mode 100644 index 5fbbbd5d9..000000000 --- a/BTCPayServer/Views/AppsPublic/PointOfSale/Light.cshtml +++ /dev/null @@ -1,18 +0,0 @@ -@model BTCPayServer.Models.AppViewModels.ViewPointOfSaleViewModel -@{ - Layout = "_LayoutPos"; -} - - - -@if (Context.Request.Query.ContainsKey("simple")) -{ - -} -else -{ - - -} diff --git a/BTCPayServer/Views/Fido2/_ViewStart.cshtml b/BTCPayServer/Views/Fido2/_ViewStart.cshtml deleted file mode 100644 index 81d75eddf..000000000 --- a/BTCPayServer/Views/Fido2/_ViewStart.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@{ - Layout = "../Shared/_NavLayout.cshtml"; - ViewData["NavPartialName"] = "../Manage/_Nav"; -} diff --git a/BTCPayServer/Views/Server/_Nav.cshtml b/BTCPayServer/Views/Server/_Nav.cshtml deleted file mode 100644 index f6444dc34..000000000 --- a/BTCPayServer/Views/Server/_Nav.cshtml +++ /dev/null @@ -1,18 +0,0 @@ -@using BTCPayServer.Configuration -@inject BTCPayServerOptions BTCPayServerOptions - - - diff --git a/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml b/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml index fb61eb58d..de0b73e4b 100644 --- a/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml +++ b/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml @@ -15,7 +15,7 @@ @if (possible) {
  • URL: - - @Url.Action("GetFile", "Storage", new + + @Url.Action("GetFile", "UIStorage", new { fileId = fileId }, Context.Request.Scheme, Context.Request.Host.ToString()) diff --git a/BTCPayServer/Views/Server/LightningChargeServices.cshtml b/BTCPayServer/Views/UIServer/LightningChargeServices.cshtml similarity index 100% rename from BTCPayServer/Views/Server/LightningChargeServices.cshtml rename to BTCPayServer/Views/UIServer/LightningChargeServices.cshtml diff --git a/BTCPayServer/Views/Server/LightningWalletServices.cshtml b/BTCPayServer/Views/UIServer/LightningWalletServices.cshtml similarity index 100% rename from BTCPayServer/Views/Server/LightningWalletServices.cshtml rename to BTCPayServer/Views/UIServer/LightningWalletServices.cshtml diff --git a/BTCPayServer/Views/Server/ListPlugins.cshtml b/BTCPayServer/Views/UIServer/ListPlugins.cshtml similarity index 99% rename from BTCPayServer/Views/Server/ListPlugins.cshtml rename to BTCPayServer/Views/UIServer/ListPlugins.cshtml index 4b42c3db9..1db2574c0 100644 --- a/BTCPayServer/Views/Server/ListPlugins.cshtml +++ b/BTCPayServer/Views/UIServer/ListPlugins.cshtml @@ -1,6 +1,6 @@ @using BTCPayServer.Configuration @using BTCPayServer.Abstractions.Contracts -@model BTCPayServer.Controllers.ServerController.ListPluginsViewModel +@model BTCPayServer.Controllers.UIServerController.ListPluginsViewModel @inject BTCPayServerOptions BTCPayServerOptions @{ Layout = "_Layout"; diff --git a/BTCPayServer/Views/Server/ListUsers.cshtml b/BTCPayServer/Views/UIServer/ListUsers.cshtml similarity index 100% rename from BTCPayServer/Views/Server/ListUsers.cshtml rename to BTCPayServer/Views/UIServer/ListUsers.cshtml diff --git a/BTCPayServer/Views/Server/LndSeedBackup.cshtml b/BTCPayServer/Views/UIServer/LndSeedBackup.cshtml similarity index 100% rename from BTCPayServer/Views/Server/LndSeedBackup.cshtml rename to BTCPayServer/Views/UIServer/LndSeedBackup.cshtml diff --git a/BTCPayServer/Views/Server/LndServices.cshtml b/BTCPayServer/Views/UIServer/LndServices.cshtml similarity index 100% rename from BTCPayServer/Views/Server/LndServices.cshtml rename to BTCPayServer/Views/UIServer/LndServices.cshtml diff --git a/BTCPayServer/Views/Server/Logs.cshtml b/BTCPayServer/Views/UIServer/Logs.cshtml similarity index 100% rename from BTCPayServer/Views/Server/Logs.cshtml rename to BTCPayServer/Views/UIServer/Logs.cshtml diff --git a/BTCPayServer/Views/Server/Maintenance.cshtml b/BTCPayServer/Views/UIServer/Maintenance.cshtml similarity index 100% rename from BTCPayServer/Views/Server/Maintenance.cshtml rename to BTCPayServer/Views/UIServer/Maintenance.cshtml diff --git a/BTCPayServer/Views/Server/P2PService.cshtml b/BTCPayServer/Views/UIServer/P2PService.cshtml similarity index 100% rename from BTCPayServer/Views/Server/P2PService.cshtml rename to BTCPayServer/Views/UIServer/P2PService.cshtml diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/UIServer/Policies.cshtml similarity index 99% rename from BTCPayServer/Views/Server/Policies.cshtml rename to BTCPayServer/Views/UIServer/Policies.cshtml index fbad8c0d1..577915171 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/UIServer/Policies.cshtml @@ -57,7 +57,7 @@ @if (!isEmailConfigured) { } diff --git a/BTCPayServer/Views/Server/RPCService.cshtml b/BTCPayServer/Views/UIServer/RPCService.cshtml similarity index 100% rename from BTCPayServer/Views/Server/RPCService.cshtml rename to BTCPayServer/Views/UIServer/RPCService.cshtml diff --git a/BTCPayServer/Views/Server/SSHService.cshtml b/BTCPayServer/Views/UIServer/SSHService.cshtml similarity index 100% rename from BTCPayServer/Views/Server/SSHService.cshtml rename to BTCPayServer/Views/UIServer/SSHService.cshtml diff --git a/BTCPayServer/Views/Server/ServerNavPages.cs b/BTCPayServer/Views/UIServer/ServerNavPages.cs similarity index 100% rename from BTCPayServer/Views/Server/ServerNavPages.cs rename to BTCPayServer/Views/UIServer/ServerNavPages.cs diff --git a/BTCPayServer/Views/Server/Services.cshtml b/BTCPayServer/Views/UIServer/Services.cshtml similarity index 100% rename from BTCPayServer/Views/Server/Services.cshtml rename to BTCPayServer/Views/UIServer/Services.cshtml diff --git a/BTCPayServer/Views/Server/Storage.cshtml b/BTCPayServer/Views/UIServer/Storage.cshtml similarity index 100% rename from BTCPayServer/Views/Server/Storage.cshtml rename to BTCPayServer/Views/UIServer/Storage.cshtml diff --git a/BTCPayServer/Views/Server/Theme.cshtml b/BTCPayServer/Views/UIServer/Theme.cshtml similarity index 100% rename from BTCPayServer/Views/Server/Theme.cshtml rename to BTCPayServer/Views/UIServer/Theme.cshtml diff --git a/BTCPayServer/Views/Server/User.cshtml b/BTCPayServer/Views/UIServer/User.cshtml similarity index 100% rename from BTCPayServer/Views/Server/User.cshtml rename to BTCPayServer/Views/UIServer/User.cshtml diff --git a/BTCPayServer/Views/UIServer/_Nav.cshtml b/BTCPayServer/Views/UIServer/_Nav.cshtml new file mode 100644 index 000000000..62755f03b --- /dev/null +++ b/BTCPayServer/Views/UIServer/_Nav.cshtml @@ -0,0 +1,18 @@ +@using BTCPayServer.Configuration +@inject BTCPayServerOptions BTCPayServerOptions + + + diff --git a/BTCPayServer/Views/Server/_ViewImports.cshtml b/BTCPayServer/Views/UIServer/_ViewImports.cshtml similarity index 100% rename from BTCPayServer/Views/Server/_ViewImports.cshtml rename to BTCPayServer/Views/UIServer/_ViewImports.cshtml diff --git a/BTCPayServer/Views/Server/_ViewStart.cshtml b/BTCPayServer/Views/UIServer/_ViewStart.cshtml similarity index 100% rename from BTCPayServer/Views/Server/_ViewStart.cshtml rename to BTCPayServer/Views/UIServer/_ViewStart.cshtml diff --git a/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml b/BTCPayServer/Views/UIShopify/EditShopifyIntegration.cshtml similarity index 100% rename from BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml rename to BTCPayServer/Views/UIShopify/EditShopifyIntegration.cshtml diff --git a/BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml b/BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml similarity index 100% rename from BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml rename to BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml diff --git a/BTCPayServer/Views/StorePullPayments/Payouts.cshtml b/BTCPayServer/Views/UIStorePullPayments/Payouts.cshtml similarity index 100% rename from BTCPayServer/Views/StorePullPayments/Payouts.cshtml rename to BTCPayServer/Views/UIStorePullPayments/Payouts.cshtml diff --git a/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml b/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml similarity index 99% rename from BTCPayServer/Views/StorePullPayments/PullPayments.cshtml rename to BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml index f879692bf..8d645a6b7 100644 --- a/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml +++ b/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml @@ -110,7 +110,7 @@ View - diff --git a/BTCPayServer/Views/Stores/CheckoutAppearance.cshtml b/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml similarity index 100% rename from BTCPayServer/Views/Stores/CheckoutAppearance.cshtml rename to BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml diff --git a/BTCPayServer/Views/Stores/CreateToken.cshtml b/BTCPayServer/Views/UIStores/CreateToken.cshtml similarity index 100% rename from BTCPayServer/Views/Stores/CreateToken.cshtml rename to BTCPayServer/Views/UIStores/CreateToken.cshtml diff --git a/BTCPayServer/Views/Stores/Dashboard.cshtml b/BTCPayServer/Views/UIStores/Dashboard.cshtml similarity index 78% rename from BTCPayServer/Views/Stores/Dashboard.cshtml rename to BTCPayServer/Views/UIStores/Dashboard.cshtml index 808110ea7..78d5dbf96 100644 --- a/BTCPayServer/Views/Stores/Dashboard.cshtml +++ b/BTCPayServer/Views/UIStores/Dashboard.cshtml @@ -1,4 +1,4 @@ -@model StoreDashboardViewModel; +@model StoreDashboardViewModel; @{ ViewData.SetActivePage(StoreNavPages.Dashboard, Model.StoreName, Model.StoreId); var isReady = Model.WalletEnabled || Model.LightningEnabled; @@ -53,7 +53,7 @@ else { if (!Model.AltcoinsBuild) { - +
    Set up a wallet
    @@ -63,7 +63,7 @@ else } else { -
    +
    Set up a wallet
    @@ -85,7 +85,7 @@ else { if (!Model.AltcoinsBuild) { -
    +
    Set up a Lightning node
    @@ -95,7 +95,7 @@ else } else { -
    +
    Set up a Lightning node
    diff --git a/BTCPayServer/Views/Stores/Emails.cshtml b/BTCPayServer/Views/UIStores/Emails.cshtml similarity index 100% rename from BTCPayServer/Views/Stores/Emails.cshtml rename to BTCPayServer/Views/UIStores/Emails.cshtml diff --git a/BTCPayServer/Views/Stores/GeneralSettings.cshtml b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml similarity index 100% rename from BTCPayServer/Views/Stores/GeneralSettings.cshtml rename to BTCPayServer/Views/UIStores/GeneralSettings.cshtml diff --git a/BTCPayServer/Views/Stores/GenerateWallet.cshtml b/BTCPayServer/Views/UIStores/GenerateWallet.cshtml similarity index 85% rename from BTCPayServer/Views/Stores/GenerateWallet.cshtml rename to BTCPayServer/Views/UIStores/GenerateWallet.cshtml index a282552e3..23a74ebd5 100644 --- a/BTCPayServer/Views/Stores/GenerateWallet.cshtml +++ b/BTCPayServer/Views/UIStores/GenerateWallet.cshtml @@ -13,7 +13,7 @@ } @section Navbar { -
    + } diff --git a/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml similarity index 75% rename from BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml rename to BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml index 1f5d3a37a..20fbed98b 100644 --- a/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml +++ b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml @@ -6,7 +6,7 @@ } @section Navbar { - + } @@ -16,7 +16,7 @@
    @if (Model.CanUseHotWallet) { - +
    @@ -46,7 +46,7 @@
    - +
    diff --git a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml similarity index 93% rename from BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml rename to BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml index 479598105..afd6a73c4 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml +++ b/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml @@ -6,7 +6,7 @@ } @section Navbar { -
    + } @@ -46,7 +46,7 @@ - + @@ -98,7 +98,7 @@