Consolidate "receive payment" snippets, expose invoice

This commit is contained in:
ok300
2024-01-12 10:17:29 +01:00
parent 464a29816d
commit fd10bbc286
8 changed files with 28 additions and 15 deletions

View File

@@ -6,10 +6,12 @@ def receive_payment(sdk_services):
# ANCHOR: receive-payment
req = breez_sdk.ReceivePaymentRequest(
amount_msat=3000000,
description="Invoice for 3 000 000 sats")
result = sdk_services.receive_payment(req)
description="Invoice for 3 000 sats")
receive_payment_response = sdk_services.receive_payment(req)
invoice = receive_payment_response.ln_invoice
# ANCHOR_END: receive-payment
return result
return receive_payment_response
except Exception as error:
print(error)
raise