Merge pull request #374 from arcbtc/FastAPI
restored create invoice api endpoint
This commit is contained in:
commit
e7e8d307a0
1 changed files with 10 additions and 8 deletions
|
|
@ -98,15 +98,17 @@ class LNbitsWallet(Wallet):
|
|||
return PaymentResponse(ok, checking_id, fee_msat, error_message)
|
||||
|
||||
async def get_invoice_status(self, checking_id: str) -> PaymentStatus:
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
r = await client.get(
|
||||
url=f"{self.endpoint}/api/v1/payments/{checking_id}", headers=self.key
|
||||
url=f"{self.endpoint}/api/v1/payments/{checking_id}",
|
||||
headers=self.key,
|
||||
)
|
||||
|
||||
if r.is_error:
|
||||
return PaymentStatus(None)
|
||||
|
||||
return PaymentStatus(r.json()["paid"])
|
||||
except:
|
||||
return PaymentStatus(None)
|
||||
|
||||
async def get_payment_status(self, checking_id: str) -> PaymentStatus:
|
||||
async with httpx.AsyncClient() as client:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue