mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Greenfield: Add payments list endpoint (#4407)
Based on btcpayserver/BTCPayServer.Lightning#109
This commit is contained in:
@@ -290,6 +290,14 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
return Ok(invoices.Select(ToModel));
|
||||
}
|
||||
|
||||
public virtual async Task<IActionResult> GetPayments(string cryptoCode, [FromQuery] bool? includePending, [FromQuery] long? offsetIndex, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var lightningClient = await GetLightningClient(cryptoCode, false);
|
||||
var param = new ListPaymentsParams { IncludePending = includePending, OffsetIndex = offsetIndex };
|
||||
var payments = await lightningClient.ListPayments(param, cancellationToken);
|
||||
return Ok(payments.Select(ToModel));
|
||||
}
|
||||
|
||||
public virtual async Task<IActionResult> CreateInvoice(string cryptoCode, CreateLightningInvoiceRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var lightningClient = await GetLightningClient(cryptoCode, false);
|
||||
|
||||
Reference in New Issue
Block a user