From a32f124116dbd1a8bdfe77e104ecd4d55e923d67 Mon Sep 17 00:00:00 2001 From: Ross Savage Date: Sun, 17 Dec 2023 19:54:44 +0100 Subject: [PATCH] Fix python webhook example --- snippets/python/main.py | 5 +++++ snippets/python/src/webhook.py | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/snippets/python/main.py b/snippets/python/main.py index 28721cb..c0343bd 100755 --- a/snippets/python/main.py +++ b/snippets/python/main.py @@ -16,6 +16,7 @@ from src.lnurl_pay import pay from src.lnurl_withdraw import withdraw from src.production import production_node_config from src.service_status import health_check_status, report_payment_failure +from src.webhook import webhook, payment_webhook import tempfile import os @@ -59,6 +60,10 @@ def main(): # receive payment receive_payment(sdk_services) + # payment notifications + webhook(sdk_services) + payment_webhook(sdk_services) + # receive onchain generate_receive_onchain_address(sdk_services) get_in_progress_swap(sdk_services) diff --git a/snippets/python/src/webhook.py b/snippets/python/src/webhook.py index ea92f25..70640cd 100644 --- a/snippets/python/src/webhook.py +++ b/snippets/python/src/webhook.py @@ -3,17 +3,17 @@ import breez_sdk def webhook(sdk_services): try: # ANCHOR: register-webook - sdk_services.registerWebhook("https://yourapplication.com") + sdk_services.register_webhook("https://yourapplication.com") # ANCHOR_END: register-webook except Exception as error: print(error) raise -def paymentWebhook(sdk_services): +def payment_webhook(sdk_services): try: - # ANCHOR: register-payment-webook - sdk_services.registerWebhook("https://your-nds-service.com/notify?platform=ios&token=") - # ANCHOR_END: register-payment-webook + # ANCHOR: register-payment-webook + sdk_services.register_webhook("https://your-nds-service.com/notify?platform=ios&token=") + # ANCHOR_END: register-payment-webook except Exception as error: print(error) raise