This commit is contained in:
Ben Arc
2021-04-16 22:22:36 +01:00
parent dfc8dfc426
commit b500a02f02
3 changed files with 33 additions and 21 deletions
+20 -4
View File
@@ -67,8 +67,17 @@ async def lnurl_callback(cp_id):
wallet_id=cp.wallet,
amount=int(amount_received / 1000),
memo=cp.lnurl_title,
webhook=url_for("copilot.api_copilot_hooker", copilot_id=cp_id, amount=int(amount_received / 1000), _external=True),
description_hash=hashlib.sha256((LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]]))).encode("utf-8")).digest(),
webhook=url_for(
"copilot.api_copilot_hooker",
copilot_id=cp_id,
amount=int(amount_received / 1000),
_external=True,
),
description_hash=hashlib.sha256(
(
LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]]))
).encode("utf-8")
).digest(),
extra={"tag": "copilot", "comment": comment},
)
resp = LnurlPayActionResponse(
@@ -77,5 +86,12 @@ async def lnurl_callback(cp_id):
disposable=False,
routes=[],
)
print(url_for("copilot.api_copilot_hooker", copilot_id=cp_id, amount=int(amount_received / 1000), _external=True))
return jsonify(resp.dict())
print(
url_for(
"copilot.api_copilot_hooker",
copilot_id=cp_id,
amount=int(amount_received / 1000),
_external=True,
)
)
return jsonify(resp.dict())