From eb01e91e136d3e7a361471edb52dfb9d9af241c6 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Tue, 15 May 2018 14:48:23 -0500 Subject: [PATCH] Only show Order Amount in Fiat if Invoice is created with fiat value --- BTCPayServer/Controllers/InvoiceController.UI.cs | 7 +++++++ BTCPayServer/Views/Invoice/Checkout-Body.cshtml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 74be496df..8fc9ecf2b 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -297,6 +297,13 @@ namespace BTCPayServer.Controllers } private string OrderAmountFiat(ProductInformation productInformation) { + // check if invoice source currency is crypto... if it is there is no "order amount in fiat" + foreach (var net in _NetworkProvider.GetAll()) + { + if (net.CryptoCode == productInformation.Currency) + return null; + } + return FormatCurrency(productInformation.Price, productInformation.Currency); } diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index 913bbc411..20e689344 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -87,7 +87,7 @@
{{$t("Order Amount")}}
{{srvModel.orderAmount}} {{ srvModel.cryptoCode }}
-
+
 
{{srvModel.orderAmountFiat}}