Merge pull request #3261 from NicolasDorier/qfouq

Rename controllers
This commit is contained in:
Nicolas Dorier 2022-01-14 16:23:47 +09:00 committed by GitHub
commit 5cbc2e96e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
311 changed files with 714 additions and 711 deletions

View file

@ -52,18 +52,18 @@ namespace BTCPayServer.Client
if (message.StatusCode == System.Net.HttpStatusCode.UnprocessableEntity)
{
var err = JsonConvert.DeserializeObject<Models.GreenfieldValidationError[]>(await message.Content.ReadAsStringAsync());
throw new GreenFieldValidationException(err);
throw new GreenfieldValidationException(err);
}
if (message.StatusCode == System.Net.HttpStatusCode.Forbidden)
{
var err = JsonConvert.DeserializeObject<Models.GreenfieldPermissionAPIError>(await message.Content.ReadAsStringAsync());
throw new GreenFieldAPIException((int)message.StatusCode, err);
throw new GreenfieldAPIException((int)message.StatusCode, err);
}
else
{
var err = JsonConvert.DeserializeObject<Models.GreenfieldAPIError>(await message.Content.ReadAsStringAsync());
if (err.Code != null)
throw new GreenFieldAPIException((int)message.StatusCode, err);
throw new GreenfieldAPIException((int)message.StatusCode, err);
}
}
message.EnsureSuccessStatusCode();

View file

@ -2,9 +2,9 @@ using System;
namespace BTCPayServer.Client
{
public class GreenFieldAPIException : Exception
public class GreenfieldAPIException : Exception
{
public GreenFieldAPIException(int httpCode, Models.GreenfieldAPIError error) : base(error.Message)
public GreenfieldAPIException(int httpCode, Models.GreenfieldAPIError error) : base(error.Message)
{
if (error == null)
throw new ArgumentNullException(nameof(error));

View file

@ -4,9 +4,9 @@ using BTCPayServer.Client.Models;
namespace BTCPayServer.Client
{
public class GreenFieldValidationException : Exception
public class GreenfieldValidationException : Exception
{
public GreenFieldValidationException(Models.GreenfieldValidationError[] errors) : base(BuildMessage(errors))
public GreenfieldValidationException(Models.GreenfieldValidationError[] errors) : base(BuildMessage(errors))
{
ValidationErrors = errors;
}

View file

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

View file

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

View file

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

View file

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using BTCPayServer.Client;
using BTCPayServer.Client.Models;
using BTCPayServer.Data;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Tests.Logging;
using BTCPayServer.Views.Manage;
using Newtonsoft.Json;

View file

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

View file

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

View file

@ -602,15 +602,15 @@ namespace BTCPayServer.Tests
return new DateTimeOffset(dateTimeOffset.Year, dateTimeOffset.Month, dateTimeOffset.Day, dateTimeOffset.Hour, dateTimeOffset.Minute, dateTimeOffset.Second, dateTimeOffset.Offset);
}
private async Task<GreenFieldAPIException> AssertAPIError(string expectedError, Func<Task> act)
private async Task<GreenfieldAPIException> AssertAPIError(string expectedError, Func<Task> act)
{
var err = await Assert.ThrowsAsync<GreenFieldAPIException>(async () => await act());
var err = await Assert.ThrowsAsync<GreenfieldAPIException>(async () => await act());
Assert.Equal(expectedError, err.APIError.Code);
return err;
}
private async Task<GreenFieldAPIException> AssertPermissionError(string expectedPermission, Func<Task> act)
private async Task<GreenfieldAPIException> AssertPermissionError(string expectedPermission, Func<Task> act)
{
var err = await Assert.ThrowsAsync<GreenFieldAPIException>(async () => await act());
var err = await Assert.ThrowsAsync<GreenfieldAPIException>(async () => await act());
var err2 = Assert.IsType<GreenfieldPermissionAPIError>(err.APIError);
Assert.Equal(expectedPermission, err2.MissingPermission);
return err;
@ -675,10 +675,10 @@ namespace BTCPayServer.Tests
}
}
private async Task<GreenFieldValidationException> AssertValidationError(string[] fields, Func<Task> act)
private async Task<GreenfieldValidationException> AssertValidationError(string[] fields, Func<Task> act)
{
var remainingFields = fields.ToHashSet();
var ex = await Assert.ThrowsAsync<GreenFieldValidationException>(act);
var ex = await Assert.ThrowsAsync<GreenfieldValidationException>(act);
foreach (var field in fields)
{
Assert.Contains(field, ex.ValidationErrors.Select(e => e.Path).ToArray());
@ -690,7 +690,7 @@ namespace BTCPayServer.Tests
private async Task AssertHttpError(int code, Func<Task> act)
{
var ex = await Assert.ThrowsAsync<GreenFieldAPIException>(act);
var ex = await Assert.ThrowsAsync<GreenfieldAPIException>(act);
Assert.Equal(code, ex.HttpCode);
}
@ -977,7 +977,7 @@ namespace BTCPayServer.Tests
var paymentTestPaymentRequest = await client.CreatePaymentRequest(user.StoreId,
new CreatePaymentRequestRequest() { Amount = 0.1m, Currency = "BTC", Title = "Payment test title" });
var invoiceId = Assert.IsType<string>(Assert.IsType<OkObjectResult>(await user.GetController<PaymentRequestController>()
var invoiceId = Assert.IsType<string>(Assert.IsType<OkObjectResult>(await user.GetController<UIPaymentRequestController>()
.PayPaymentRequest(paymentTestPaymentRequest.Id, false)).Value);
var invoice = user.BitPay.GetInvoice(invoiceId);
await tester.WaitForEvent<InvoiceDataChangedEvent>(async () =>
@ -1332,7 +1332,7 @@ namespace BTCPayServer.Tests
}
});
Assert.EndsWith($"/i/{newInvoice.Id}", newInvoice.CheckoutLink);
var controller = tester.PayTester.GetController<InvoiceController>(user.UserId, user.StoreId);
var controller = tester.PayTester.GetController<UIInvoiceController>(user.UserId, user.StoreId);
var model = (PaymentModel)((ViewResult)await controller.Checkout(newInvoice.Id)).Model;
Assert.Equal("it-IT", model.DefaultLang);
Assert.Equal("http://toto.com/lol", model.MerchantRefLink);
@ -1496,12 +1496,12 @@ namespace BTCPayServer.Tests
{
BOLT11 = merchantInvoice.BOLT11
});
await Assert.ThrowsAsync<GreenFieldValidationException>(async () => await client.PayLightningInvoice(user.StoreId, "BTC", new PayLightningInvoiceRequest()
await Assert.ThrowsAsync<GreenfieldValidationException>(async () => await client.PayLightningInvoice(user.StoreId, "BTC", new PayLightningInvoiceRequest()
{
BOLT11 = "lol"
}));
var validationErr = await Assert.ThrowsAsync<GreenFieldValidationException>(async () => await client.CreateLightningInvoice(user.StoreId, "BTC", new CreateLightningInvoiceRequest()
var validationErr = await Assert.ThrowsAsync<GreenfieldValidationException>(async () => await client.CreateLightningInvoice(user.StoreId, "BTC", new CreateLightningInvoiceRequest()
{
Amount = -1,
Expiry = TimeSpan.FromSeconds(-1),

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,10 +12,10 @@ namespace BTCPayServer.Controllers
{
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Bitpay)]
[BitpayAPIConstraint()]
public class AccessTokenController : Controller
public class BitpayAccessTokenController : Controller
{
readonly TokenRepository _TokenRepository;
public AccessTokenController(TokenRepository tokenRepository)
public BitpayAccessTokenController(TokenRepository tokenRepository)
{
_TokenRepository = tokenRepository ?? throw new ArgumentNullException(nameof(tokenRepository));
}

View file

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

View file

@ -23,7 +23,7 @@ namespace BTCPayServer.Controllers
{
[EnableCors(CorsPolicies.All)]
[Authorize(Policy = ServerPolicies.CanGetRates.Key, AuthenticationSchemes = AuthenticationSchemes.Bitpay)]
public class RateController : Controller
public class BitpayRateController : Controller
{
public StoreData CurrentStore
{
@ -40,7 +40,7 @@ namespace BTCPayServer.Controllers
public TokenRepository TokenRepository { get; }
public RateController(
public BitpayRateController(
RateFetcher rateProviderFactory,
BTCPayNetworkProvider networkProvider,
TokenRepository tokenRepository,

View file

@ -3,9 +3,9 @@ using BTCPayServer.Client.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
public static class GreenFieldUtils
public static class GreenfieldUtils
{
public static IActionResult CreateValidationError(this ControllerBase controller, ModelStateDictionary modelState)
{

View file

@ -5,7 +5,7 @@ using BTCPayServer.Client;
using BTCPayServer.Client.Models;
using BTCPayServer.Data;
using BTCPayServer.Security;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Identity;
@ -13,17 +13,17 @@ using Microsoft.AspNetCore.Mvc;
using NBitcoin;
using NBitcoin.DataEncoders;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.GreenfieldAPIKeys)]
[EnableCors(CorsPolicies.All)]
public class ApiKeysController : ControllerBase
public class GreenfieldApiKeysController : ControllerBase
{
private readonly APIKeyRepository _apiKeyRepository;
private readonly UserManager<ApplicationUser> _userManager;
public ApiKeysController(APIKeyRepository apiKeyRepository, UserManager<ApplicationUser> userManager)
public GreenfieldApiKeysController(APIKeyRepository apiKeyRepository, UserManager<ApplicationUser> userManager)
{
_apiKeyRepository = apiKeyRepository;
_userManager = userManager;

View file

@ -4,15 +4,15 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[Controller]
[EnableCors(CorsPolicies.All)]
public class HealthController : ControllerBase
public class GreenfieldHealthController : ControllerBase
{
private readonly NBXplorerDashboard _dashBoard;
public HealthController(NBXplorerDashboard dashBoard)
public GreenfieldHealthController(NBXplorerDashboard dashBoard)
{
_dashBoard = dashBoard;
}

View file

@ -17,14 +17,14 @@ using NBitcoin;
using CreateInvoiceRequest = BTCPayServer.Client.Models.CreateInvoiceRequest;
using InvoiceData = BTCPayServer.Client.Models.InvoiceData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class GreenFieldInvoiceController : Controller
public class GreenfieldInvoiceController : Controller
{
private readonly InvoiceController _invoiceController;
private readonly UIInvoiceController _invoiceController;
private readonly InvoiceRepository _invoiceRepository;
private readonly LinkGenerator _linkGenerator;
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
@ -33,7 +33,7 @@ namespace BTCPayServer.Controllers.GreenField
public LanguageService LanguageService { get; }
public GreenFieldInvoiceController(InvoiceController invoiceController, InvoiceRepository invoiceRepository,
public GreenfieldInvoiceController(UIInvoiceController invoiceController, InvoiceRepository invoiceRepository,
LinkGenerator linkGenerator, LanguageService languageService, BTCPayNetworkProvider btcPayNetworkProvider,
EventAggregator eventAggregator, PaymentMethodHandlerDictionary paymentMethodHandlerDictionary)
{

View file

@ -13,20 +13,20 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[LightningUnavailableExceptionFilter]
[EnableCors(CorsPolicies.All)]
public class InternalLightningNodeApiController : LightningNodeApiController
public class GreenfieldInternalLightningNodeApiController : GreenfieldLightningNodeApiController
{
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
private readonly LightningClientFactoryService _lightningClientFactory;
private readonly IOptions<LightningNetworkOptions> _lightningNetworkOptions;
public InternalLightningNodeApiController(
public GreenfieldInternalLightningNodeApiController(
BTCPayNetworkProvider btcPayNetworkProvider, ISettingsRepository settingsRepository, LightningClientFactoryService lightningClientFactory,
IOptions<LightningNetworkOptions> lightningNetworkOptions,
IAuthorizationService authorizationService) : base(

View file

@ -17,19 +17,19 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[LightningUnavailableExceptionFilter]
[EnableCors(CorsPolicies.All)]
public class StoreLightningNodeApiController : LightningNodeApiController
public class GreenfieldStoreLightningNodeApiController : GreenfieldLightningNodeApiController
{
private readonly IOptions<LightningNetworkOptions> _lightningNetworkOptions;
private readonly LightningClientFactoryService _lightningClientFactory;
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
public StoreLightningNodeApiController(
public GreenfieldStoreLightningNodeApiController(
IOptions<LightningNetworkOptions> lightningNetworkOptions,
LightningClientFactoryService lightningClientFactory, BTCPayNetworkProvider btcPayNetworkProvider,
ISettingsRepository settingsRepository,

View file

@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
public class LightningUnavailableExceptionFilter : Attribute, IExceptionFilter
{
@ -24,12 +24,12 @@ namespace BTCPayServer.Controllers.GreenField
// Do not mark handled, it is possible filters above have better errors
}
}
public abstract class LightningNodeApiController : Controller
public abstract class GreenfieldLightningNodeApiController : Controller
{
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
private readonly ISettingsRepository _settingsRepository;
private readonly IAuthorizationService _authorizationService;
protected LightningNodeApiController(BTCPayNetworkProvider btcPayNetworkProvider,
protected GreenfieldLightningNodeApiController(BTCPayNetworkProvider btcPayNetworkProvider,
ISettingsRepository settingsRepository,
IAuthorizationService authorizationService)
{

View file

@ -13,17 +13,17 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using NotificationData = BTCPayServer.Client.Models.NotificationData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class NotificationsController : ControllerBase
public class GreenfieldNotificationsController : ControllerBase
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly NotificationManager _notificationManager;
public NotificationsController(UserManager<ApplicationUser> userManager,
public GreenfieldNotificationsController(UserManager<ApplicationUser> userManager,
NotificationManager notificationManager)
{
_userManager = userManager;

View file

@ -14,17 +14,17 @@ using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using PaymentRequestData = BTCPayServer.Data.PaymentRequestData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class GreenFieldPaymentRequestsController : ControllerBase
public class GreenfieldPaymentRequestsController : ControllerBase
{
private readonly PaymentRequestRepository _paymentRequestRepository;
private readonly CurrencyNameTable _currencyNameTable;
public GreenFieldPaymentRequestsController(PaymentRequestRepository paymentRequestRepository,
public GreenfieldPaymentRequestsController(PaymentRequestRepository paymentRequestRepository,
CurrencyNameTable currencyNameTable)
{
_paymentRequestRepository = paymentRequestRepository;

View file

@ -18,7 +18,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
@ -151,8 +151,8 @@ namespace BTCPayServer.Controllers.GreenField
Period = ppBlob.Period,
Archived = pp.Archived,
ViewLink = _linkGenerator.GetUriByAction(
nameof(PullPaymentController.ViewPullPayment),
"PullPayment",
nameof(UIPullPaymentController.ViewPullPayment),
"UIPullPayment",
new { pullPaymentId = pp.Id },
Request.Scheme,
Request.Host,

View file

@ -10,17 +10,17 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[EnableCors(CorsPolicies.All)]
public class GreenFieldServerInfoController : Controller
public class GreenfieldServerInfoController : Controller
{
private readonly BTCPayServerEnvironment _env;
private readonly PaymentMethodHandlerDictionary _paymentMethodHandlerDictionary;
private readonly IEnumerable<ISyncSummaryProvider> _summaryProviders;
public GreenFieldServerInfoController(
public GreenfieldServerInfoController(
BTCPayServerEnvironment env,
PaymentMethodHandlerDictionary paymentMethodHandlerDictionary,
IEnumerable<ISyncSummaryProvider> summaryProviders)

View file

@ -20,11 +20,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public class StoreLNURLPayPaymentMethodsController : ControllerBase
public class GreenfieldStoreLNURLPayPaymentMethodsController : ControllerBase
{
private StoreData Store => HttpContext.GetStoreData();
private readonly StoreRepository _storeRepository;
@ -32,7 +32,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly IAuthorizationService _authorizationService;
private readonly ISettingsRepository _settingsRepository;
public StoreLNURLPayPaymentMethodsController(
public GreenfieldStoreLNURLPayPaymentMethodsController(
StoreRepository storeRepository,
BTCPayNetworkProvider btcPayNetworkProvider,
IAuthorizationService authorizationService,
@ -112,7 +112,7 @@ namespace BTCPayServer.Controllers.GreenField
AssertCryptoCodeWallet(cryptoCode, out _);
var lnMethod = StoreLightningNetworkPaymentMethodsController.GetExistingLightningLikePaymentMethod(_btcPayNetworkProvider,
var lnMethod = GreenfieldStoreLightningNetworkPaymentMethodsController.GetExistingLightningLikePaymentMethod(_btcPayNetworkProvider,
cryptoCode, Store);
if ((lnMethod is null || lnMethod.Enabled is false) && paymentMethodData.Enabled)

View file

@ -20,11 +20,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public class StoreLightningNetworkPaymentMethodsController : ControllerBase
public class GreenfieldStoreLightningNetworkPaymentMethodsController : ControllerBase
{
private StoreData Store => HttpContext.GetStoreData();
private readonly StoreRepository _storeRepository;
@ -32,7 +32,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly IAuthorizationService _authorizationService;
private readonly ISettingsRepository _settingsRepository;
public StoreLightningNetworkPaymentMethodsController(
public GreenfieldStoreLightningNetworkPaymentMethodsController(
StoreRepository storeRepository,
BTCPayNetworkProvider btcPayNetworkProvider,
IAuthorizationService authorizationService,

View file

@ -9,9 +9,9 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NBXplorer.Models;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
public partial class StoreOnChainPaymentMethodsController
public partial class GreenfieldStoreOnChainPaymentMethodsController
{
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[HttpPost("~/api/v1/stores/{storeId}/payment-methods/onchain/{cryptoCode}/generate")]

View file

@ -17,11 +17,11 @@ using NBXplorer.DerivationStrategy;
using NBXplorer.Models;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public partial class StoreOnChainPaymentMethodsController : ControllerBase
public partial class GreenfieldStoreOnChainPaymentMethodsController : ControllerBase
{
private StoreData Store => HttpContext.GetStoreData();
private readonly StoreRepository _storeRepository;
@ -31,7 +31,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly ISettingsRepository _settingsRepository;
private readonly ExplorerClientProvider _explorerClientProvider;
public StoreOnChainPaymentMethodsController(
public GreenfieldStoreOnChainPaymentMethodsController(
StoreRepository storeRepository,
BTCPayNetworkProvider btcPayNetworkProvider,
BTCPayWalletProvider walletProvider,

View file

@ -28,12 +28,12 @@ using NBXplorer.Models;
using Newtonsoft.Json.Linq;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class StoreOnChainWalletsController : Controller
public class GreenfieldStoreOnChainWalletsController : Controller
{
private StoreData Store => HttpContext.GetStoreData();
private readonly IAuthorizationService _authorizationService;
@ -43,14 +43,14 @@ 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;
private readonly WalletReceiveService _walletReceiveService;
private readonly IFeeProviderFactory _feeProviderFactory;
public StoreOnChainWalletsController(
public GreenfieldStoreOnChainWalletsController(
IAuthorizationService authorizationService,
BTCPayWalletProvider btcPayWalletProvider,
BTCPayNetworkProvider btcPayNetworkProvider,
@ -58,7 +58,7 @@ namespace BTCPayServer.Controllers.GreenField
ExplorerClientProvider explorerClientProvider,
ISettingsRepository settingsRepository,
NBXplorerDashboard nbXplorerDashboard,
WalletsController walletsController,
UIWalletsController walletsController,
PayjoinClient payjoinClient,
DelayedTransactionBroadcaster delayedTransactionBroadcaster,
EventAggregator eventAggregator,
@ -353,7 +353,7 @@ namespace BTCPayServer.Controllers.GreenField
request.AddModelError(transactionRequest => transactionRequest.Destinations[index],
"Amount must be specified or destination must be a BIP21 payment link, and greater than 0", this);
}
if (request.ProceedWithPayjoin && bip21?.UnknowParameters?.ContainsKey(PayjoinClient.BIP21EndpointKey) is true)
if (request.ProceedWithPayjoin && bip21?.UnknownParameters?.ContainsKey(PayjoinClient.BIP21EndpointKey) is true)
{
payjoinOutputIndex = index;
}

View file

@ -11,17 +11,17 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public class StorePaymentMethodsController : ControllerBase
public class GreenfieldStorePaymentMethodsController : ControllerBase
{
private StoreData Store => HttpContext.GetStoreData();
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
private readonly IAuthorizationService _authorizationService;
public StorePaymentMethodsController(BTCPayNetworkProvider btcPayNetworkProvider, IAuthorizationService authorizationService)
public GreenfieldStorePaymentMethodsController(BTCPayNetworkProvider btcPayNetworkProvider, IAuthorizationService authorizationService)
{
_btcPayNetworkProvider = btcPayNetworkProvider;
_authorizationService = authorizationService;

View file

@ -18,22 +18,22 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield,
Policy = Policies.CanModifyStoreWebhooks)]
[EnableCors(CorsPolicies.All)]
public class StoreWebhooksController : ControllerBase
public class GreenfieldStoreWebhooksController : ControllerBase
{
public StoreWebhooksController(StoreRepository storeRepository, WebhookSender webhookNotificationManager)
public GreenfieldStoreWebhooksController(StoreRepository storeRepository, WebhookSender webhookSender)
{
StoreRepository = storeRepository;
WebhookNotificationManager = webhookNotificationManager;
WebhookSender = webhookSender;
}
public StoreRepository StoreRepository { get; }
public WebhookSender WebhookNotificationManager { get; }
public WebhookSender WebhookSender { get; }
[HttpGet("~/api/v1/stores/{storeId}/webhooks/{webhookId?}")]
public async Task<IActionResult> ListWebhooks(string storeId, string webhookId)
@ -152,7 +152,7 @@ namespace BTCPayServer.Controllers.GreenField
var delivery = await StoreRepository.GetWebhookDelivery(CurrentStoreId, webhookId, deliveryId);
if (delivery is null)
return WebhookDeliveryNotFound();
return this.Ok(new JValue(await WebhookNotificationManager.Redeliver(deliveryId)));
return this.Ok(new JValue(await WebhookSender.Redeliver(deliveryId)));
}
[HttpGet("~/api/v1/stores/{storeId}/webhooks/{webhookId}/deliveries/{deliveryId}/request")]

View file

@ -15,18 +15,18 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using StoreData = BTCPayServer.Data.StoreData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class GreenFieldStoresController : ControllerBase
public class GreenfieldStoresController : ControllerBase
{
private readonly StoreRepository _storeRepository;
private readonly UserManager<ApplicationUser> _userManager;
private readonly BTCPayNetworkProvider _btcPayNetworkProvider;
public GreenFieldStoresController(StoreRepository storeRepository, UserManager<ApplicationUser> userManager, BTCPayNetworkProvider btcPayNetworkProvider)
public GreenfieldStoresController(StoreRepository storeRepository, UserManager<ApplicationUser> userManager, BTCPayNetworkProvider btcPayNetworkProvider)
{
_storeRepository = storeRepository;
_userManager = userManager;

View file

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
/// <summary>
/// this controller serves as a testing endpoint for our api key unit tests
@ -16,13 +16,13 @@ namespace BTCPayServer.Controllers.GreenField
[Route("api/test/apikey")]
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public class TestApiKeyController : ControllerBase
public class GreenfieldTestApiKeyController : ControllerBase
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly StoreRepository _storeRepository;
private readonly BTCPayServerClient _localBTCPayServerClient;
public TestApiKeyController(UserManager<ApplicationUser> userManager, StoreRepository storeRepository, BTCPayServerClient localBTCPayServerClient)
public GreenfieldTestApiKeyController(UserManager<ApplicationUser> userManager, StoreRepository storeRepository, BTCPayServerClient localBTCPayServerClient)
{
_userManager = userManager;
_storeRepository = storeRepository;

View file

@ -12,7 +12,7 @@ using BTCPayServer.Events;
using BTCPayServer.HostedServices;
using BTCPayServer.Logging;
using BTCPayServer.Security;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Services;
using BTCPayServer.Services.Stores;
using BTCPayServer.Storage.Services;
@ -22,12 +22,12 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using NicolasDorier.RateLimits;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
[ApiController]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
[EnableCors(CorsPolicies.All)]
public class UsersController : ControllerBase
public class GreenfieldUsersController : ControllerBase
{
public Logs Logs { get; }
@ -41,7 +41,7 @@ namespace BTCPayServer.Controllers.GreenField
private readonly IAuthorizationService _authorizationService;
private readonly UserService _userService;
public UsersController(UserManager<ApplicationUser> userManager,
public GreenfieldUsersController(UserManager<ApplicationUser> userManager,
RoleManager<IdentityRole> roleManager,
SettingsRepository settingsRepository,
EventAggregator eventAggregator,
@ -99,7 +99,7 @@ namespace BTCPayServer.Controllers.GreenField
throw new JsonHttpException(this.StatusCode(401));
var anyAdmin = (await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin)).Any();
var policies = await _settingsRepository.GetSettingAsync<PoliciesSettings>() ?? new PoliciesSettings();
var isAuth = User.Identity.AuthenticationType == GreenFieldConstants.AuthenticationType;
var isAuth = User.Identity.AuthenticationType == GreenfieldConstants.AuthenticationType;
// If registration are locked and that an admin exists, don't accept unauthenticated connection
if (anyAdmin && policies.LockSubscription && !isAuth)

View file

@ -9,7 +9,7 @@ using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Client;
using BTCPayServer.Client.Models;
using BTCPayServer.Data;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Services.Stores;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
@ -27,53 +27,53 @@ using StoreData = BTCPayServer.Client.Models.StoreData;
using StoreWebhookData = BTCPayServer.Client.Models.StoreWebhookData;
using WebhookDeliveryData = BTCPayServer.Client.Models.WebhookDeliveryData;
namespace BTCPayServer.Controllers.GreenField
namespace BTCPayServer.Controllers.Greenfield
{
public class BTCPayServerClientFactory : IBTCPayServerClientFactory
{
private readonly StoreRepository _storeRepository;
private readonly IOptionsMonitor<IdentityOptions> _identityOptions;
private readonly StoreOnChainPaymentMethodsController _chainPaymentMethodsController;
private readonly StoreOnChainWalletsController _storeOnChainWalletsController;
private readonly StoreLightningNetworkPaymentMethodsController _storeLightningNetworkPaymentMethodsController;
private readonly StoreLNURLPayPaymentMethodsController _storeLnurlPayPaymentMethodsController;
private readonly HealthController _healthController;
private readonly GreenFieldPaymentRequestsController _paymentRequestController;
private readonly ApiKeysController _apiKeysController;
private readonly NotificationsController _notificationsController;
private readonly UsersController _usersController;
private readonly GreenFieldStoresController _storesController;
private readonly InternalLightningNodeApiController _internalLightningNodeApiController;
private readonly StoreLightningNodeApiController _storeLightningNodeApiController;
private readonly GreenFieldInvoiceController _greenFieldInvoiceController;
private readonly GreenfieldStoreOnChainPaymentMethodsController _chainPaymentMethodsController;
private readonly GreenfieldStoreOnChainWalletsController _storeOnChainWalletsController;
private readonly GreenfieldStoreLightningNetworkPaymentMethodsController _storeLightningNetworkPaymentMethodsController;
private readonly GreenfieldStoreLNURLPayPaymentMethodsController _storeLnurlPayPaymentMethodsController;
private readonly GreenfieldHealthController _healthController;
private readonly GreenfieldPaymentRequestsController _paymentRequestController;
private readonly GreenfieldApiKeysController _apiKeysController;
private readonly GreenfieldNotificationsController _notificationsController;
private readonly GreenfieldUsersController _usersController;
private readonly GreenfieldStoresController _storesController;
private readonly GreenfieldInternalLightningNodeApiController _internalLightningNodeApiController;
private readonly GreenfieldStoreLightningNodeApiController _storeLightningNodeApiController;
private readonly GreenfieldInvoiceController _greenFieldInvoiceController;
private readonly UserManager<ApplicationUser> _userManager;
private readonly GreenFieldServerInfoController _greenFieldServerInfoController;
private readonly StoreWebhooksController _storeWebhooksController;
private readonly GreenfieldServerInfoController _greenFieldServerInfoController;
private readonly GreenfieldStoreWebhooksController _storeWebhooksController;
private readonly GreenfieldPullPaymentController _greenfieldPullPaymentController;
private readonly HomeController _homeController;
private readonly StorePaymentMethodsController _storePaymentMethodsController;
private readonly UIHomeController _homeController;
private readonly GreenfieldStorePaymentMethodsController _storePaymentMethodsController;
public BTCPayServerClientFactory(StoreRepository storeRepository,
IOptionsMonitor<IdentityOptions> identityOptions,
StoreOnChainPaymentMethodsController chainPaymentMethodsController,
StoreOnChainWalletsController storeOnChainWalletsController,
StoreLightningNetworkPaymentMethodsController storeLightningNetworkPaymentMethodsController,
StoreLNURLPayPaymentMethodsController storeLnurlPayPaymentMethodsController,
HealthController healthController,
GreenFieldPaymentRequestsController paymentRequestController,
ApiKeysController apiKeysController,
NotificationsController notificationsController,
UsersController usersController,
GreenFieldStoresController storesController,
InternalLightningNodeApiController internalLightningNodeApiController,
StoreLightningNodeApiController storeLightningNodeApiController,
GreenFieldInvoiceController greenFieldInvoiceController,
GreenfieldStoreOnChainPaymentMethodsController chainPaymentMethodsController,
GreenfieldStoreOnChainWalletsController storeOnChainWalletsController,
GreenfieldStoreLightningNetworkPaymentMethodsController storeLightningNetworkPaymentMethodsController,
GreenfieldStoreLNURLPayPaymentMethodsController storeLnurlPayPaymentMethodsController,
GreenfieldHealthController healthController,
GreenfieldPaymentRequestsController paymentRequestController,
GreenfieldApiKeysController apiKeysController,
GreenfieldNotificationsController notificationsController,
GreenfieldUsersController usersController,
GreenfieldStoresController storesController,
GreenfieldInternalLightningNodeApiController internalLightningNodeApiController,
GreenfieldStoreLightningNodeApiController storeLightningNodeApiController,
GreenfieldInvoiceController greenFieldInvoiceController,
UserManager<ApplicationUser> userManager,
GreenFieldServerInfoController greenFieldServerInfoController,
StoreWebhooksController storeWebhooksController,
GreenfieldServerInfoController greenFieldServerInfoController,
GreenfieldStoreWebhooksController storeWebhooksController,
GreenfieldPullPaymentController greenfieldPullPaymentController,
HomeController homeController,
StorePaymentMethodsController storePaymentMethodsController)
UIHomeController homeController,
GreenfieldStorePaymentMethodsController storePaymentMethodsController)
{
_storeRepository = storeRepository;
_identityOptions = identityOptions;
@ -107,18 +107,18 @@ namespace BTCPayServer.Controllers.GreenField
List<Claim> claims = new List<Claim>
{
new Claim(_identityOptions.CurrentValue.ClaimsIdentity.UserIdClaimType, userId),
new Claim(GreenFieldConstants.ClaimTypes.Permission,
new Claim(GreenfieldConstants.ClaimTypes.Permission,
Permission.Create(Policies.Unrestricted).ToString())
};
claims.AddRange((await _userManager.GetRolesAsync(user)).Select(s =>
new Claim(_identityOptions.CurrentValue.ClaimsIdentity.RoleClaimType, s)));
context.User =
new ClaimsPrincipal(new ClaimsIdentity(claims, GreenFieldConstants.AuthenticationType));
new ClaimsPrincipal(new ClaimsIdentity(claims, GreenfieldConstants.AuthenticationType));
}
else
{
context.User =
new ClaimsPrincipal(new ClaimsIdentity(new List<Claim>(), $"Local{GreenFieldConstants.AuthenticationType}"));
new ClaimsPrincipal(new ClaimsIdentity(new List<Claim>(), $"Local{GreenfieldConstants.AuthenticationType}"));
}
if (storeIds?.Any() is true)
@ -157,43 +157,43 @@ namespace BTCPayServer.Controllers.GreenField
public class LocalBTCPayServerClient : BTCPayServerClient
{
private readonly StoreOnChainPaymentMethodsController _chainPaymentMethodsController;
private readonly StoreOnChainWalletsController _storeOnChainWalletsController;
private readonly HealthController _healthController;
private readonly GreenFieldPaymentRequestsController _paymentRequestController;
private readonly ApiKeysController _apiKeysController;
private readonly NotificationsController _notificationsController;
private readonly UsersController _usersController;
private readonly GreenFieldStoresController _storesController;
private readonly StoreLightningNodeApiController _storeLightningNodeApiController;
private readonly InternalLightningNodeApiController _lightningNodeApiController;
private readonly StoreLightningNetworkPaymentMethodsController _storeLightningNetworkPaymentMethodsController;
private readonly StoreLNURLPayPaymentMethodsController _storeLnurlPayPaymentMethodsController;
private readonly GreenFieldInvoiceController _greenFieldInvoiceController;
private readonly GreenFieldServerInfoController _greenFieldServerInfoController;
private readonly StoreWebhooksController _storeWebhooksController;
private readonly GreenfieldStoreOnChainPaymentMethodsController _chainPaymentMethodsController;
private readonly GreenfieldStoreOnChainWalletsController _storeOnChainWalletsController;
private readonly GreenfieldHealthController _healthController;
private readonly GreenfieldPaymentRequestsController _paymentRequestController;
private readonly GreenfieldApiKeysController _apiKeysController;
private readonly GreenfieldNotificationsController _notificationsController;
private readonly GreenfieldUsersController _usersController;
private readonly GreenfieldStoresController _storesController;
private readonly GreenfieldStoreLightningNodeApiController _storeLightningNodeApiController;
private readonly GreenfieldInternalLightningNodeApiController _lightningNodeApiController;
private readonly GreenfieldStoreLightningNetworkPaymentMethodsController _storeLightningNetworkPaymentMethodsController;
private readonly GreenfieldStoreLNURLPayPaymentMethodsController _storeLnurlPayPaymentMethodsController;
private readonly GreenfieldInvoiceController _greenFieldInvoiceController;
private readonly GreenfieldServerInfoController _greenFieldServerInfoController;
private readonly GreenfieldStoreWebhooksController _storeWebhooksController;
private readonly GreenfieldPullPaymentController _greenfieldPullPaymentController;
private readonly HomeController _homeController;
private readonly StorePaymentMethodsController _storePaymentMethodsController;
private readonly UIHomeController _homeController;
private readonly GreenfieldStorePaymentMethodsController _storePaymentMethodsController;
public LocalBTCPayServerClient(StoreOnChainPaymentMethodsController chainPaymentMethodsController,
StoreOnChainWalletsController storeOnChainWalletsController,
HealthController healthController,
GreenFieldPaymentRequestsController paymentRequestController,
ApiKeysController apiKeysController,
NotificationsController notificationsController,
UsersController usersController,
GreenFieldStoresController storesController,
StoreLightningNodeApiController storeLightningNodeApiController,
InternalLightningNodeApiController lightningNodeApiController,
StoreLightningNetworkPaymentMethodsController storeLightningNetworkPaymentMethodsController,
StoreLNURLPayPaymentMethodsController storeLnurlPayPaymentMethodsController,
GreenFieldInvoiceController greenFieldInvoiceController,
GreenFieldServerInfoController greenFieldServerInfoController,
StoreWebhooksController storeWebhooksController,
public LocalBTCPayServerClient(GreenfieldStoreOnChainPaymentMethodsController chainPaymentMethodsController,
GreenfieldStoreOnChainWalletsController storeOnChainWalletsController,
GreenfieldHealthController healthController,
GreenfieldPaymentRequestsController paymentRequestController,
GreenfieldApiKeysController apiKeysController,
GreenfieldNotificationsController notificationsController,
GreenfieldUsersController usersController,
GreenfieldStoresController storesController,
GreenfieldStoreLightningNodeApiController storeLightningNodeApiController,
GreenfieldInternalLightningNodeApiController lightningNodeApiController,
GreenfieldStoreLightningNetworkPaymentMethodsController storeLightningNetworkPaymentMethodsController,
GreenfieldStoreLNURLPayPaymentMethodsController storeLnurlPayPaymentMethodsController,
GreenfieldInvoiceController greenFieldInvoiceController,
GreenfieldServerInfoController greenFieldServerInfoController,
GreenfieldStoreWebhooksController storeWebhooksController,
GreenfieldPullPaymentController greenfieldPullPaymentController,
HomeController homeController,
StorePaymentMethodsController storePaymentMethodsController,
UIHomeController homeController,
GreenfieldStorePaymentMethodsController storePaymentMethodsController,
IHttpContextAccessor httpContextAccessor) : base(new Uri("https://dummy.local"), "", "")
{
_chainPaymentMethodsController = chainPaymentMethodsController;
@ -484,11 +484,11 @@ namespace BTCPayServer.Controllers.GreenField
switch (result)
{
case UnprocessableEntityObjectResult { Value: List<GreenfieldValidationError> validationErrors }:
throw new GreenFieldValidationException(validationErrors.ToArray());
throw new GreenfieldValidationException(validationErrors.ToArray());
case BadRequestObjectResult { Value: GreenfieldAPIError error }:
throw new GreenFieldAPIException(400, error);
throw new GreenfieldAPIException(400, error);
case NotFoundResult _:
throw new GreenFieldAPIException(404, new GreenfieldAPIError("not-found", ""));
throw new GreenfieldAPIException(404, new GreenfieldAPIError("not-found", ""));
default:
return;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@ using BTCPayServer.Abstractions.Models;
using BTCPayServer.Client;
using BTCPayServer.Data;
using BTCPayServer.Models;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NBitcoin;
@ -16,7 +16,7 @@ using NBitcoin.DataEncoders;
namespace BTCPayServer.Controllers
{
public partial class ManageController
public partial class UIManageController
{
[HttpGet]
public async Task<IActionResult> APIKeys()

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -36,18 +36,18 @@ 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,
StoreRepository repo,
TokenRepository tokenRepo,
UserManager<ApplicationUser> userManager,
AccessTokenController tokenController,
BitpayAccessTokenController tokenController,
BTCPayWalletProvider walletProvider,
BTCPayNetworkProvider networkProvider,
RateFetcher rateFactory,
@ -90,7 +90,7 @@ namespace BTCPayServer.Controllers
readonly BTCPayNetworkProvider _NetworkProvider;
private readonly ExplorerClientProvider _ExplorerProvider;
readonly BTCPayWalletProvider _WalletProvider;
readonly AccessTokenController _TokenController;
readonly BitpayAccessTokenController _TokenController;
readonly StoreRepository _Repo;
readonly TokenRepository _TokenRepository;
readonly UserManager<ApplicationUser> _UserManager;
@ -701,7 +701,7 @@ namespace BTCPayServer.Controllers
{
await _Repo.DeleteStore(CurrentStore.Id);
TempData[WellKnownTempData.SuccessMessage] = "Store successfully deleted.";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
private IEnumerable<AvailableRateProvider> GetSupportedExchanges()
@ -873,7 +873,7 @@ namespace BTCPayServer.Controllers
if (!model.Stores.Any())
{
TempData[WellKnownTempData.ErrorMessage] = "You need to be owner of at least one store before pairing";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
return View(model);
}
@ -932,7 +932,7 @@ namespace BTCPayServer.Controllers
if (pairing == null)
{
TempData[WellKnownTempData.ErrorMessage] = "Unknown pairing code";
return RedirectToAction(nameof(HomeController.Index), "Home");
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
else
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@ using System.Threading.Tasks;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Client;
using BTCPayServer.Security.Bitpay;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Services;
using CsvHelper.Configuration.Attributes;
using Microsoft.AspNetCore.Authorization;
@ -26,7 +26,7 @@ namespace BTCPayServer
bool isAdmin = false;
if (claimUser.AuthenticationType == AuthenticationSchemes.Cookie)
isAdmin = user.IsInRole(Roles.ServerAdmin);
else if (claimUser.AuthenticationType == GreenFieldConstants.AuthenticationType)
else if (claimUser.AuthenticationType == GreenfieldConstants.AuthenticationType)
isAdmin = (await authorizationService.AuthorizeAsync(user, Policies.CanModifyServerSettings)).Succeeded;
return isAdmin ? (true, true) :
(policiesSettings?.AllowHotWalletForAll is true, policiesSettings?.AllowHotWalletRPCImportForAll is true);

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using BTCPayServer.Controllers.GreenField;
using BTCPayServer.Controllers.Greenfield;
using BTCPayServer.Data;
using BTCPayServer.Events;
using BTCPayServer.Logging;
@ -229,14 +229,14 @@ namespace BTCPayServer.HostedServices
{
AfterExpiration = invoiceEvent.Invoice.Status.ToModernStatus() == InvoiceStatus.Expired || invoiceEvent.Invoice.Status.ToModernStatus() == InvoiceStatus.Invalid,
PaymentMethod = invoiceEvent.Payment.GetPaymentMethodId().ToStringNormalized(),
Payment = GreenFieldInvoiceController.ToPaymentModel(invoiceEvent.Invoice, invoiceEvent.Payment)
Payment = GreenfieldInvoiceController.ToPaymentModel(invoiceEvent.Invoice, invoiceEvent.Payment)
};
case InvoiceEventCode.PaymentSettled:
return new WebhookInvoiceReceivedPaymentEvent(WebhookEventType.InvoicePaymentSettled)
{
AfterExpiration = invoiceEvent.Invoice.Status.ToModernStatus() == InvoiceStatus.Expired || invoiceEvent.Invoice.Status.ToModernStatus() == InvoiceStatus.Invalid,
PaymentMethod = invoiceEvent.Payment.GetPaymentMethodId().ToStringNormalized(),
Payment = GreenFieldInvoiceController.ToPaymentModel(invoiceEvent.Invoice, invoiceEvent.Payment),
Payment = GreenfieldInvoiceController.ToPaymentModel(invoiceEvent.Invoice, invoiceEvent.Payment),
OverPaid = invoiceEvent.Invoice.ExceptionStatus == InvoiceExceptionStatus.PaidOver,
};
default:

View file

@ -10,7 +10,7 @@ using BTCPayServer.Client;
using BTCPayServer.Common;
using BTCPayServer.Configuration;
using BTCPayServer.Controllers;
using BTCPayServer.Controllers.GreenField;
using BTCPayServer.Controllers.Greenfield;
using BTCPayServer.Data;
using BTCPayServer.Data.Payouts.LightningLike;
using BTCPayServer.HostedServices;
@ -24,7 +24,7 @@ using BTCPayServer.Payments.PayJoin;
using BTCPayServer.Plugins;
using BTCPayServer.Security;
using BTCPayServer.Security.Bitpay;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using BTCPayServer.Services;
using BTCPayServer.Services.Apps;
using BTCPayServer.Services.Fees;
@ -381,10 +381,10 @@ namespace BTCPayServer.Hosting
services.TryAddSingleton<RateFetcher>();
services.TryAddScoped<IHttpContextAccessor, HttpContextAccessor>();
services.AddTransient<AccessTokenController>();
services.AddTransient<InvoiceController>();
services.AddTransient<AppsPublicController>();
services.AddTransient<PaymentRequestController>();
services.AddTransient<BitpayAccessTokenController>();
services.AddTransient<UIInvoiceController>();
services.AddTransient<UIAppsPublicController>();
services.AddTransient<UIPaymentRequestController>();
// Add application services.
services.AddSingleton<EmailSenderFactory>();

View file

@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BTCPayServer.Client.Models;
using BTCPayServer.Security.GreenField;
using BTCPayServer.Security.Greenfield;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
@ -35,7 +35,7 @@ namespace BTCPayServer.Hosting
(httpContext.Response.StatusCode == 401 || httpContext.Response.StatusCode == 403))
{
if (httpContext.Response.StatusCode == 403 &&
httpContext.Items.TryGetValue(GreenFieldAuthorizationHandler.RequestedPermissionKey, out var p) &&
httpContext.Items.TryGetValue(GreenfieldAuthorizationHandler.RequestedPermissionKey, out var p) &&
p is string policy)
{
var outputObj = new GreenfieldPermissionAPIError(policy);

View file

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

View file

@ -4,7 +4,7 @@ using System.IO;
using System.Linq;
using System.Net;
using BTCPayServer.Configuration;
using BTCPayServer.Controllers.GreenField;
using BTCPayServer.Controllers.Greenfield;
using BTCPayServer.Data;
using BTCPayServer.Fido2;
using BTCPayServer.Filters;
@ -270,7 +270,7 @@ namespace BTCPayServer.Hosting
PaymentRequestHub.Register(endpoints);
endpoints.MapRazorPages();
endpoints.MapControllers();
endpoints.MapControllerRoute("default", "{controller:validate=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller:validate=UIHome}/{action=Index}/{id?}");
});
app.UsePlugins();
}

View file

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

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