error check for pr
This commit is contained in:
parent
8d52b1b359
commit
b2a0faf9de
1 changed files with 6 additions and 0 deletions
|
|
@ -310,6 +310,12 @@ async def api_payments_pay_lnurl(
|
||||||
detail=f"{domain} said: '{params.get('reason', '')}'",
|
detail=f"{domain} said: '{params.get('reason', '')}'",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not params.get("pr"):
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=HTTPStatus.BAD_REQUEST,
|
||||||
|
detail=f"{domain} did not return a payment request.",
|
||||||
|
)
|
||||||
|
|
||||||
invoice = bolt11.decode(params["pr"])
|
invoice = bolt11.decode(params["pr"])
|
||||||
if invoice.amount_msat != data.amount:
|
if invoice.amount_msat != data.amount:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue