Added listener

This commit is contained in:
Ben Arc
2021-04-19 23:45:40 +01:00
parent 05317eb5d6
commit 651ae2a386
4 changed files with 93 additions and 61 deletions
+1 -17
View File
@@ -71,19 +71,12 @@ async def lnurl_callback(cp_id):
wallet_id=cp.wallet,
amount=int(amount_received / 1000),
memo=cp.lnurl_title,
webhook=str(url_for(
"copilot.api_copilot_hooker",
copilot_id=cp_id,
amount=int(amount_received / 1000),
comment=comment,
_external=False,
))[:-1],
description_hash=hashlib.sha256(
(
LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]]))
).encode("utf-8")
).digest(),
extra={"tag": "copilot", "comment": comment},
extra={"tag": "copilot", "copilot": cp.id, "comment": comment},
)
resp = LnurlPayActionResponse(
pr=payment_request,
@@ -91,13 +84,4 @@ async def lnurl_callback(cp_id):
disposable=False,
routes=[],
)
print(
str(url_for(
"copilot.api_copilot_hooker",
copilot_id=cp_id,
amount=int(amount_received / 1000),
comment=comment,
_external=False,
))[:-1]
)
return jsonify(resp.dict())