AllowedSendingOptionsList => AllowedSendingOptions.Select(o => new SelectListItem(o.Value, o.Key)).ToList();
+
+
}
}
diff --git a/Plugins/BTCPayServer.Plugins.FixedFloat/UpdateFixedFloatSettingsViewModel.cs b/Plugins/BTCPayServer.Plugins.FixedFloat/UpdateFixedFloatSettingsViewModel.cs
deleted file mode 100644
index d27636a..0000000
--- a/Plugins/BTCPayServer.Plugins.FixedFloat/UpdateFixedFloatSettingsViewModel.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace BTCPayServer.Plugins.FixedFloat
-{
- public class UpdateFixedFloatSettingsViewModel
- {
- public bool Enabled { get; set; }
- public string StoreName { get; set; }
- }
-}
diff --git a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/FixedFloat/UpdateFixedFloatSettings.cshtml b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/FixedFloat/UpdateFixedFloatSettings.cshtml
index 85cd6ad..e50658c 100644
--- a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/FixedFloat/UpdateFixedFloatSettings.cshtml
+++ b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/FixedFloat/UpdateFixedFloatSettings.cshtml
@@ -1,11 +1,20 @@
-@using BTCPayServer.Abstractions.Extensions
+@using BTCPayServer
+@using BTCPayServer.Abstractions.Extensions
+@using BTCPayServer.Data
+@using BTCPayServer.Plugins.FixedFloat
+@using BTCPayServer.Services.Stores
@using Microsoft.AspNetCore.Mvc.TagHelpers
-@model BTCPayServer.Plugins.FixedFloat.UpdateFixedFloatSettingsViewModel
+@model BTCPayServer.Plugins.FixedFloat.FixedFloatSettings
+@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
ViewData.SetActivePage("FixedFloat", "FixedFloat", "FixedFloat");
+ var store = Context.GetStoreData();
+ var allowedPaymentMethods = store.GetEnabledPaymentIds(BTCPayNetworkProvider)
+ .Select(pmi => new SelectListItem(pmi.ToPrettyString(), pmi.ToString()))
+ .Prepend(new SelectListItem("Any", ""));
}
-
+
@ViewData["Title"]
@@ -22,7 +31,22 @@
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutContentExtension.cshtml b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutContentExtension.cshtml
index 13f46c3..c315ebf 100644
--- a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutContentExtension.cshtml
+++ b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutContentExtension.cshtml
@@ -1,10 +1,10 @@
@using BTCPayServer.Plugins.FixedFloat
-@using Newtonsoft.Json
-@using Newtonsoft.Json.Linq
+@model BTCPayServer.Models.InvoicingModels.PaymentModel
@inject FixedFloatService FixedFloatService
@{
- var storeId = ((JObject)JObject.Parse(JsonConvert.SerializeObject(Model)))["StoreId"].Value();
+ var storeId = Model.StoreId;
var settings = await FixedFloatService.GetFixedFloatForStore(storeId);
+
if (settings?.Enabled is true)
{
diff --git a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutPaymentExtension.cshtml b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutPaymentExtension.cshtml
index 2c2e853..4a8822d 100644
--- a/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutPaymentExtension.cshtml
+++ b/Plugins/BTCPayServer.Plugins.FixedFloat/Views/Shared/FixedFloat/CheckoutPaymentExtension.cshtml
@@ -1,28 +1,58 @@
@using BTCPayServer.Plugins.FixedFloat
-@using Newtonsoft.Json
-@using Newtonsoft.Json.Linq
@inject FixedFloatService FixedFloatService
+@model BTCPayServer.Models.InvoicingModels.PaymentModel
@{
- var storeId = ((JObject)JObject.Parse(JsonConvert.SerializeObject(Model)))["StoreId"].Value();
+ var storeId = Model.StoreId;
var settings = await FixedFloatService.GetFixedFloatForStore(storeId);
+ var preferredTargetPaymentMethodId = string.IsNullOrEmpty(settings.PreferredTargetPaymentMethodId) ? null : Model.AvailableCryptos.Any(crypto => crypto.PaymentMethodId == settings.PreferredTargetPaymentMethodId) ? settings.PreferredTargetPaymentMethodId : null;
}
@if (settings?.Enabled is true)
{
-
+