From d5d85d16e6ea2dfa6325aff4755f9b8fd5404f09 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 12 Oct 2020 20:58:53 -0300 Subject: [PATCH] fix: auth headers variable name on opennode.py --- lnbits/wallets/opennode.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnbits/wallets/opennode.py b/lnbits/wallets/opennode.py index 3568f9e..6c3c255 100644 --- a/lnbits/wallets/opennode.py +++ b/lnbits/wallets/opennode.py @@ -28,7 +28,7 @@ class OpenNodeWallet(Wallet): r = httpx.post( f"{self.endpoint}/v1/charges", - headers=self.auth_invoice, + headers=self.auth, json={ "amount": amount, "description": memo or "", @@ -58,7 +58,7 @@ class OpenNodeWallet(Wallet): return PaymentResponse(True, checking_id, fee_msat, None) def get_invoice_status(self, checking_id: str) -> PaymentStatus: - r = httpx.get(f"{self.endpoint}/v1/charge/{checking_id}", headers=self.auth_invoice) + r = httpx.get(f"{self.endpoint}/v1/charge/{checking_id}", headers=self.auth) if r.is_error: return PaymentStatus(None) @@ -90,7 +90,7 @@ class OpenNodeWallet(Wallet): if data["status"] != "paid": return "", HTTPStatus.NO_CONTENT - x = hmac.new(self.auth_invoice["Authorization"], digestmod="sha256") + x = hmac.new(self.auth["Authorization"], digestmod="sha256") x.update(charge_id) if x.hexdigest() != data["hashed_order"]: print("invalid webhook, not from opennode")