@model BTCPayServer.Models.InvoicingModels.InvoiceReceiptViewModel @using BTCPayServer.Client.Models @using BTCPayServer.Components.QRCode @using BTCPayServer.Services @inject DisplayFormatter DisplayFormatter @{ Layout = null; ViewData["Title"] = $"Receipt from {Model.StoreName}"; var isProcessing = Model.Status == InvoiceStatus.Processing; var isFreeInvoice = (Model.Status == InvoiceStatus.New && Model.Amount == 0); var isSettled = Model.Status == InvoiceStatus.Settled; } @ViewData["Title"] @* CSS *@ @if (isProcessing) { } else if (isFreeInvoice) { }
@if (isProcessing) {
The invoice has detected a payment but is still waiting to be settled.
} else if (!isSettled) {
The invoice is not settled.
} else { var hasCart = Model.CartData?.Any() is true;
@if (!string.IsNullOrEmpty(Model.OrderId)) {
Order ID: @Model.OrderId
} @Model.Timestamp.ToBrowserDate()
@if (Model.AdditionalData?.Any() is true) { @foreach (var (key, value) in Model.AdditionalData) { } } @if (hasCart) { _ = Model.CartData.TryGetValue("cart", out var cart) || Model.CartData.TryGetValue("Cart", out cart); var posData = WellKnownPosData.TryParse(Model.CartData) ?? new(); if (cart is Dictionary { Keys.Count: > 0 } cartDict) { @foreach (var (key, value) in cartDict) { } } else if (cart is ICollection { Count: > 0 } cartCollection) { @foreach (var value in cartCollection) { } } @if (posData.ItemsTotal != null) { } @if (posData.Discount != null) { } @if (posData.Subtotal != null) { } @if (posData.Tax != null) { } @if (posData.Tip != null) { } @if (posData.Total != null) { } } else { } @if (Model.Payments?.Any() is true) { @for (var i = 0; i < Model.Payments.Count; i++) { var payment = Model.Payments[i]; @if (Model.Payments.Count > 1) { } @if (!string.IsNullOrEmpty(payment.Destination)) { } @if (!string.IsNullOrEmpty(payment.PaymentProof)) { } } }
@key @value

@key @value
@value
Items total @posData.ItemsTotal
Discount @posData.Discount
Subtotal @posData.Subtotal
Tax @posData.Tax
Tip @posData.Tip

Total @posData.Total
Total @DisplayFormatter.Currency(Model.Amount, Model.Currency, DisplayFormatter.CurrencyFormat.Symbol)

Payment @(i + 1)
Received @payment.ReceivedDate.ToBrowserDate()
@(Model.Payments.Count == 1 ? "Paid" : "") @payment.AmountFormatted
@payment.PaidFormatted
Rate @payment.RateFormatted
Destination @if (payment.Destination.Length > 69) { @payment.Destination[..19] ... @payment.Destination.Substring(payment.Destination.Length - 20, 20) } else { @payment.Destination }
Pay Proof @payment.PaymentProof

if (Model.ReceiptOptions.ShowQR is true) { } }