mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
add csharp snippets
This commit is contained in:
37
snippets/csharp/ListPayments.cs
Normal file
37
snippets/csharp/ListPayments.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Breez.Sdk;
|
||||
|
||||
public class ListPaymentsSnippets
|
||||
{
|
||||
public void ListPayments(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: list-payments
|
||||
try
|
||||
{
|
||||
var payments = sdk.ListPayments(
|
||||
new ListPaymentsRequest(PaymentTypeFilter.ALL));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: list-payments
|
||||
}
|
||||
|
||||
public void ListPaymentsFiltered(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: list-payments-filtered
|
||||
try
|
||||
{
|
||||
var payments = sdk.ListPayments(
|
||||
new ListPaymentsRequest(
|
||||
PaymentTypeFilter.SENT,
|
||||
fromTimestamp: 1696880000,
|
||||
includeFailures: true));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: list-payments-filtered
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user