diff --git a/tasks.py b/tasks.py index cdfc8c3..7afbc43 100644 --- a/tasks.py +++ b/tasks.py @@ -31,13 +31,13 @@ async def on_invoice_paid(payment: Payment) -> None: bitcoinswitch_payment.payment_hash = bitcoinswitch_payment.payload bitcoinswitch_payment = await update_bitcoinswitch_payment(bitcoinswitch_payment) payload = bitcoinswitch_payment.payload - variable = payment.extra.get("variable", False) - if variable: + + variable = payment.extra.get("variable") + if variable is True: payload = str( (int(payload) / int(bitcoinswitch_payment.sats)) * int(payment.extra["amount"]) ) - payload = f"{bitcoinswitch_payment.pin}-{payload}" comment = payment.extra.get("comment") diff --git a/views_lnurl.py b/views_lnurl.py index 4b8f19f..ad857aa 100644 --- a/views_lnurl.py +++ b/views_lnurl.py @@ -83,7 +83,7 @@ async def lnurl_params( } if comment: resp["commentAllowed"] = 1500 - if variable: + if variable is True: resp["maxSendable"] = price_msat * 360 return resp @@ -95,7 +95,7 @@ async def lnurl_params( ) async def lnurl_callback( payment_id: str, - variable: str = Query(None), + variable: bool = Query(None), amount: int = Query(None), comment: str = Query(None), ):