diff --git a/lnbits/extensions/tpos/templates/tpos/tpos.html b/lnbits/extensions/tpos/templates/tpos/tpos.html index d7d3de322..429c763dd 100644 --- a/lnbits/extensions/tpos/templates/tpos/tpos.html +++ b/lnbits/extensions/tpos/templates/tpos/tpos.html @@ -206,11 +206,12 @@ var dialog = this.invoiceDialog console.log(this.sat, this.tposId) axios - .post('/tpos/api/v1/tposs/' + this.tposId + '/invoices', { - amount: this.sat + .post('/tpos/api/v1/tposs/' + this.tposId + '/invoices', null, { + params: { + amount: this.sat + } }) .then(function (response) { - console.log(response.data) dialog.data = response.data dialog.show = true diff --git a/lnbits/extensions/tpos/views_api.py b/lnbits/extensions/tpos/views_api.py index 93bedd4ac..b73dc83e4 100644 --- a/lnbits/extensions/tpos/views_api.py +++ b/lnbits/extensions/tpos/views_api.py @@ -57,10 +57,8 @@ async def api_tpos_delete(tpos_id: str, wallet: WalletTypeInfo = Depends(get_key raise HTTPException(status_code=HTTPStatus.NO_CONTENT) # return "", HTTPStatus.NO_CONTENT - @tpos_ext.post("/api/v1/tposs/{tpos_id}/invoices", status_code=HTTPStatus.CREATED) async def api_tpos_create_invoice(amount: int = Query(..., ge=1), tpos_id: str = None): - print("TPOS", tpos_id, amount) tpos = await get_tpos(tpos_id) if not tpos: @@ -78,13 +76,12 @@ async def api_tpos_create_invoice(amount: int = Query(..., ge=1), tpos_id: str = extra={"tag": "tpos"}, ) except Exception as e: - print("ERROR", e) raise HTTPException( status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e) ) # return {"message": str(e)}, HTTPStatus.INTERNAL_SERVER_ERROR - print("INV", payment_hash) + return {"payment_hash": payment_hash, "payment_request": payment_request}