diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index 08bfb3946..7c24554ee 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -214,7 +214,7 @@ namespace BTCPayServer.Controllers { InvoiceId = i.Id, OrderId = i.Metadata?.OrderId, - OrderUrl = i.Metadata?.OrderUrl, + RedirectUrl = i.RedirectURL?.AbsoluteUri ?? i.Metadata?.OrderUrl, Status = i.Status, Currency = i.Currency, Timestamp = i.InvoiceTime, @@ -250,10 +250,12 @@ namespace BTCPayServer.Controllers receiptData.Remove(key); } } - // assign the rest to additional data + // assign the rest to additional data and remove empty values if (receiptData.Any()) { - vm.AdditionalData = receiptData; + vm.AdditionalData = receiptData + .Where(x => !string.IsNullOrEmpty(x.Value.ToString())) + .ToDictionary(x => x.Key, x => x.Value); } } diff --git a/BTCPayServer/Models/InvoicingModels/InvoiceReceiptViewModel.cs b/BTCPayServer/Models/InvoicingModels/InvoiceReceiptViewModel.cs index 50c85a53a..6d8a64ee1 100644 --- a/BTCPayServer/Models/InvoicingModels/InvoiceReceiptViewModel.cs +++ b/BTCPayServer/Models/InvoicingModels/InvoiceReceiptViewModel.cs @@ -20,6 +20,6 @@ namespace BTCPayServer.Models.InvoicingModels public Dictionary CartData { get; set; } public ReceiptOptions ReceiptOptions { get; set; } public List Payments { get; set; } - public string OrderUrl { get; set; } + public string RedirectUrl { get; set; } } } diff --git a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs index effb55267..2904c6f41 100644 --- a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs +++ b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs @@ -348,11 +348,9 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers var receiptData = new JObject(); if (choice is not null) { - receiptData = JObject.FromObject(new Dictionary - { - {"Title", choice.Title}, - {"Description", choice.Description}, - }); + var dict = new Dictionary { { "Title", choice.Title } }; + if (!string.IsNullOrEmpty(choice.Description)) dict["Description"] = choice.Description; + receiptData = JObject.FromObject(dict); } else if (jposData is not null) { diff --git a/BTCPayServer/Views/UIInvoice/InvoiceReceipt.cshtml b/BTCPayServer/Views/UIInvoice/InvoiceReceipt.cshtml index 8eee5336d..3dc58d4c6 100644 --- a/BTCPayServer/Views/UIInvoice/InvoiceReceipt.cshtml +++ b/BTCPayServer/Views/UIInvoice/InvoiceReceipt.cshtml @@ -173,9 +173,9 @@ } } - @if (!string.IsNullOrEmpty(Model.OrderUrl)) + @if (!string.IsNullOrEmpty(Model.RedirectUrl)) { - Return to @(string.IsNullOrEmpty(Model.StoreName) ? "store" : Model.StoreName) + Return to @(string.IsNullOrEmpty(Model.StoreName) ? "store" : Model.StoreName) }