mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Add page for viewing the Invoice details
This commit is contained in:
@@ -65,12 +65,17 @@ namespace BTCPayServer.Servcices.Invoices
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RemovePendingInvoice(string invoiceId)
|
||||
public async Task<bool> RemovePendingInvoice(string invoiceId)
|
||||
{
|
||||
using(var ctx = _ContextFactory.CreateContext())
|
||||
{
|
||||
ctx.PendingInvoices.Remove(new PendingInvoiceData() { Id = invoiceId });
|
||||
await ctx.SaveChangesAsync();
|
||||
try
|
||||
{
|
||||
await ctx.SaveChangesAsync();
|
||||
return true;
|
||||
}
|
||||
catch(DbUpdateException) { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,12 +212,16 @@ namespace BTCPayServer.Servcices.Invoices
|
||||
{
|
||||
using(var context = _ContextFactory.CreateContext())
|
||||
{
|
||||
|
||||
IQueryable<InvoiceData> query = context
|
||||
.Invoices
|
||||
.Include(o => o.Payments)
|
||||
.Include(o => o.RefundAddresses);
|
||||
|
||||
if(!string.IsNullOrEmpty(queryObject.InvoiceId))
|
||||
{
|
||||
query = query.Where(i => i.Id == queryObject.InvoiceId);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(queryObject.StoreId))
|
||||
{
|
||||
query = query.Where(i => i.StoreDataId == queryObject.StoreId);
|
||||
@@ -380,5 +389,10 @@ namespace BTCPayServer.Servcices.Invoices
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public string InvoiceId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user