From b4b69394983bf1ee0b5771ff91953a1d9056c15c Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 4 Apr 2019 21:48:52 -0500 Subject: [PATCH] Coin switching on no-script invoices --- .../Controllers/InvoiceController.UI.cs | 2 +- .../Views/Invoice/CheckoutNoScript.cshtml | 88 ++++++++++++------- 2 files changed, 58 insertions(+), 32 deletions(-) diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 7e1a73256..9305fcab8 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -226,7 +226,7 @@ namespace BTCPayServer.Controllers if (model == null) return NotFound(); - return View(nameof(CheckoutNoScript), model); + return View(model); } diff --git a/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml b/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml index 3d74bcd69..6eddbd242 100644 --- a/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml +++ b/BTCPayServer/Views/Invoice/CheckoutNoScript.cshtml @@ -13,37 +13,63 @@ @Model.HtmlTitle -

Pay with @Model.StoreName

- @if (Model.Status == "new") - { -
-

To complete payment, please send @Model.BtcDue @Model.CryptoCode to @Model.BtcAddress

-

Time remaining: @Model.TimeLeft

-

@Model.InvoiceBitcoinUrl

-
- } - else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed") - { -
-

This invoice has been paid

-
- } - else if (Model.Status == "expired" || Model.Status == "invalid") - { -
-

This invoice has expired

-
- } - else - { -
-

Non-supported state of invoice

-
- } +

Pay with @Model.StoreName

+ @if (Model.Status == "new") + { +
+

To complete payment, please send @Model.BtcDue @Model.CryptoCode to @Model.BtcAddress

+

Time remaining: @Model.TimeLeft

+

@Model.InvoiceBitcoinUrl

+ @if (Model.IsLightning) + { +

Peer Info: @Model.PeerInfo

+ } +
-
-

- Go back to Javascript enabled invoice -

+ @if (Model.AvailableCryptos.Count > 1) + { +
+
+

Pay with:

+ +
+ } + } + else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed") + { +
+

This invoice has been paid

+
+ } + else if (Model.Status == "expired" || Model.Status == "invalid") + { +
+

This invoice has expired

+
+ } + else + { +
+

Non-supported state of invoice

+
+ } + +
+

+ Go back to Javascript enabled invoice +