Browse Source

lnurlp: fix ?amount satoshi -> msatoshi conversion.

livestream
fiatjaf 4 years ago
parent
commit
8947358c80
  1. 8
      lnbits/extensions/lnurlp/lnurl.py
  2. 6
      lnbits/extensions/lnurlp/models.py

8
lnbits/extensions/lnurlp/lnurl.py

@ -39,7 +39,7 @@ async def api_lnurl_callback(link_id):
return jsonify({"status": "ERROR", "reason": "LNURL-pay not found."}), HTTPStatus.OK
min, max = link.min, link.max
rate = await get_fiat_rate(link.currency) if link.currency else 1
rate = await get_fiat_rate(link.currency) if link.currency else 1000
if link.currency:
# allow some fluctuation (as the fiat price may have changed between the calls)
min = rate * 995 * link.min
@ -76,10 +76,6 @@ async def api_lnurl_callback(link_id):
extra={"tag": "lnurlp", "link": link.id, "comment": comment},
)
resp = LnurlPayActionResponse(
pr=payment_request,
success_action=link.success_action(payment_hash),
routes=[],
)
resp = LnurlPayActionResponse(pr=payment_request, success_action=link.success_action(payment_hash), routes=[],)
return jsonify(resp.dict()), HTTPStatus.OK

6
lnbits/extensions/lnurlp/models.py

@ -48,9 +48,3 @@ class PayLink(NamedTuple):
return MessageAction(message=self.success_text)
else:
return None
class Invoice(NamedTuple):
payment_hash: str
link_id: int
webhook_sent: bool

Loading…
Cancel
Save