diff --git a/BTCPayApp.UI/Components/InvoiceList.razor b/BTCPayApp.UI/Components/InvoiceList.razor
index b0a747f..0c451ce 100644
--- a/BTCPayApp.UI/Components/InvoiceList.razor
+++ b/BTCPayApp.UI/Components/InvoiceList.razor
@@ -1,8 +1,4 @@
-@using BTCPayApp.Core.Auth
-@using BTCPayApp.UI.Features
@using BTCPayServer.Client.Models
-@inject IAccountManager AccountManager
-@inject IDispatcher Dispatcher
@if (Invoices is not null)
{
@@ -48,21 +44,4 @@
public Dictionary
? InputAttributes { get; set; }
private string CssClass => $"invoice-list {(InputAttributes?.ContainsKey("class") is true ? InputAttributes["class"] : "")}".Trim();
-
- private string? StoreId => AccountManager.CurrentStore?.Id;
-
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (firstRender)
- {
- if (!string.IsNullOrEmpty(StoreId))
- {
- Dispatcher.Dispatch(new StoreState.FetchInvoices(StoreId));
- }
- }
- }
- private async void OnStateChanged(object? sender, EventArgs e)
- {
- await InvokeAsync(StateHasChanged);
- }
}
diff --git a/BTCPayApp.UI/Pages/InvoicePage.razor b/BTCPayApp.UI/Pages/InvoicePage.razor
index b8373d5..12ec2b3 100644
--- a/BTCPayApp.UI/Pages/InvoicePage.razor
+++ b/BTCPayApp.UI/Pages/InvoicePage.razor
@@ -36,10 +36,6 @@
{
@Error
}
- @if (!string.IsNullOrEmpty(_successMessage))
- {
- @_successMessage
- }
@if (Invoice is not null)
{
@if (CanCheckout)
@@ -60,64 +56,45 @@
-
-
- @if (!string.IsNullOrEmpty(ReceiptUrl))
- {
-
- }
- @if (!Invoice.Archived)
- {
-
-
-
- }
-
-
-
General Information
- @if (Invoice.Metadata.TryGetValue("orderId", out var orderId))
- {
-
- | Order Id |
-
- @if (Invoice.Metadata.TryGetValue("orderUrl", out var orderUrl))
- {
- @orderId
- }
- else
- {
- @orderId
- }
- |
-
- }
- @if (Invoice.Metadata.TryGetValue("paymentRequestId", out var paymentRequestId))
- {
-
- | Payment Request Id |
- @paymentRequestId |
-
- }
+ @if (Invoice.Metadata.TryGetValue("orderId", out var orderId))
+ {
- | Created |
+ Order Id |
-
+ @if (Invoice.Metadata.TryGetValue("orderUrl", out var orderUrl))
+ {
+ @orderId
+ }
+ else
+ {
+ @orderId
+ }
|
+ }
+ @if (Invoice.Metadata.TryGetValue("paymentRequestId", out var paymentRequestId))
+ {
- | Expired |
-
-
- |
+ Payment Request Id |
+ @paymentRequestId |
+ }
+
+ | Created |
+
+
+ |
+
+
+ | Expired |
+
+
+ |
+
@@ -134,27 +111,27 @@
- @if (!string.IsNullOrEmpty(itemCode?.ToString()))
- {
-
- | Item code |
- @itemCode |
-
- }
- @if (!string.IsNullOrEmpty(itemDesc?.ToString()))
- {
-
- | Item Description |
- @itemDesc |
-
- }
- @if (taxIncluded is not null)
- {
-
- | Tax Included |
- @taxIncluded |
-
- }
+ @if (!string.IsNullOrEmpty(itemCode?.ToString()))
+ {
+
+ | Item code |
+ @itemCode |
+
+ }
+ @if (!string.IsNullOrEmpty(itemDesc?.ToString()))
+ {
+
+ | Item Description |
+ @itemDesc |
+
+ }
+ @if (taxIncluded is not null)
+ {
+
+ | Tax Included |
+ @taxIncluded |
+
+ }
@@ -173,80 +150,80 @@
Invoice.Metadata.TryGetValue("buyerZip", out var buyerZip);
}
@if (!string.IsNullOrEmpty(buyerName?.ToString()) || !string.IsNullOrEmpty(buyerEmail?.ToString()) ||
- !string.IsNullOrEmpty(buyerPhone?.ToString()) || !string.IsNullOrEmpty(buyerAddress1?.ToString()) ||
- !string.IsNullOrEmpty(buyerAddress2?.ToString()) || !string.IsNullOrEmpty(buyerCity?.ToString()) ||
- !string.IsNullOrEmpty(buyerState?.ToString()) || !string.IsNullOrEmpty(buyerCountry?.ToString()) ||
- !string.IsNullOrEmpty(buyerZip?.ToString()))
+ !string.IsNullOrEmpty(buyerPhone?.ToString()) || !string.IsNullOrEmpty(buyerAddress1?.ToString()) ||
+ !string.IsNullOrEmpty(buyerAddress2?.ToString()) || !string.IsNullOrEmpty(buyerCity?.ToString()) ||
+ !string.IsNullOrEmpty(buyerState?.ToString()) || !string.IsNullOrEmpty(buyerCountry?.ToString()) ||
+ !string.IsNullOrEmpty(buyerZip?.ToString()))
{
Buyer Information
- @if (!string.IsNullOrEmpty(buyerName?.ToString()))
- {
-
- | Name |
- @buyerName |
-
- }
- @if (!string.IsNullOrEmpty(buyerEmail?.ToString()))
- {
-
- | Email |
-
- @buyerEmail
- |
-
- }
- @if (!string.IsNullOrEmpty(buyerPhone?.ToString()))
- {
-
- | Phone |
- @buyerPhone |
-
- }
- @if (!string.IsNullOrEmpty(buyerAddress1?.ToString()))
- {
-
- | Address 1 |
- @buyerAddress1 |
-
- }
- @if (!string.IsNullOrEmpty(buyerAddress2?.ToString()))
- {
-
- | Address 2 |
- @buyerAddress2 |
-
- }
- @if (!string.IsNullOrEmpty(buyerCity?.ToString()))
- {
-
- | City |
- @buyerCity |
-
- }
- @if (!string.IsNullOrEmpty(buyerState?.ToString()))
- {
-
- | State |
- @buyerState |
-
- }
- @if (!string.IsNullOrEmpty(buyerCountry?.ToString()))
- {
-
- | Country |
- @buyerCountry |
-
- }
- @if (!string.IsNullOrEmpty(buyerZip?.ToString()))
- {
-
- | Zip |
- @buyerZip |
-
- }
+ @if (!string.IsNullOrEmpty(buyerName?.ToString()))
+ {
+
+ | Name |
+ @buyerName |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerEmail?.ToString()))
+ {
+
+ | Email |
+
+ @buyerEmail
+ |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerPhone?.ToString()))
+ {
+
+ | Phone |
+ @buyerPhone |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerAddress1?.ToString()))
+ {
+
+ | Address 1 |
+ @buyerAddress1 |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerAddress2?.ToString()))
+ {
+
+ | Address 2 |
+ @buyerAddress2 |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerCity?.ToString()))
+ {
+
+ | City |
+ @buyerCity |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerState?.ToString()))
+ {
+
+ | State |
+ @buyerState |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerCountry?.ToString()))
+ {
+
+ | Country |
+ @buyerCountry |
+
+ }
+ @if (!string.IsNullOrEmpty(buyerZip?.ToString()))
+ {
+
+ | Zip |
+ @buyerZip |
+
+ }
@@ -350,13 +327,13 @@
if (!string.IsNullOrEmpty(StoreId) && !string.IsNullOrEmpty(InvoiceId))
{
- Dispatcher.Dispatch(new StoreState.FetchInvoice(StoreId, InvoiceId));
+ if (Invoice == null)
+ Dispatcher.Dispatch(new StoreState.FetchInvoice(StoreId, InvoiceId));
if (PaymentMethods == null)
Dispatcher.Dispatch(new StoreState.FetchInvoicePaymentMethods(StoreId, InvoiceId));
}
}
- private string? _successMessage;
private string? StoreId => AccountManager.CurrentStore?.Id;
private AppUserStoreInfo? StoreInfo => StoreState.Value.StoreInfo;
private InvoiceData? Invoice => !string.IsNullOrEmpty(InvoiceId) ? StoreState.Value.GetInvoice(InvoiceId!)?.Data : null;
@@ -376,14 +353,4 @@
private string GetTitle() => $"Invoice {Invoice?.Id}".Trim();
private bool CanCheckout => Invoice is { Status: InvoiceStatus.New };
-
- private async Task ToggleArchive()
- {
- await AccountManager.GetClient().ArchiveInvoice(StoreId, InvoiceId);
- _successMessage = "The invoice has been archived and will no longer appear in the invoice list by default";
- if (!string.IsNullOrEmpty(StoreId) && !string.IsNullOrEmpty(InvoiceId))
- {
- Dispatcher.Dispatch(new StoreState.FetchInvoice(StoreId, InvoiceId));
- }
- }
}