From 621a7d998d3a4edddf8213ad734a5429319d8b8a Mon Sep 17 00:00:00 2001 From: Kukks Date: Sun, 10 Nov 2019 18:49:24 +0100 Subject: [PATCH] Display proper rate for ln sats feature fixes #1128 --- BTCPayServer/Models/InvoicingModels/PaymentModel.cs | 1 + BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs | 1 + BTCPayServer/Views/Invoice/Checkout-Body.cshtml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index 280a98e80..2e25f36e8 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -78,5 +78,6 @@ namespace BTCPayServer.Models.InvoicingModels public string RootPath { get; set; } public decimal CoinSwitchAmountMarkupPercentage { get; set; } public bool RedirectAutomatically { get; set; } + public string RateBaseAmount { get; set; } = "1"; } } diff --git a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs index ca085c4f6..a6b224e74 100644 --- a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs @@ -185,6 +185,7 @@ namespace BTCPayServer.Payments.Lightning model.BtcPaid = Money.Parse(model.BtcPaid).ToUnit(MoneyUnit.Satoshi).ToString(CultureInfo.InvariantCulture); model.NetworkFee = new Money(model.NetworkFee, MoneyUnit.BTC).ToUnit(MoneyUnit.Satoshi); model.OrderAmount = Money.Parse(model.OrderAmount).ToUnit(MoneyUnit.Satoshi).ToString(CultureInfo.InvariantCulture); + model.RateBaseAmount = Money.FromUnit(1, MoneyUnit.BTC).Satoshi.ToString(CultureInfo.InvariantCulture); } } public override string GetCryptoImage(PaymentMethodId paymentMethodId) diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index be25bd08e..b577e27d1 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -100,7 +100,7 @@ {{ srvModel.btcDue }} {{ srvModel.cryptoCode }}
- 1 {{ srvModel.cryptoCodeSrv }} = {{ srvModel.rate }} + {{srvModel.rateBaseAmount}} {{ srvModel.cryptoCodeSrv }} = {{ srvModel.rate }}