btcpayserver/BTCPayServer/Views/Shared/ViewLightningLikePaymentData.cshtml

47 lines
1.5 KiB
Plaintext

@using BTCPayServer.Payments
@using BTCPayServer.Payments.Lightning
@model IEnumerable<BTCPayServer.Services.Invoices.PaymentEntity>
@{
var offchainPayments = Model.Where(entity => entity.GetPaymentMethodId()?.PaymentType == LightningPaymentType.Instance).Select(payment =>
{
var offChainPaymentData = payment.GetCryptoPaymentData() as LightningLikePaymentData;
if (offChainPaymentData is null)
{
return null;
}
return new OffChainPaymentViewModel()
{
Crypto = payment.Network.CryptoCode,
BOLT11 = offChainPaymentData.BOLT11
};
}).Where(model => model != null);
}
@if (offchainPayments.Any())
{
<div class="row">
<div class="col-md-12 invoice-payments">
<h3>Off-Chain payments</h3>
<table class="table table-sm table-responsive-md">
<thead class="thead-inverse">
<tr>
<th class="firstCol">Crypto</th>
<th>BOLT11</th>
</tr>
</thead>
<tbody>
@foreach (var payment in offchainPayments)
{
<tr>
<td>@payment.Crypto</td>
<td><div class="wraptextAuto">@payment.BOLT11</div></td>
</tr>
}
</tbody>
</table>
</div>
</div>
}