mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
67 lines
2.5 KiB
Plaintext
67 lines
2.5 KiB
Plaintext
|
@using System.Globalization
|
||
|
@using BTCPayServer.Payments
|
||
|
@using BTCPayServer.Payments.Bitcoin
|
||
|
@model IEnumerable<BTCPayServer.Services.Invoices.PaymentEntity>
|
||
|
|
||
|
@{
|
||
|
var onchainPayments = Model.Where(entity => entity.GetPaymentMethodId().PaymentType == BitcoinPaymentType.Instance).Select(payment =>
|
||
|
{
|
||
|
var m = new OnchainPaymentViewModel();
|
||
|
var onChainPaymentData = payment.GetCryptoPaymentData() as BitcoinLikePaymentData;
|
||
|
m.Crypto = payment.GetPaymentMethodId().CryptoCode;
|
||
|
m.DepositAddress = onChainPaymentData.GetDestination();
|
||
|
|
||
|
int confirmationCount = onChainPaymentData.ConfirmationCount;
|
||
|
if (confirmationCount >= payment.Network.MaxTrackedConfirmation)
|
||
|
{
|
||
|
m.Confirmations = "At least " + (payment.Network.MaxTrackedConfirmation);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
m.Confirmations = confirmationCount.ToString(CultureInfo.InvariantCulture);
|
||
|
}
|
||
|
|
||
|
m.TransactionId = onChainPaymentData.Outpoint.Hash.ToString();
|
||
|
m.ReceivedTime = payment.ReceivedTime;
|
||
|
m.TransactionLink = string.Format(CultureInfo.InvariantCulture, payment.Network.BlockExplorerLink, m.TransactionId);
|
||
|
m.Replaced = !payment.Accounted;
|
||
|
return m;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
@if (onchainPayments.Any())
|
||
|
{
|
||
|
<div class="row">
|
||
|
<div class="col-md-12 invoice-payments">
|
||
|
<h3>On-Chain payments</h3>
|
||
|
<table class="table table-sm table-responsive-lg">
|
||
|
<thead class="thead-inverse">
|
||
|
<tr>
|
||
|
<th>Crypto</th>
|
||
|
<th>Deposit address</th>
|
||
|
<th>Transaction Id</th>
|
||
|
<th class="text-right">Confirmations</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
@foreach (var payment in onchainPayments)
|
||
|
{
|
||
|
<tr class="@(payment.Replaced ? "linethrough" : "")" >
|
||
|
<td>@payment.Crypto</td>
|
||
|
<td>@payment.DepositAddress</td>
|
||
|
<td>
|
||
|
<div class="wraptextAuto">
|
||
|
<a href="@payment.TransactionLink" target="_blank">
|
||
|
@payment.TransactionId
|
||
|
</a>
|
||
|
</div>
|
||
|
</td>
|
||
|
<td class="text-right">@payment.Confirmations</td>
|
||
|
</tr>
|
||
|
}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
}
|