mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
27 lines
712 B
C#
27 lines
712 B
C#
using Breez.Sdk;
|
|
|
|
public class SendPaymentSnippets
|
|
{
|
|
public void SendPayment(BlockingBreezServices sdk)
|
|
{
|
|
// ANCHOR: send-payment
|
|
var bolt11 = "...";
|
|
ulong amountMsat = 3_000_000;
|
|
|
|
try
|
|
{
|
|
// The `amountMsat` param is optional and should only passed if the
|
|
// bolt11 doesn't specify an amount.
|
|
// The amountMsat is required in case an amount is not specified in
|
|
// the bolt11 invoice.
|
|
var response = sdk.SendPayment(
|
|
new SendPaymentRequest(bolt11, amountMsat));
|
|
}
|
|
catch (Exception)
|
|
{
|
|
// Handle error
|
|
}
|
|
// ANCHOR_END: send-payment
|
|
}
|
|
}
|