Skip to content

Commit

Permalink
fixes lnurl switch
Browse files Browse the repository at this point in the history
  • Loading branch information
arcbtc committed Apr 17, 2024
1 parent fddf840 commit dc0f7d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lnurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ async def lnurl_callback(
return {"status": "ERROR", "reason": "Payment failed, use a different wallet."}
return {"status": "OK"}
if device.device == "switch":
if not amount:
return {"status": "ERROR", "reason": "No amount"}
payment_hash, payment_request = await create_invoice(
wallet_id=device.wallet,
amount=int(amount / 1000),
Expand All @@ -304,16 +306,15 @@ async def lnurl_callback(
lnurldevicepayment = await update_lnurldevicepayment(
lnurldevicepayment_id=paymentid, payhash=payment_hash
)
resp = JSONResponse(
{
resp = {
"pr": payment_request,
"successAction": {
"tag": "text",
"description": f"{int(amount / 1000)}sats sent"
},
"routes": [],
}
)
logger.debug(resp)

return resp

Expand Down

0 comments on commit dc0f7d0

Please sign in to comment.