add initial lnurl-pay
This commit is contained in:
@@ -52,12 +52,15 @@ async def _request_lnurl(url: str) -> dict:
|
||||
"""Requests payment data from a lnurl."""
|
||||
try:
|
||||
response = await Network.async_send_http_on_proxy("get", url, timeout=10)
|
||||
response = json.loads(response)
|
||||
except asyncio.TimeoutError as e:
|
||||
raise LNURLError("Server did not reply in time.") from e
|
||||
except aiohttp.client_exceptions.ClientError as e:
|
||||
raise LNURLError(f"Client error: {e}") from e
|
||||
except json.JSONDecodeError:
|
||||
raise LNURLError(f"Invalid response from server")
|
||||
# TODO: handling of specific client errors
|
||||
response = json.loads(response)
|
||||
|
||||
if "metadata" in response:
|
||||
response["metadata"] = json.loads(response["metadata"])
|
||||
status = response.get("status")
|
||||
|
||||
Reference in New Issue
Block a user