2022-02-14 16:04:34 +08:00
|
|
|
@using System.Globalization
|
2023-10-10 05:28:00 +02:00
|
|
|
@using BTCPayServer.Components.TruncateCenter
|
|
|
|
@using BTCPayServer.Services
|
2022-02-14 16:04:34 +08:00
|
|
|
@using BTCPayServer.Services.Altcoins.Zcash.Payments
|
|
|
|
@using BTCPayServer.Services.Altcoins.Zcash.UI
|
2023-10-10 05:28:00 +02:00
|
|
|
@inject DisplayFormatter DisplayFormatter
|
2022-02-14 16:04:34 +08:00
|
|
|
@model IEnumerable<BTCPayServer.Services.Invoices.PaymentEntity>
|
|
|
|
|
|
|
|
@{
|
2023-10-10 05:28:00 +02:00
|
|
|
var payments = Model.Where(entity => entity.GetPaymentMethodId().PaymentType == ZcashPaymentType.Instance).Select(payment =>
|
2022-02-14 16:04:34 +08:00
|
|
|
{
|
|
|
|
var m = new ZcashPaymentViewModel();
|
|
|
|
var onChainPaymentData = payment.GetCryptoPaymentData() as ZcashLikePaymentData;
|
|
|
|
m.Crypto = payment.GetPaymentMethodId().CryptoCode;
|
|
|
|
m.DepositAddress = onChainPaymentData.GetDestination();
|
|
|
|
m.Amount = onChainPaymentData.GetValue().ToString(CultureInfo.InvariantCulture);
|
|
|
|
var confirmationCount = onChainPaymentData.ConfirmationCount;
|
|
|
|
var network = payment.Network as ZcashLikeSpecificBtcPayNetwork;
|
|
|
|
if (confirmationCount >= network.MaxTrackedConfirmation)
|
|
|
|
{
|
|
|
|
m.Confirmations = "At least " + (network.MaxTrackedConfirmation);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m.Confirmations = confirmationCount.ToString(CultureInfo.InvariantCulture);
|
|
|
|
}
|
|
|
|
|
|
|
|
m.TransactionId = onChainPaymentData.TransactionId;
|
|
|
|
m.ReceivedTime = payment.ReceivedTime;
|
|
|
|
m.TransactionLink = string.Format(CultureInfo.InvariantCulture, payment.Network.BlockExplorerLink, m.TransactionId);
|
|
|
|
return m;
|
2023-10-10 05:28:00 +02:00
|
|
|
}).ToList();
|
2022-02-14 16:04:34 +08:00
|
|
|
}
|
|
|
|
|
2023-10-10 05:28:00 +02:00
|
|
|
@if (payments.Any())
|
2022-02-14 16:04:34 +08:00
|
|
|
{
|
2023-10-10 05:28:00 +02:00
|
|
|
<section>
|
|
|
|
<h5>Zcash Payments</h5>
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="w-75px">Crypto</th>
|
|
|
|
<th class="w-175px">Destination</th>
|
|
|
|
<th class="text-nowrap">Payment Proof</th>
|
|
|
|
<th class="text-end">Confirmations</th>
|
|
|
|
<th class="w-150px text-end">Paid</th>
|
2022-06-03 17:33:22 +02:00
|
|
|
</tr>
|
2023-10-10 05:28:00 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var payment in payments)
|
|
|
|
{
|
|
|
|
<tr >
|
|
|
|
<td>@payment.Crypto</td>
|
|
|
|
<td><vc:truncate-center text="@payment.DepositAddress" classes="truncate-center-id" /></td>
|
|
|
|
<td><vc:truncate-center text="@payment.TransactionId" link="@payment.TransactionLink" classes="truncate-center-id" /></td>
|
|
|
|
<td class="text-end">@payment.Confirmations</td>
|
|
|
|
<td class="payment-value text-end text-nowrap">
|
|
|
|
<span data-sensitive class="text-success">@DisplayFormatter.Currency(payment.Amount, payment.Crypto)</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
2022-02-14 16:04:34 +08:00
|
|
|
}
|