mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-04 18:33:10 +02:00
Merge pull request #374 from arcbtc/FastAPI
restored create invoice api endpoint
This commit is contained in:
@@ -98,16 +98,18 @@ class LNbitsWallet(Wallet):
|
|||||||
return PaymentResponse(ok, checking_id, fee_msat, error_message)
|
return PaymentResponse(ok, checking_id, fee_msat, error_message)
|
||||||
|
|
||||||
async def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
async def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
||||||
async with httpx.AsyncClient() as client:
|
try:
|
||||||
r = await client.get(
|
async with httpx.AsyncClient() as client:
|
||||||
url=f"{self.endpoint}/api/v1/payments/{checking_id}", headers=self.key
|
r = await client.get(
|
||||||
)
|
url=f"{self.endpoint}/api/v1/payments/{checking_id}",
|
||||||
|
headers=self.key,
|
||||||
if r.is_error:
|
)
|
||||||
|
if r.is_error:
|
||||||
|
return PaymentStatus(None)
|
||||||
|
return PaymentStatus(r.json()["paid"])
|
||||||
|
except:
|
||||||
return PaymentStatus(None)
|
return PaymentStatus(None)
|
||||||
|
|
||||||
return PaymentStatus(r.json()["paid"])
|
|
||||||
|
|
||||||
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
r = await client.get(
|
r = await client.get(
|
||||||
|
Reference in New Issue
Block a user