mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-12 10:30:47 +01:00
Displaying fiat value of invoice's order amount in details
This commit is contained in:
parent
be1128a886
commit
3770adb7d3
3 changed files with 8 additions and 9 deletions
|
@ -239,9 +239,9 @@ namespace BTCPayServer.Controllers
|
||||||
CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri,
|
CustomCSSLink = storeBlob.CustomCSS?.AbsoluteUri,
|
||||||
CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri,
|
CustomLogoLink = storeBlob.CustomLogo?.AbsoluteUri,
|
||||||
BtcAddress = paymentMethodDetails.GetPaymentDestination(),
|
BtcAddress = paymentMethodDetails.GetPaymentDestination(),
|
||||||
OrderAmount = (accounting.TotalDue - accounting.NetworkFee).ToString(),
|
|
||||||
BtcDue = accounting.Due.ToString(),
|
BtcDue = accounting.Due.ToString(),
|
||||||
FiatDue = FiatDue(accounting.Due, paymentMethod),
|
OrderAmount = (accounting.TotalDue - accounting.NetworkFee).ToString(),
|
||||||
|
OrderAmountFiat = OrderAmountFiat(invoice.ProductInformation),
|
||||||
CustomerEmail = invoice.RefundMail,
|
CustomerEmail = invoice.RefundMail,
|
||||||
RequiresRefundEmail = storeBlob.RequiresRefundEmail,
|
RequiresRefundEmail = storeBlob.RequiresRefundEmail,
|
||||||
ExpirationSeconds = Math.Max(0, (int)(invoice.ExpirationTime - DateTimeOffset.UtcNow).TotalSeconds),
|
ExpirationSeconds = Math.Max(0, (int)(invoice.ExpirationTime - DateTimeOffset.UtcNow).TotalSeconds),
|
||||||
|
@ -295,10 +295,9 @@ namespace BTCPayServer.Controllers
|
||||||
{
|
{
|
||||||
return price.ToString("C", _CurrencyNameTable.GetCurrencyProvider(currency)) + $" ({currency})";
|
return price.ToString("C", _CurrencyNameTable.GetCurrencyProvider(currency)) + $" ({currency})";
|
||||||
}
|
}
|
||||||
private string FiatDue(Money btcDue, PaymentMethod paymentMethod)
|
private string OrderAmountFiat(ProductInformation productInformation)
|
||||||
{
|
{
|
||||||
var currency = paymentMethod.ParentEntity.ProductInformation.Currency;
|
return FormatCurrency(productInformation.Price, productInformation.Currency);
|
||||||
return FormatCurrency(btcDue.ToUnit(MoneyUnit.BTC) * paymentMethod.Rate, currency);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
|
|
@ -36,8 +36,8 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||||
public string ItemDesc { get; set; }
|
public string ItemDesc { get; set; }
|
||||||
public string TimeLeft { get; set; }
|
public string TimeLeft { get; set; }
|
||||||
public string Rate { get; set; }
|
public string Rate { get; set; }
|
||||||
public string FiatDue { get; set; }
|
|
||||||
public string OrderAmount { get; set; }
|
public string OrderAmount { get; set; }
|
||||||
|
public string OrderAmountFiat { get; set; }
|
||||||
public string InvoiceBitcoinUrl { get; set; }
|
public string InvoiceBitcoinUrl { get; set; }
|
||||||
public string InvoiceBitcoinUrlQR { get; set; }
|
public string InvoiceBitcoinUrlQR { get; set; }
|
||||||
public int TxCount { get; set; }
|
public int TxCount { get; set; }
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="single-item-order__right__ex-rate">
|
<div class="single-item-order__right__ex-rate">
|
||||||
{{srvModel.fiatDue}}
|
1 {{ srvModel.cryptoCode }} = {{ srvModel.rate }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@
|
||||||
<div class="line-items">
|
<div class="line-items">
|
||||||
<div class="line-items__item">
|
<div class="line-items__item">
|
||||||
<div class="line-items__item__label">
|
<div class="line-items__item__label">
|
||||||
<span>{{$t("Exchange Rate")}}</span>
|
<span>{{$t("Order Amount in Fiat")}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line-items__item__value">1 {{ srvModel.cryptoCode }} = {{ srvModel.rate }}</div>
|
<div class="line-items__item__value">{{srvModel.orderAmountFiat}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="line-items__item">
|
<div class="line-items__item">
|
||||||
<div class="line-items__item__label">{{$t("Order Amount")}}</div>
|
<div class="line-items__item__label">{{$t("Order Amount")}}</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue