@using System.Globalization @using BTCPayServer.Payments @using BTCPayServer.Payments.Bitcoin @model IEnumerable @{ PayjoinInformation payjoinIformation = null; 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; var network = payment.Network as BTCPayNetwork; if (confirmationCount >= network.MaxTrackedConfirmation) { m.Confirmations = "At least " + (network.MaxTrackedConfirmation); } else { m.Confirmations = confirmationCount.ToString(CultureInfo.InvariantCulture); } if (onChainPaymentData?.PayjoinInformation is PayjoinInformation pj) { payjoinIformation = pj; m.AdditionalInformation = "Original tranasaction"; } if (payjoinIformation is PayjoinInformation && payjoinIformation.CoinjoinTransactionHash == onChainPaymentData?.Outpoint.Hash) { m.AdditionalInformation = "Payjoin transaction"; } 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; m.CryptoPaymentData = onChainPaymentData; return m; }); } @if (onchainPayments.Any()) {

On-Chain payments

@foreach (var payment in onchainPayments) { }
Crypto Deposit address Amount Transaction Id Confirmations
@payment.Crypto @payment.DepositAddress @payment.CryptoPaymentData.GetValue() @Safe.Raw(payment.AdditionalInformation is string i ? $"
({i})" : string.Empty)
@payment.Confirmations
}