mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
python snippets
This commit is contained in:
17
snippets/python_snippets/receive_payment.py
Normal file
17
snippets/python_snippets/receive_payment.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import breez_sdk
|
||||
import logging
|
||||
|
||||
sdk_services = breez_sdk.BlockingBreezServices
|
||||
|
||||
def receive_payment():
|
||||
try:
|
||||
# ANCHOR: receive-payment
|
||||
req = breez_sdk.ReceivePaymentRequest(
|
||||
amount_msat=300000,
|
||||
description="Invoice for 300 000 sats")
|
||||
result = sdk_services.receive_payment(req)
|
||||
# ANCHOR_END: receive-payment
|
||||
return result
|
||||
except Exception as error:
|
||||
logging.error(error)
|
||||
raise
|
||||
Reference in New Issue
Block a user