diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index d81516e7a..ab0c133c8 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -290,13 +290,21 @@ namespace BTCPayServer.Controllers return NotFound(); var settings = app.GetSettings(); + var store = await GetStore(app); + var paymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider) + .Select(a=>a.PaymentId.ToString()).ToList(); + + var currencyDropdown = new List(); + currencyDropdown.Add(settings.Currency); + currencyDropdown.AddRange(paymentMethods); var model = new PayButtonViewModel { Price = 10, Currency = settings.Currency, ButtonSize = 2, - UrlRoot = "http://127.0.0.1:14142" + UrlRoot = "http://127.0.0.1:14142", + CurrencyDropdown = currencyDropdown }; return View(model); } diff --git a/BTCPayServer/Controllers/AppsController.cs b/BTCPayServer/Controllers/AppsController.cs index e9e54bd8b..eba124b81 100644 --- a/BTCPayServer/Controllers/AppsController.cs +++ b/BTCPayServer/Controllers/AppsController.cs @@ -24,6 +24,7 @@ namespace BTCPayServer.Controllers UserManager _UserManager; CurrencyNameTable _Currencies; InvoiceController _InvoiceController; + BTCPayNetworkProvider _NetworkProvider; [TempData] public string StatusMessage { get; set; } @@ -32,12 +33,14 @@ namespace BTCPayServer.Controllers UserManager userManager, ApplicationDbContextFactory contextFactory, CurrencyNameTable currencies, - InvoiceController invoiceController) + InvoiceController invoiceController, + BTCPayNetworkProvider networkProvider) { _InvoiceController = invoiceController; _UserManager = userManager; _ContextFactory = contextFactory; _Currencies = currencies; + _NetworkProvider = networkProvider; } public async Task ListApps() { diff --git a/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs b/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs index 1a5eadbc1..8d8dfe807 100644 --- a/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/PayButtonViewModel.cs @@ -18,5 +18,6 @@ namespace BTCPayServer.Models.AppViewModels // public string UrlRoot { get; set; } + public List CurrencyDropdown { get; set; } } } diff --git a/BTCPayServer/Views/Apps/PayButton.cshtml b/BTCPayServer/Views/Apps/PayButton.cshtml index 812571c41..8807fa61c 100644 --- a/BTCPayServer/Views/Apps/PayButton.cshtml +++ b/BTCPayServer/Views/Apps/PayButton.cshtml @@ -22,8 +22,12 @@
- +