Merge branch 'lnbits:main' into main
This commit is contained in:
commit
244f440cb8
4 changed files with 25 additions and 3 deletions
|
|
@ -47,6 +47,15 @@ poetry run lnbits
|
||||||
# adding --debug in the start-up command above to help your troubleshooting and generate a more verbose output
|
# adding --debug in the start-up command above to help your troubleshooting and generate a more verbose output
|
||||||
# Note that you have to add the line DEBUG=true in your .env file, too.
|
# Note that you have to add the line DEBUG=true in your .env file, too.
|
||||||
```
|
```
|
||||||
|
#### Updating the server
|
||||||
|
|
||||||
|
```
|
||||||
|
cd lnbits-legend/
|
||||||
|
# Stop LNbits with `ctrl + x`
|
||||||
|
git pull
|
||||||
|
poetry install --only main
|
||||||
|
# Start LNbits with `poetry run lnbits`
|
||||||
|
```
|
||||||
|
|
||||||
## Option 2: Nix
|
## Option 2: Nix
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -686,7 +686,7 @@ async def img(request: Request, data):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@core_app.get("/api/v1/audit/")
|
@core_app.get("/api/v1/audit")
|
||||||
async def api_auditor(wallet: WalletTypeInfo = Depends(get_key_type)):
|
async def api_auditor(wallet: WalletTypeInfo = Depends(get_key_type)):
|
||||||
if wallet.wallet.user not in LNBITS_ADMIN_USERS:
|
if wallet.wallet.user not in LNBITS_ADMIN_USERS:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import asyncio
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from lnbits.core.models import Payment
|
from lnbits.core.models import Payment
|
||||||
from lnbits.core.services import create_invoice, pay_invoice
|
from lnbits.core.services import create_invoice, pay_invoice, websocketUpdater
|
||||||
from lnbits.helpers import get_current_extension_name
|
from lnbits.helpers import get_current_extension_name
|
||||||
from lnbits.tasks import register_invoice_listener
|
from lnbits.tasks import register_invoice_listener
|
||||||
|
|
||||||
|
|
@ -26,6 +26,16 @@ async def on_invoice_paid(payment: Payment) -> None:
|
||||||
tpos = await get_tpos(payment.extra.get("tposId"))
|
tpos = await get_tpos(payment.extra.get("tposId"))
|
||||||
tipAmount = payment.extra.get("tipAmount")
|
tipAmount = payment.extra.get("tipAmount")
|
||||||
|
|
||||||
|
strippedPayment = {
|
||||||
|
"amount": payment.amount,
|
||||||
|
"fee": payment.fee,
|
||||||
|
"checking_id": payment.checking_id,
|
||||||
|
"payment_hash": payment.payment_hash,
|
||||||
|
"bolt11": payment.bolt11,
|
||||||
|
}
|
||||||
|
|
||||||
|
await websocketUpdater(payment.extra.get("tposId"), str(strippedPayment))
|
||||||
|
|
||||||
if tipAmount is None:
|
if tipAmount is None:
|
||||||
# no tip amount
|
# no tip amount
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ from lnbits.core.models import Payment
|
||||||
from lnbits.core.services import create_invoice
|
from lnbits.core.services import create_invoice
|
||||||
from lnbits.core.views.api import api_payment
|
from lnbits.core.views.api import api_payment
|
||||||
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
||||||
|
from lnbits.settings import LNBITS_COMMIT
|
||||||
|
|
||||||
from . import tpos_ext
|
from . import tpos_ext
|
||||||
from .crud import create_tpos, delete_tpos, get_tpos, get_tposs
|
from .crud import create_tpos, delete_tpos, get_tpos, get_tposs
|
||||||
|
|
@ -134,7 +135,8 @@ async def api_tpos_pay_invoice(
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
try:
|
try:
|
||||||
r = await client.get(lnurl, follow_redirects=True)
|
headers = {"user-agent": f"lnbits/tpos commit {LNBITS_COMMIT[:7]}"}
|
||||||
|
r = await client.get(lnurl, follow_redirects=True, headers=headers)
|
||||||
if r.is_error:
|
if r.is_error:
|
||||||
lnurl_response = {"success": False, "detail": "Error loading"}
|
lnurl_response = {"success": False, "detail": "Error loading"}
|
||||||
else:
|
else:
|
||||||
|
|
@ -145,6 +147,7 @@ async def api_tpos_pay_invoice(
|
||||||
r2 = await client.get(
|
r2 = await client.get(
|
||||||
resp["callback"],
|
resp["callback"],
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
|
headers=headers,
|
||||||
params={
|
params={
|
||||||
"k1": resp["k1"],
|
"k1": resp["k1"],
|
||||||
"pr": payment_request,
|
"pr": payment_request,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue