mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Displaying NetworkFee if it was present for the invoice
This commit is contained in:
committed by
Andrew Camilleri
parent
f1a222fbb3
commit
edc9429e84
@@ -22,6 +22,8 @@ namespace BTCPayServer.Models.InvoicingModels
|
|||||||
public bool Replaced { get; set; }
|
public bool Replaced { get; set; }
|
||||||
public BitcoinLikePaymentData CryptoPaymentData { get; set; }
|
public BitcoinLikePaymentData CryptoPaymentData { get; set; }
|
||||||
public string AdditionalInformation { get; set; }
|
public string AdditionalInformation { get; set; }
|
||||||
|
|
||||||
|
public decimal NetworkFee { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OffChainPaymentViewModel
|
public class OffChainPaymentViewModel
|
||||||
|
|||||||
@@ -41,12 +41,14 @@
|
|||||||
m.TransactionLink = string.Format(CultureInfo.InvariantCulture, payment.Network.BlockExplorerLink, m.TransactionId);
|
m.TransactionLink = string.Format(CultureInfo.InvariantCulture, payment.Network.BlockExplorerLink, m.TransactionId);
|
||||||
m.Replaced = !payment.Accounted;
|
m.Replaced = !payment.Accounted;
|
||||||
m.CryptoPaymentData = onChainPaymentData;
|
m.CryptoPaymentData = onChainPaymentData;
|
||||||
|
m.NetworkFee = payment.NetworkFee;
|
||||||
return m;
|
return m;
|
||||||
}).Where(model => model != null);
|
}).Where(model => model != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (onchainPayments.Any())
|
@if (onchainPayments.Any())
|
||||||
{
|
{
|
||||||
|
var hasNetworkFee = onchainPayments.Sum(a => a.NetworkFee) > 0;
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 invoice-payments">
|
<div class="col-md-12 invoice-payments">
|
||||||
<h3>On-Chain payments</h3>
|
<h3>On-Chain payments</h3>
|
||||||
@@ -57,6 +59,15 @@
|
|||||||
<th>Index</th>
|
<th>Index</th>
|
||||||
<th>Deposit address</th>
|
<th>Deposit address</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
|
@if (hasNetworkFee)
|
||||||
|
{
|
||||||
|
<th>
|
||||||
|
Network Fee
|
||||||
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#allow-anyone-to-create-invoice" target="_blank">
|
||||||
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
}
|
||||||
<th>Transaction Id</th>
|
<th>Transaction Id</th>
|
||||||
<th class="text-end">Confirmations</th>
|
<th class="text-end">Confirmations</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -69,7 +80,11 @@
|
|||||||
<td>@(payment.CryptoPaymentData.KeyPath?.ToString()?? "Unknown")</td>
|
<td>@(payment.CryptoPaymentData.KeyPath?.ToString()?? "Unknown")</td>
|
||||||
<td style="max-width:300px;" data-bs-toggle="tooltip" class="text-truncate" title="@payment.DepositAddress">@payment.DepositAddress</td>
|
<td style="max-width:300px;" data-bs-toggle="tooltip" class="text-truncate" title="@payment.DepositAddress">@payment.DepositAddress</td>
|
||||||
<td class="payment-value">@payment.CryptoPaymentData.GetValue() @Safe.Raw(payment.AdditionalInformation is string i ? $"<br/>({i})" : string.Empty)</td>
|
<td class="payment-value">@payment.CryptoPaymentData.GetValue() @Safe.Raw(payment.AdditionalInformation is string i ? $"<br/>({i})" : string.Empty)</td>
|
||||||
<td style="max-width:300px;" data-bs-toggle="tooltip" class="text-truncate" title="@payment.TransactionId">
|
@if (hasNetworkFee)
|
||||||
|
{
|
||||||
|
<td>@payment.NetworkFee</td>
|
||||||
|
}
|
||||||
|
<td style="max-width:200px;" data-bs-toggle="tooltip" class="text-truncate" title="@payment.TransactionId">
|
||||||
<div class="wraptextAuto">
|
<div class="wraptextAuto">
|
||||||
<a href="@payment.TransactionLink" target="_blank" rel="noreferrer noopener">
|
<a href="@payment.TransactionLink" target="_blank" rel="noreferrer noopener">
|
||||||
@payment.TransactionId
|
@payment.TransactionId
|
||||||
|
|||||||
Reference in New Issue
Block a user