mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 06:48:02 +01:00
fixed first opennode bug
Opennode funding source isnt working, there are a few bugs. This fixes the first
This commit is contained in:
parent
2e12c0ba3c
commit
d75c69cd10
1 changed files with 2 additions and 3 deletions
|
@ -19,7 +19,7 @@ class OpenNodeWallet(Wallet):
|
||||||
|
|
||||||
key = getenv("OPENNODE_KEY") or getenv("OPENNODE_ADMIN_KEY") or getenv("OPENNODE_INVOICE_KEY")
|
key = getenv("OPENNODE_KEY") or getenv("OPENNODE_ADMIN_KEY") or getenv("OPENNODE_INVOICE_KEY")
|
||||||
self.auth = {"Authorization": key}
|
self.auth = {"Authorization": key}
|
||||||
|
|
||||||
def status(self) -> StatusResponse:
|
def status(self) -> StatusResponse:
|
||||||
try:
|
try:
|
||||||
r = httpx.get(
|
r = httpx.get(
|
||||||
|
@ -30,7 +30,7 @@ class OpenNodeWallet(Wallet):
|
||||||
except (httpx.ConnectError, httpx.RequestError):
|
except (httpx.ConnectError, httpx.RequestError):
|
||||||
return StatusResponse(f"Unable to connect to '{self.endpoint}'", 0)
|
return StatusResponse(f"Unable to connect to '{self.endpoint}'", 0)
|
||||||
|
|
||||||
data = r.json()["message"]
|
data = r.json()["data"]
|
||||||
if r.is_error:
|
if r.is_error:
|
||||||
return StatusResponse(data["message"], 0)
|
return StatusResponse(data["message"], 0)
|
||||||
|
|
||||||
|
@ -81,7 +81,6 @@ class OpenNodeWallet(Wallet):
|
||||||
|
|
||||||
def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
||||||
r = httpx.get(f"{self.endpoint}/v1/charge/{checking_id}", headers=self.auth)
|
r = httpx.get(f"{self.endpoint}/v1/charge/{checking_id}", headers=self.auth)
|
||||||
|
|
||||||
if r.is_error:
|
if r.is_error:
|
||||||
return PaymentStatus(None)
|
return PaymentStatus(None)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue