2020-11-08 03:29:36 +01:00
|
|
|
@using System.Text.RegularExpressions
|
2020-04-27 12:55:46 +02:00
|
|
|
@model StoreViewModel
|
2017-09-13 16:50:36 +02:00
|
|
|
@{
|
2017-10-27 10:53:04 +02:00
|
|
|
Layout = "../Shared/_NavLayout.cshtml";
|
2021-04-08 15:32:42 +02:00
|
|
|
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "General Settings", Context.GetStoreData().StoreName);
|
2020-07-22 15:28:31 +02:00
|
|
|
}
|
|
|
|
|
2017-09-13 16:50:36 +02:00
|
|
|
<div class="row">
|
2020-10-23 17:15:07 +02:00
|
|
|
<div class="col-lg-10 col-xl-9">
|
2021-04-08 15:32:42 +02:00
|
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
|
|
{
|
|
|
|
<div asp-validation-summary="All" class="text-danger"></div>
|
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
<div class="mb-5">
|
2020-12-02 07:45:00 +01:00
|
|
|
<h4 class="mb-3">Wallet</h4>
|
2020-10-23 20:04:13 +02:00
|
|
|
@if (Model.HintWallet)
|
|
|
|
{
|
2020-12-02 07:45:00 +01:00
|
|
|
<p>Set up your wallet to receive payments at your store.</p>
|
2020-10-23 20:04:13 +02:00
|
|
|
}
|
|
|
|
<ul class="list-group mb-3">
|
2020-10-23 17:15:07 +02:00
|
|
|
@foreach (var scheme in Model.DerivationSchemes.OrderBy(scheme => scheme.Collapsed))
|
|
|
|
{
|
2020-12-08 15:32:04 +01:00
|
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Value);
|
|
|
|
|
2020-12-02 07:45:00 +01:00
|
|
|
<li class="list-group-item bg-tile @(scheme.Collapsed ? "collapsed": "")">
|
2020-12-08 15:32:04 +01:00
|
|
|
<div class="d-flex align-items-center">
|
|
|
|
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
|
2021-05-19 04:39:27 +02:00
|
|
|
<strong class="me-3">@scheme.Crypto</strong>
|
2020-12-08 15:32:04 +01:00
|
|
|
@if (isSetUp)
|
2020-10-23 20:04:13 +02:00
|
|
|
{
|
2021-05-19 04:39:27 +02:00
|
|
|
<span title="@scheme.Value" data-bs-toggle="tooltip" class="d-flex me-3">
|
2020-12-08 15:32:04 +01:00
|
|
|
<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>
|
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
</span>
|
|
|
|
@if (scheme.WalletSupported)
|
2020-10-23 17:15:07 +02:00
|
|
|
{
|
2021-05-19 04:39:27 +02:00
|
|
|
<a asp-action="WalletTransactions" asp-controller="Wallets" asp-route-walletId="@scheme.WalletId" class="text-secondary me-3">Manage Wallet</a>
|
2020-10-23 17:15:07 +02:00
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
}
|
|
|
|
</span>
|
2020-12-09 09:45:25 +01:00
|
|
|
<span class="d-flex align-items-center fw-semibold">
|
2020-12-08 15:32:04 +01:00
|
|
|
@if (isSetUp)
|
2020-12-02 07:45:00 +01:00
|
|
|
{
|
2021-04-26 22:28:24 +02:00
|
|
|
<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">
|
2021-05-19 04:39:27 +02:00
|
|
|
<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>
|
2021-04-26 22:28:24 +02:00
|
|
|
@if (scheme.Enabled)
|
|
|
|
{
|
|
|
|
<span class="text-primary">
|
|
|
|
Enabled
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span class="text-muted">
|
|
|
|
Disabled
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
</form>
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="text-light ms-3 me-2">|</span>
|
2021-04-16 15:31:09 +02:00
|
|
|
<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">
|
2021-02-11 11:48:54 +01:00
|
|
|
Modify
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-19 04:39:27 +02:00
|
|
|
<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">
|
2021-02-11 11:48:54 +01:00
|
|
|
Setup
|
|
|
|
</a>
|
2020-12-02 07:45:00 +01:00
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-10-23 17:15:07 +02:00
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
</ul>
|
|
|
|
@if (Model.DerivationSchemes.Any(scheme => scheme.Collapsed))
|
|
|
|
{
|
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(".collapsed").hide();
|
|
|
|
$("#toggle-assets").click(function () {
|
|
|
|
$(".collapsed").show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</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>
|
2020-10-16 01:20:23 +02:00
|
|
|
|
2020-10-23 20:04:13 +02:00
|
|
|
<div class="mb-5">
|
2020-12-02 07:45:00 +01:00
|
|
|
<h4 class="mb-3">Lightning</h4>
|
2020-10-23 20:04:13 +02:00
|
|
|
@if (Model.HintLightning)
|
|
|
|
{
|
2020-12-02 07:45:00 +01:00
|
|
|
<p>A connection to a Lightning node is required to receive Lightning payments.</p>
|
2020-10-23 20:04:13 +02:00
|
|
|
}
|
|
|
|
<ul class="list-group mb-3">
|
2020-10-23 17:15:07 +02:00
|
|
|
@foreach (var scheme in Model.LightningNodes)
|
|
|
|
{
|
2020-12-08 15:32:04 +01:00
|
|
|
var isSetUp = !string.IsNullOrWhiteSpace(scheme.Address);
|
|
|
|
|
2020-12-02 07:45:00 +01:00
|
|
|
<li class="list-group-item bg-tile">
|
2020-12-08 15:32:04 +01:00
|
|
|
<div class="d-flex align-items-center">
|
|
|
|
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
|
2021-05-19 04:39:27 +02:00
|
|
|
<strong class="me-3">@scheme.CryptoCode</strong>
|
2020-12-08 15:32:04 +01:00
|
|
|
@if (isSetUp)
|
2020-10-23 20:04:13 +02:00
|
|
|
{
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="smMaxWidth text-truncate text-secondary me-3">@scheme.Address</span>
|
2021-04-20 12:23:50 +02:00
|
|
|
<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>
|
2020-10-23 20:04:13 +02:00
|
|
|
}
|
|
|
|
</span>
|
2020-12-09 09:45:25 +01:00
|
|
|
<span class="d-flex align-items-center fw-semibold">
|
2020-12-08 15:32:04 +01:00
|
|
|
@if (isSetUp)
|
2020-12-02 07:45:00 +01:00
|
|
|
{
|
2021-04-26 22:28:24 +02:00
|
|
|
<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">
|
2021-05-19 04:39:27 +02:00
|
|
|
<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>
|
2021-04-26 22:28:24 +02:00
|
|
|
@if (scheme.Enabled)
|
|
|
|
{
|
|
|
|
<span class="text-primary">
|
|
|
|
Enabled
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span class="text-muted">
|
|
|
|
Disabled
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
</form>
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="text-light ms-3 me-2">|</span>
|
2020-12-02 07:45:00 +01:00
|
|
|
}
|
2021-05-19 04:39:27 +02:00
|
|
|
<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">
|
2020-12-08 15:32:04 +01:00
|
|
|
@(isSetUp ? "Modify" : "Setup")
|
2020-10-23 20:04:13 +02:00
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-10-23 17:15:07 +02:00
|
|
|
}
|
2020-10-23 20:04:13 +02:00
|
|
|
</ul>
|
2020-10-23 17:15:07 +02:00
|
|
|
</div>
|
2020-10-16 01:20:23 +02:00
|
|
|
|
2021-04-08 15:32:42 +02:00
|
|
|
<form method="post">
|
2020-10-23 17:15:07 +02:00
|
|
|
<h4 class="mb-3">General</h4>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Id"></label>
|
|
|
|
<input asp-for="Id" readonly class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="StoreName"></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"></label>
|
|
|
|
<input asp-for="StoreWebsite" class="form-control" />
|
|
|
|
<span asp-validation-for="StoreWebsite" class="text-danger"></span>
|
|
|
|
</div>
|
2020-10-16 01:20:23 +02:00
|
|
|
|
2020-10-23 17:15:07 +02:00
|
|
|
<h4 class="mt-5 mb-3">Payment</h4>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-check">
|
|
|
|
<input asp-for="AnyoneCanCreateInvoice" type="checkbox" class="form-check-input" />
|
|
|
|
<label asp-for="AnyoneCanCreateInvoice" class="form-check-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#allow-anyone-to-create-invoice" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2020-10-16 06:04:44 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-check">
|
|
|
|
<input asp-for="PayJoinEnabled" type="checkbox" class="form-check-input" />
|
|
|
|
<label asp-for="PayJoinEnabled" class="form-check-label"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/Payjoin/" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2020-10-23 17:15:07 +02:00
|
|
|
<span asp-validation-for="PayJoinEnabled" class="text-danger"></span>
|
2020-10-16 06:04:44 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="NetworkFeeMode"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#add-network-fee-to-invoice-vary-with-mining-fees" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2021-05-19 04:39:27 +02:00
|
|
|
<select asp-for="NetworkFeeMode" class="form-select">
|
2020-10-23 17:15:07 +02:00
|
|
|
<option value="MultiplePaymentsOnly">... only if the customer makes more than one payment for the invoice</option>
|
|
|
|
<option value="Always">... on every payment</option>
|
|
|
|
<option value="Never">Never add network fee</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="mb-2">
|
|
|
|
<label asp-for="InvoiceExpiration" class="d-inline"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#invoice-expires-if-the-full-amount-has-not-been-paid-after-minutes" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2020-10-16 06:04:44 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<input asp-for="InvoiceExpiration" class="form-control" style="max-width:10ch;" />
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="input-group-text">minutes</span>
|
2020-07-22 15:31:09 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<span asp-validation-for="InvoiceExpiration" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="mb-2">
|
|
|
|
<label asp-for="MonitoringExpiration" class="d-inline"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#payment-invalid-if-transactions-fails-to-confirm-minutes-after-invoice-expiration" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2019-11-08 04:54:46 +01:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<input asp-for="MonitoringExpiration" class="form-control" style="max-width:10ch;" />
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="input-group-text">minutes</span>
|
2020-04-06 10:11:10 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<span asp-validation-for="MonitoringExpiration" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="mb-2">
|
|
|
|
<label asp-for="PaymentTolerance" class="d-inline"></label>
|
2021-04-08 15:32:42 +02:00
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#consider-the-invoice-paid-even-if-the-paid-amount-is-less-than-expected" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
|
|
|
</a>
|
2020-04-06 10:11:10 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<div class="input-group">
|
|
|
|
<input asp-for="PaymentTolerance" class="form-control" style="max-width:10ch;" />
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="input-group-text">percent</span>
|
2020-04-06 10:11:10 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<span asp-validation-for="PaymentTolerance" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="mb-2">
|
|
|
|
<label asp-for="SpeedPolicy" class="d-inline"></label>
|
|
|
|
<a href="https://docs.btcpayserver.org/FAQ/FAQ-Stores/#consider-the-invoice-confirmed-when-the-payment-transaction" target="_blank">
|
2021-04-08 15:32:42 +02:00
|
|
|
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
|
2020-10-23 17:15:07 +02:00
|
|
|
</a>
|
2020-10-21 10:45:24 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
<script>
|
|
|
|
function handleSpeedPolicyChange(select) {
|
|
|
|
document.getElementById('unconfirmed-warning').hidden = select.value !== '0';
|
|
|
|
}
|
|
|
|
</script>
|
2021-05-19 04:39:27 +02:00
|
|
|
<select asp-for="SpeedPolicy" class="form-select w-auto" onchange="handleSpeedPolicyChange(this)">
|
2020-10-23 17:15:07 +02:00
|
|
|
<option value="0">Is unconfirmed</option>
|
|
|
|
<option value="1">Has at least 1 confirmation</option>
|
|
|
|
<option value="3">Has at least 2 confirmations</option>
|
|
|
|
<option value="2">Has at least 6 confirmations</option>
|
|
|
|
</select>
|
|
|
|
<div class="alert alert-warning my-2" hidden="@(Model.SpeedPolicy != 0)" id="unconfirmed-warning" role="alert">
|
|
|
|
Choosing to accept an unconfirmed invoice can lead to double-spending and is strongly discouraged.
|
|
|
|
</div>
|
|
|
|
<span asp-validation-for="SpeedPolicy" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="LightningDescriptionTemplate"></label>
|
|
|
|
<input asp-for="LightningDescriptionTemplate" class="form-control" />
|
|
|
|
<span asp-validation-for="LightningDescriptionTemplate" class="text-danger"></span>
|
|
|
|
<p class="form-text text-muted">
|
|
|
|
Available placeholders:
|
|
|
|
<code>{StoreName} {ItemDescription} {OrderId}</code>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button name="command" type="submit" class="btn btn-primary" value="Save" id="Save">Save Store Settings</button>
|
|
|
|
</form>
|
2018-01-08 14:45:09 +01:00
|
|
|
|
2020-10-23 17:15:07 +02:00
|
|
|
<h4 class="mt-5 mb-3">Services</h4>
|
|
|
|
<div class="table-responsive-md">
|
|
|
|
<table class="table table-sm mt-1 mb-5">
|
2020-04-06 10:11:10 +02:00
|
|
|
<thead>
|
2020-10-23 17:15:07 +02:00
|
|
|
<tr>
|
|
|
|
<th>Service</th>
|
2021-05-19 04:39:27 +02:00
|
|
|
<th class="text-end w-100px">Actions</th>
|
2020-10-23 17:15:07 +02:00
|
|
|
</tr>
|
2020-10-16 01:20:23 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-10-23 17:15:07 +02:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Email
|
|
|
|
</td>
|
2021-05-19 04:39:27 +02:00
|
|
|
<td class="text-end">
|
2020-10-23 17:15:07 +02:00
|
|
|
<a asp-action="Emails" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
|
|
|
Setup
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2020-04-06 10:11:10 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-10-16 06:04:44 +02:00
|
|
|
</div>
|
2020-10-23 17:15:07 +02:00
|
|
|
|
|
|
|
@if (Model.CanDelete)
|
|
|
|
{
|
|
|
|
<h4 class="mt-5 mb-3">Other actions</h4>
|
2021-05-19 04:39:27 +02:00
|
|
|
<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">
|
2020-10-23 17:15:07 +02:00
|
|
|
See more actions
|
|
|
|
</button>
|
|
|
|
<div id="danger-zone" class="collapse">
|
2020-11-06 12:42:26 +01:00
|
|
|
<a id="delete-store" class="btn btn-outline-danger mb-5" asp-action="DeleteStore" asp-route-storeId="@Model.Id">Delete this store</a>
|
2020-10-23 17:15:07 +02:00
|
|
|
</div>
|
|
|
|
}
|
2017-10-27 10:53:04 +02:00
|
|
|
</div>
|
2017-09-13 16:50:36 +02:00
|
|
|
</div>
|
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
@section PageFootContent {
|
2021-04-08 15:32:42 +02:00
|
|
|
<partial name="_ValidationScriptsPartial" />
|
2017-09-13 16:50:36 +02:00
|
|
|
}
|