mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-28 21:02:31 +02:00
dwasdv
This commit is contained in:
@@ -67,7 +67,7 @@ async def lnurl_callback(cp_id):
|
|||||||
wallet_id=cp.wallet,
|
wallet_id=cp.wallet,
|
||||||
amount=int(amount_received / 1000),
|
amount=int(amount_received / 1000),
|
||||||
memo=cp.lnurl_title,
|
memo=cp.lnurl_title,
|
||||||
webhook="/copilot/api/v1/copilot/hook/" + cp_id + "/" + str(amount_received),
|
webhook=url_for("copilot.lnurl_callback", copilot=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(),
|
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", "comment": comment},
|
||||||
)
|
)
|
||||||
|
@@ -64,8 +64,10 @@ async def panel(copilot_id):
|
|||||||
return await render_template("copilot/panel.html", copilot=copilot)
|
return await render_template("copilot/panel.html", copilot=copilot)
|
||||||
|
|
||||||
|
|
||||||
@copilot_ext.route("/api/v1/copilot/hook/<copilot_id>/<amount>", methods=["GET"])
|
@copilot_ext.route("/api/v1/copilot/hook/", methods=["GET"])
|
||||||
async def api_copilot_hooker(copilot_id, amount):
|
async def api_copilot_hooker():
|
||||||
|
copilot_id = request.args.get("copilot")
|
||||||
|
amount = request.args.get("amount")
|
||||||
copilot = await get_copilot(copilot_id)
|
copilot = await get_copilot(copilot_id)
|
||||||
print("amount")
|
print("amount")
|
||||||
if not copilot:
|
if not copilot:
|
||||||
|
Reference in New Issue
Block a user