Files
breez-sdk-docs/snippets/csharp/SendSpontaneousPayment.cs
2023-11-03 15:19:58 +01:00

22 lines
535 B
C#

using Breez.Sdk;
public class SendSpontaneousPaymentSnippets
{
public void SendSpontaneousPayment(BlockingBreezServices sdk)
{
// ANCHOR: send-spontaneous-payment
var nodeId = "...";
ulong amountMsat = 3_000_000;
try
{
var response = sdk.SendSpontaneousPayment(
new SendSpontaneousPaymentRequest(nodeId, amountMsat));
}
catch (Exception)
{
// Handle error
}
// ANCHOR_END: send-spontaneous-payment
}
}