mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-01 17:07:10 +01:00
* LNURL Payment Method Support
* Merge recent Lightning controller related changes
* Fix build
* Create separate payment settings section for stores
* Improve LNURL configuration
* Prevent duplicate array entries when merging Swagger JSON
* Fix CanSetPaymentMethodLimitsLightning
* Fix CanUsePayjoinViaUI
* Adapt test for new cancel bolt invoice feature
* rebase fixes
* Fixes after rebase
* Test fixes
* Do not turn LNURL on by default, Off-Chain payment criteria should affects both BOLT11 and LNURL, Payment criteria of unset payment method shouldn't be shown
* Send better error if payment method not found
* Revert "Prevent duplicate array entries when merging Swagger JSON"
This reverts commit 5783db9eda
.
* Fix LNUrl doc
* Fix some warnings
Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
230 lines
12 KiB
Text
230 lines
12 KiB
Text
@using System.Text.RegularExpressions
|
|
@model StoreViewModel
|
|
@{
|
|
Layout = "../Shared/_NavLayout.cshtml";
|
|
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "General Settings", Context.GetStoreData().StoreName);
|
|
}
|
|
|
|
<div class="row">
|
|
<div class="col-lg-10 col-xl-9">
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
{
|
|
<div asp-validation-summary="All" class="text-danger"></div>
|
|
}
|
|
<div class="mb-5">
|
|
<h4 class="mb-3">Wallet</h4>
|
|
@if (Model.HintWallet)
|
|
{
|
|
<p>Set up your wallet to receive payments at your store.</p>
|
|
}
|
|
<ul class="list-group mb-3">
|
|
@foreach (var scheme in Model.DerivationSchemes.OrderBy(scheme => scheme.Collapsed))
|
|
{
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Value);
|
|
|
|
<li class="list-group-item bg-tile @(scheme.Collapsed ? "assets-collapsed": "")">
|
|
<div class="d-flex align-items-center">
|
|
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
|
|
<strong class="me-3">@scheme.Crypto</strong>
|
|
@if (isSetUp)
|
|
{
|
|
<span title="@scheme.Value" data-bs-toggle="tooltip" class="d-flex me-3">
|
|
<span class="text-truncate text-secondary" style="max-width:8ch">@scheme.Value</span>
|
|
@if (scheme.Value.Length > 20)
|
|
{
|
|
<span class="text-nowrap text-secondary">@Regex.Match(scheme.Value, @"((?:-\[(?:[^\]])+\])+|\S{6})$").Value</span>
|
|
}
|
|
</span>
|
|
@if (scheme.WalletSupported)
|
|
{
|
|
<a asp-action="WalletTransactions" asp-controller="Wallets" asp-route-walletId="@scheme.WalletId" class="text-secondary me-3">Manage Wallet</a>
|
|
}
|
|
}
|
|
</span>
|
|
<span class="d-flex align-items-center fw-semibold">
|
|
@if (isSetUp)
|
|
{
|
|
<form method="post"
|
|
asp-action="SetWalletEnabled"
|
|
asp-route-cryptoCode="@scheme.Crypto"
|
|
asp-route-storeId="@Model.Id"
|
|
class="d-flex align-items-center"
|
|
style="min-width:7.65rem">
|
|
<button type="submit" class="btcpay-toggle me-2 @if (scheme.Enabled) { @("btcpay-toggle--active") }" name="Enabled" value="@(scheme.Enabled ? "false" : "true")" id="@($"{scheme.Crypto}WalletEnabled")">@(scheme.Enabled ? "Disable" : "Enable")</button>
|
|
@if (scheme.Enabled)
|
|
{
|
|
<span class="text-primary">
|
|
Enabled
|
|
</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">
|
|
Disabled
|
|
</span>
|
|
}
|
|
</form>
|
|
<span class="text-light ms-3 me-2">|</span>
|
|
<a asp-action="ModifyWallet" asp-route-cryptoCode="@scheme.Crypto" asp-route-storeId="@Model.Id" id="@($"Modify{scheme.Crypto}")" class="btn btn-link px-1 py-1 fw-semibold">
|
|
Modify
|
|
</a>
|
|
}
|
|
else
|
|
{
|
|
<a asp-action="SetupWallet" asp-route-cryptoCode="@scheme.Crypto" asp-route-storeId="@Model.Id" id="@($"Modify{scheme.Crypto}")" class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold">
|
|
Setup
|
|
</a>
|
|
}
|
|
</span>
|
|
</div>
|
|
</li>
|
|
}
|
|
</ul>
|
|
@if (Model.DerivationSchemes.Any(scheme => scheme.Collapsed))
|
|
{
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
var collapsed = document.getElementsByClassName("assets-collapsed");
|
|
for (let collapsedElement of collapsed) {
|
|
collapsedElement.style.display = 'none';
|
|
}
|
|
document
|
|
.getElementById("toggle-assets")
|
|
.addEventListener("click", function (){
|
|
var collapsed = document.getElementsByClassName("assets-collapsed");
|
|
for (let collapsedElement of collapsed) {
|
|
collapsedElement.style.display = 'block';
|
|
}
|
|
document.getElementById("toggle-assets").style.display="none";
|
|
});
|
|
});
|
|
</script>
|
|
<button class="btn btn-link text-secondary mb-3 p-0 only-for-js" id="toggle-assets" type="button">Show additional assets</button>
|
|
}
|
|
</div>
|
|
|
|
<div class="mb-5">
|
|
<h4 class="mb-3">Lightning</h4>
|
|
@if (Model.HintLightning)
|
|
{
|
|
<p>A connection to a Lightning node is required to receive Lightning payments.</p>
|
|
}
|
|
<ul class="list-group mb-3">
|
|
@foreach (var scheme in Model.LightningNodes)
|
|
{
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Address);
|
|
|
|
<li class="list-group-item bg-tile">
|
|
<div class="d-flex align-items-center">
|
|
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
|
|
<strong class="me-3">@scheme.CryptoCode</strong>
|
|
@if (isSetUp)
|
|
{
|
|
<span class="smMaxWidth text-truncate text-secondary me-3">@scheme.Address</span>
|
|
<a class="text-secondary"
|
|
asp-controller="PublicLightningNodeInfo"
|
|
asp-action="ShowLightningNodeInfo"
|
|
asp-route-cryptoCode="@scheme.CryptoCode"
|
|
asp-route-storeId="@Model.Id"
|
|
target="_blank">
|
|
Public Node Info
|
|
</a>
|
|
}
|
|
</span>
|
|
<span class="d-flex align-items-center fw-semibold">
|
|
@if (isSetUp)
|
|
{
|
|
<form method="post"
|
|
asp-action="SetLightningNodeEnabled"
|
|
asp-route-cryptoCode="@scheme.CryptoCode"
|
|
asp-route-storeId="@Model.Id"
|
|
class="d-flex align-items-center"
|
|
style="min-width:7.65rem">
|
|
<button type="submit" class="btcpay-toggle me-2 @if (scheme.Enabled) { @("btcpay-toggle--active") }" name="Enabled" value="@(scheme.Enabled ? "false" : "true")" id="@($"{scheme.CryptoCode}LightningEnabled")">@(scheme.Enabled ? "Disable" : "Enable")e</button>
|
|
@if (scheme.Enabled)
|
|
{
|
|
<span class="text-primary">
|
|
Enabled
|
|
</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="text-muted">
|
|
Disabled
|
|
</span>
|
|
}
|
|
</form>
|
|
<span class="text-light ms-3 me-2">|</span>
|
|
}
|
|
<a asp-action="SetupLightningNode" asp-route-cryptoCode="@scheme.CryptoCode" asp-route-storeId="@Model.Id" id="@($"Modify-Lightning{scheme.CryptoCode}")" class="btn btn-@(isSetUp ? "link px-1" : "primary btn-sm ms-4 px-3") py-1 fw-semibold">
|
|
@(isSetUp ? "Modify" : "Setup")
|
|
</a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
|
|
<form method="post">
|
|
<h4 class="mb-3">General</h4>
|
|
<div class="form-group">
|
|
<label asp-for="Id" class="form-label"></label>
|
|
<input asp-for="Id" readonly class="form-control" />
|
|
</div>
|
|
<div class="form-group">
|
|
<label asp-for="StoreName" class="form-label"></label>
|
|
<input asp-for="StoreName" class="form-control" />
|
|
<span asp-validation-for="StoreName" class="text-danger"></span>
|
|
</div>
|
|
<div class="form-group">
|
|
<label asp-for="StoreWebsite" class="form-label"></label>
|
|
<input asp-for="StoreWebsite" class="form-control" />
|
|
<span asp-validation-for="StoreWebsite" class="text-danger"></span>
|
|
</div>
|
|
|
|
<button name="command" type="submit" class="btn btn-primary" value="Save" id="Save">Save Store Settings</button>
|
|
</form>
|
|
|
|
<h4 class="mt-5 mb-3">Services</h4>
|
|
<div class="table-responsive-md">
|
|
<table class="table table-hover mt-1 mb-5">
|
|
<thead>
|
|
<tr>
|
|
<th>Service</th>
|
|
<th class="text-end w-100px">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
Email
|
|
</td>
|
|
<td class="text-end">
|
|
<a asp-action="Emails" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
|
Setup
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
@if (Model.CanDelete)
|
|
{
|
|
<h4 class="mt-5 mb-3">Other actions</h4>
|
|
<button id="danger-zone-expander" class="btn btn-link text-secondary mb-3 p-0" type="button" data-bs-toggle="collapse" data-bs-target="#danger-zone">
|
|
See more actions
|
|
</button>
|
|
<div id="danger-zone" class="collapse">
|
|
<a id="delete-store" class="btn btn-outline-danger mb-5" asp-action="DeleteStore" asp-route-storeId="@Model.Id" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="The store <strong>@Model.StoreName</strong> will be permanently deleted. This action will also delete all invoices, apps and data associated with the store.">Delete this store</a>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
<partial name="_Confirm" model="@(new ConfirmModel("Delete store", "The store will be permanently deleted. This action will also delete all invoices, apps and data associated with the store.", "Delete"))" />
|
|
|
|
@section PageFootContent {
|
|
<partial name="_ValidationScriptsPartial" />
|
|
}
|