diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index dfd71768e..856cebe7f 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -242,8 +242,9 @@ namespace BTCPayServer.Controllers CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri, CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri, BtcAddress = paymentMethodDetails.GetPaymentDestination(), - OrderAmount = (accounting.TotalDue - accounting.NetworkFee).ToString(), BtcDue = accounting.Due.ToString(), + OrderAmount = (accounting.TotalDue - accounting.NetworkFee).ToString(), + OrderAmountFiat = OrderAmountFiat(invoice.ProductInformation), CustomerEmail = invoice.RefundMail, RequiresRefundEmail = storeBlob.RequiresRefundEmail, ExpirationSeconds = Math.Max(0, (int)(invoice.ExpirationTime - DateTimeOffset.UtcNow).TotalSeconds), @@ -315,6 +316,17 @@ namespace BTCPayServer.Controllers } return price.ToString("C", provider) + $" ({currency})"; } + 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); + } [HttpGet] [Route("i/{invoiceId}/status")] diff --git a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs index e3dcaf149..da28a8975 100644 --- a/BTCPayServer/Models/InvoicingModels/PaymentModel.cs +++ b/BTCPayServer/Models/InvoicingModels/PaymentModel.cs @@ -37,6 +37,7 @@ namespace BTCPayServer.Models.InvoicingModels public string TimeLeft { get; set; } public string Rate { get; set; } public string OrderAmount { get; set; } + public string OrderAmountFiat { get; set; } public string InvoiceBitcoinUrl { get; set; } public string InvoiceBitcoinUrlQR { get; set; } public int TxCount { get; set; } diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index b50e3a707..e00aa4547 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -73,7 +73,7 @@ {{ srvModel.btcDue }} {{ srvModel.cryptoCode }} -
+
1 {{ srvModel.cryptoCode }} = {{ srvModel.rate }}
@@ -87,6 +87,12 @@
{{$t("Order Amount")}}
{{srvModel.orderAmount}} {{ srvModel.cryptoCode }}
+
+
 
+
+ {{srvModel.orderAmountFiat}} +
+
{{$t("Network Cost")}} @@ -133,7 +139,7 @@
-
+
diff --git a/BTCPayServer/wwwroot/checkout/css/normalizer.css b/BTCPayServer/wwwroot/checkout/css/normalizer.css index bb566cb11..e8a539b3e 100644 --- a/BTCPayServer/wwwroot/checkout/css/normalizer.css +++ b/BTCPayServer/wwwroot/checkout/css/normalizer.css @@ -10328,6 +10328,7 @@ All mobile class names should be prefixed by m- */ .wrong-email .payment-tabs { pointer-events: none; margin-top: -2.95rem; + z-index: -1; margin-bottom: 1rem; } @@ -10412,10 +10413,6 @@ All mobile class names should be prefixed by m- */ transform: translateY(20px); } -.payment-tabs { - z-index: 1; -} - .single-item-order { z-index: 2; } @@ -11146,31 +11143,13 @@ language-selector { line-items { background: #FBFBFB; - height: 25px; - border-top: 0; + border-top: 1px solid rgba(238, 238, 238, 0.5); z-index: 2; - position: relative; - display: block; - overflow: hidden; - height: 0; - transition: height 250ms ease; + display: none; } - line-items.expanded { - height: 120px; - border-top: 1px solid rgba(238, 238, 238, 0.5); - } - - line-items.expanded.paid-over { - height: 295px; - } - - line-items.expanded.paid-partial-expired, line-items.expanded.paid-full { - height: 272px; - } - line-items .line-items { - padding: 1rem; + padding: 10px 1rem; color: #565D6E; } @@ -11198,6 +11177,10 @@ line-items { padding: 2px 0; } + line-items .line-items_fiatvalue { + margin-top: -5px; + } + line-items .line-items__item__label { flex-grow: 1; display: flex; diff --git a/BTCPayServer/wwwroot/checkout/js/core.js b/BTCPayServer/wwwroot/checkout/js/core.js index 89120ef3f..9feefed82 100644 --- a/BTCPayServer/wwwroot/checkout/js/core.js +++ b/BTCPayServer/wwwroot/checkout/js/core.js @@ -237,8 +237,12 @@ $(document).ready(function () { }); // Expand Line-Items + var lineItemsExpanded = false; $(".buyerTotalLine").click(function () { $("line-items").toggleClass("expanded"); + lineItemsExpanded ? $("line-items").slideUp() : $("line-items").slideDown(); + lineItemsExpanded = !lineItemsExpanded; + $(".buyerTotalLine").toggleClass("expanded"); $(".single-item-order__right__btc-price__chevron").toggleClass("expanded"); });