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:
19
snippets/csharp/ReceivePayment.cs
Normal file
19
snippets/csharp/ReceivePayment.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Breez.Sdk;
|
||||
|
||||
public class ReceivePaymentSnippets
|
||||
{
|
||||
public void ReceivePayment(BlockingBreezServices sdk)
|
||||
{
|
||||
// ANCHOR: receive-payment
|
||||
try
|
||||
{
|
||||
var invoice = sdk.ReceivePayment(
|
||||
new ReceivePaymentRequest(3_000_000, "Invoice for 3000 sats"));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Handle error
|
||||
}
|
||||
// ANCHOR_END: receive-payment
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user