mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Coin switching on no-script invoices
This commit is contained in:
parent
eb5e32a07f
commit
b4b6939498
2 changed files with 58 additions and 32 deletions
|
@ -226,7 +226,7 @@ namespace BTCPayServer.Controllers
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|
||||||
return View(nameof(CheckoutNoScript), model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,37 +13,63 @@
|
||||||
<title>@Model.HtmlTitle</title>
|
<title>@Model.HtmlTitle</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Pay with @Model.StoreName</h1>
|
<h1>Pay with @Model.StoreName</h1>
|
||||||
@if (Model.Status == "new")
|
@if (Model.Status == "new")
|
||||||
{
|
{
|
||||||
<div>
|
<div>
|
||||||
<p>To complete payment, please send <b>@Model.BtcDue @Model.CryptoCode</b> to <b>@Model.BtcAddress</b></p>
|
<p>To complete payment, please send <b>@Model.BtcDue @Model.CryptoCode</b> to <b style="word-break: break-word;">@Model.BtcAddress</b></p>
|
||||||
<p>Time remaining: @Model.TimeLeft</p>
|
<p>Time remaining: @Model.TimeLeft</p>
|
||||||
<p><a href="@Model.InvoiceBitcoinUrl">@Model.InvoiceBitcoinUrl</a></p>
|
<p><a href="@Model.InvoiceBitcoinUrl" style="word-break: break-word;">@Model.InvoiceBitcoinUrl</a></p>
|
||||||
</div>
|
@if (Model.IsLightning)
|
||||||
}
|
{
|
||||||
else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed")
|
<p>Peer Info: <b>@Model.PeerInfo</b></p>
|
||||||
{
|
}
|
||||||
<div>
|
</div>
|
||||||
<p>This invoice has been paid</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else if (Model.Status == "expired" || Model.Status == "invalid")
|
|
||||||
{
|
|
||||||
<div>
|
|
||||||
<p>This invoice has expired</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<div>
|
|
||||||
<p>Non-supported state of invoice</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<hr />
|
@if (Model.AvailableCryptos.Count > 1)
|
||||||
<p>
|
{
|
||||||
<a href="/i/@Model.InvoiceId">Go back to Javascript enabled invoice</a>
|
<div>
|
||||||
</p>
|
<hr />
|
||||||
|
<h2>Pay with:</h2>
|
||||||
|
<ul style="list-style-type: none;padding-left: 5px;">
|
||||||
|
@foreach (var crypto in Model.AvailableCryptos)
|
||||||
|
{
|
||||||
|
<li style="height: 32px; line-height: 32px;">
|
||||||
|
<a href="/invoice-noscript?id=@Model.InvoiceId&paymentMethodId=@crypto.PaymentMethodId">
|
||||||
|
<img alt="@crypto.PaymentMethodName" src="@crypto.CryptoImage" style="vertical-align:middle; height:24px; text-decoration:none; margin-top: -3px;" /></a>
|
||||||
|
<a href="/invoice-noscript?id=@Model.InvoiceId&paymentMethodId=@crypto.PaymentMethodId" style="padding-top: 2px;">
|
||||||
|
@crypto.PaymentMethodName
|
||||||
|
@(crypto.IsLightning ? Html.Raw("⚡") : null)
|
||||||
|
(@crypto.CryptoCode)
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Model.Status == "paid" || Model.Status == "complete" || Model.Status == "confirmed")
|
||||||
|
{
|
||||||
|
<div>
|
||||||
|
<p>This invoice has been paid</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else if (Model.Status == "expired" || Model.Status == "invalid")
|
||||||
|
{
|
||||||
|
<div>
|
||||||
|
<p>This invoice has expired</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div>
|
||||||
|
<p>Non-supported state of invoice</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
<p>
|
||||||
|
<a href="/i/@Model.InvoiceId">Go back to Javascript enabled invoice</a>
|
||||||
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue