From cba41eec5bf8bb3fa7a3dcb28a9aad6ccaf78f6b Mon Sep 17 00:00:00 2001 From: Ghander Date: Mon, 30 Jun 2025 12:05:55 -0500 Subject: [PATCH] Revert "Include receipt and archive CTA" --- BTCPayApp.UI/Components/InvoiceList.razor | 21 -- BTCPayApp.UI/Pages/InvoicePage.razor | 275 ++++++++++------------ 2 files changed, 121 insertions(+), 175 deletions(-) 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)) - { -
- Receipt -
- } - @if (!Invoice.Archived) - { -
- -
- } -
-
-

General Information

- @if (Invoice.Metadata.TryGetValue("orderId", out var orderId)) - { - - - - - } - @if (Invoice.Metadata.TryGetValue("paymentRequestId", out var paymentRequestId)) - { - - - - - } + @if (Invoice.Metadata.TryGetValue("orderId", out var orderId)) + { - + + } + @if (Invoice.Metadata.TryGetValue("paymentRequestId", out var paymentRequestId)) + { - - + + + } + + + + + + + +
Order Id - @if (Invoice.Metadata.TryGetValue("orderUrl", out var orderUrl)) - { - @orderId - } - else - { - @orderId - } -
Payment Request Id@paymentRequestId
CreatedOrder Id - + @if (Invoice.Metadata.TryGetValue("orderUrl", out var orderUrl)) + { + @orderId + } + else + { + @orderId + }
Expired - - Payment Request Id@paymentRequestId
Created + +
Expired + +
@@ -134,27 +111,27 @@
- @if (!string.IsNullOrEmpty(itemCode?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(itemDesc?.ToString())) - { - - - - - } - @if (taxIncluded is not null) - { - - - - - } + @if (!string.IsNullOrEmpty(itemCode?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(itemDesc?.ToString())) + { + + + + + } + @if (taxIncluded is not null) + { + + + + + }
Item code@itemCode
Item Description@itemDesc
Tax Included@taxIncluded
Item code@itemCode
Item Description@itemDesc
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())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerEmail?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerPhone?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerAddress1?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerAddress2?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerCity?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerState?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerCountry?.ToString())) - { - - - - - } - @if (!string.IsNullOrEmpty(buyerZip?.ToString())) - { - - - - - } + @if (!string.IsNullOrEmpty(buyerName?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerEmail?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerPhone?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerAddress1?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerAddress2?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerCity?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerState?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerCountry?.ToString())) + { + + + + + } + @if (!string.IsNullOrEmpty(buyerZip?.ToString())) + { + + + + + }
Name@buyerName
Email - @buyerEmail -
Phone@buyerPhone
Address 1@buyerAddress1
Address 2@buyerAddress2
City@buyerCity
State@buyerState
Country@buyerCountry
Zip@buyerZip
Name@buyerName
Email + @buyerEmail +
Phone@buyerPhone
Address 1@buyerAddress1
Address 2@buyerAddress2
City@buyerCity
State@buyerState
Country@buyerCountry
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)); - } - } }