@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 hasTotal = Model.CartData.TryGetValue("total", out var total) || Model.CartData.TryGetValue("Total", out total); var hasSubtotal = Model.CartData.TryGetValue("subtotal", out var subtotal) || Model.CartData.TryGetValue("subTotal", out subtotal) || Model.CartData.TryGetValue("Subtotal", out subtotal); var hasDiscount = Model.CartData.TryGetValue("discount", out var discount) || Model.CartData.TryGetValue("Discount", out discount); var hasTip = Model.CartData.TryGetValue("tip", out var tip) || Model.CartData.TryGetValue("Tip", out tip); 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 (hasSubtotal && (hasDiscount || hasTip)) { } if (hasDiscount) { } if (hasTip) { } if (hasTotal) { } } 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

Subtotal @subtotal
Discount @discount
Tip @tip

Total @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) { } }