2019-01-14 22:43:29 +01:00
@using BTCPayServer.Services.PaymentRequests
2022-11-18 05:24:57 +01:00
@using Microsoft.AspNetCore.Html
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using BTCPayServer.Components
2019-01-14 22:43:29 +01:00
@model BTCPayServer.Models.PaymentRequestViewModels.ListPaymentRequestsViewModel
@{
Layout = "_Layout";
2019-11-15 14:43:36 +01:00
ViewData["Title"] = "Payment Requests";
2019-01-14 22:43:29 +01:00
}
2021-04-08 15:32:42 +02:00
2022-02-21 03:05:42 +01:00
<div class="sticky-header-setup"></div>
<div class="sticky-header d-sm-flex align-items-center justify-content-between">
2021-12-11 04:32:23 +01:00
<h2 class="mb-0">
@ViewData["Title"]
2023-02-13 00:25:24 -08:00
<a href="#descriptor" data-bs-toggle="collapse">
<vc:icon symbol="info" />
</a>
2021-12-11 04:32:23 +01:00
</h2>
<a asp-action="EditPaymentRequest" asp-route-storeId="@Context.GetStoreData().Id" class="btn btn-primary mt-3 mt-sm-0" role="button" id="CreatePaymentRequest">
<span class="fa fa-plus"></span>
2021-12-27 22:54:31 -08:00
Create Payment Request
2021-12-11 04:32:23 +01:00
</a>
</div>
2020-07-19 16:49:13 -05:00
2023-02-13 00:25:24 -08:00
<div id="descriptor" class="collapse">
<div class="d-flex px-4 py-4 mb-4 bg-tile rounded">
<div class="flex-fill">
<p class="mb-2">Payment requests are persistent shareable pages that enable the receiver to pay at their convenience. Funds are paid to a payment request at the current exchange rate.</p>
<p class="mb-3">Requests may be paid in partial. They will remain valid until time expires or when paid what is due.</p>
<a href="https://docs.btcpayserver.org/PaymentRequests/" target="_blank" rel="noreferrer noopener">Learn More</a>
</div>
<button type="button" class="btn-close ms-auto" data-bs-toggle="collapse" data-bs-target="#descriptor" aria-expanded="false" aria-label="Close">
<vc:icon symbol="close" />
</button>
</div>
</div>
2022-02-21 03:05:42 +01:00
<partial name="_StatusMessage" />
2022-01-11 05:16:16 -08:00
<div class="row mb-2">
<div class="col col-lg-8 col-xl-6 mr-auto">
2021-12-11 04:32:23 +01:00
<form asp-action="GetPaymentRequests" method="get">
2023-02-13 00:25:24 -08:00
<input type="hidden" asp-for="Count" />
2021-12-11 04:32:23 +01:00
<input type="hidden" asp-for="TimezoneOffset" />
<div class="input-group">
2022-01-11 05:16:16 -08:00
<input asp-for="SearchTerm" class="form-control" />
<button type="submit" class="btn btn-secondary text-nowrap" title="Search invoice">
2021-12-11 04:32:23 +01:00
<span class="fa fa-search"></span> Search
</button>
2022-02-09 15:37:15 +01:00
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="SearchDropdownToggle">
2021-12-11 04:32:23 +01:00
<span class="visually-hidden">Toggle Dropdown</span>
</button>
2022-02-09 15:37:15 +01:00
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="SearchDropdownToggle">
<a class="dropdown-item" asp-action="GetPaymentRequests" asp-route-storeId="@Context.GetStoreData().Id" asp-route-count="@Model.Count" asp-route-searchTerm="includearchived:true" id="SearchIncludeArchived">Include Archived</a>
2021-12-11 04:32:23 +01:00
<div role="separator" class="dropdown-divider"></div>
2022-02-09 15:37:15 +01:00
<a class="dropdown-item" href="?searchTerm=" id="SearchUnfiltered">Unfiltered</a>
2021-12-11 04:32:23 +01:00
</div>
2019-01-14 22:43:29 +01:00
</div>
2021-12-11 04:32:23 +01:00
<span asp-validation-for="SearchTerm" class="text-danger"></span>
</form>
</div>
</div>
2020-08-24 06:57:07 +02:00
2021-12-11 04:32:23 +01:00
<div class="row">
<div class="col-lg-12">
2022-05-02 16:35:28 +09:00
@if (Model.Items.Count > 0)
2021-12-11 04:32:23 +01:00
{
<table class="table table-hover table-responsive-md">
<thead>
<tr>
<th>Title</th>
2022-11-18 05:24:57 +01:00
<th class="w-150px">
<div class="d-flex align-items-center gap-1">
Expiry
<button type="button" class="btn btn-link p-0 fa fa-clock-o switch-time-format only-for-js" title="Switch date format"></button>
</div>
</th>
<th>Status</th>
<th class="text-end">Amount</th>
2021-12-11 04:32:23 +01:00
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr>
2022-06-19 19:52:12 -07:00
<td>
<a asp-action="EditPaymentRequest" asp-route-storeId="@item.StoreId" asp-route-payReqId="@item.Id" id="Edit-@item.Id">@item.Title</a>
</td>
2022-11-18 05:24:57 +01:00
<td>
@(item.ExpiryDate?.ToBrowserDate() ?? new HtmlString($"<span class=\"text-muted\">No Expiry</span>"))
</td>
<td>
<span class="badge badge-@item.Status.ToLower()">@item.Status</span>
</td>
2023-05-11 10:35:51 +02:00
<td class="text-end">
<span data-sensitive>@item.AmountFormatted</span>
</td>
2021-12-11 04:32:23 +01:00
<td class="text-end">
2022-09-16 21:04:56 -07:00
<a asp-controller="UIInvoice" asp-action="ListInvoices" asp-route-storeId="@item.StoreId" asp-route-searchterm="@($"orderid:{PaymentRequestRepository.GetOrderIdForPaymentRequest(item.Id)}")">Invoices</a>
2021-12-11 04:32:23 +01:00
<span> - </span>
2022-06-19 19:52:12 -07:00
<a asp-action="ClonePaymentRequest" asp-route-storeId="@item.StoreId" asp-route-payReqId="@item.Id" id="Clone-@item.Id">Clone</a>
2021-12-11 04:32:23 +01:00
<span> - </span>
2022-02-09 15:37:15 +01:00
<a asp-action="TogglePaymentRequestArchival" asp-route-storeId="@item.StoreId" asp-route-payReqId="@item.Id" id="ToggleArchival-@item.Id">@(item.Archived ? "Unarchive" : "Archive")</a>
2022-06-19 19:52:12 -07:00
<span> - </span>
<a asp-action="ViewPaymentRequest" asp-route-payReqId="@item.Id" id="PaymentRequest-@item.Id">View</a>
2021-12-11 04:32:23 +01:00
</td>
</tr>
}
</tbody>
</table>
2019-06-06 18:47:31 +09:00
2021-12-11 04:32:23 +01:00
<vc:pager view-model="Model" />
}
else
{
<p class="text-secondary mt-3">
There are no payment requests matching your criteria.
</p>
}
2019-01-14 22:43:29 +01:00
</div>
2021-12-11 04:32:23 +01:00
</div>