From f67cb49bc36e78c08f94cc5e1934fb510324c089 Mon Sep 17 00:00:00 2001 From: Padreug Date: Mon, 22 Jun 2026 15:32:44 +0200 Subject: [PATCH] fix(cash-in): return bech32 LNURL, not the raw URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Lnurl.__str__` is the underlying URL, so `str(lnurl)` returned `http:///withdraw/...` instead of the bech32 `LNURL1…` — wallets need the encoded LNURL-withdraw (lud01). Use `str(lnurl.bech32)` and add `lnurl_url` (the raw URL) alongside, mirroring withdraw's _populate_lnurl field convention. (Note: the encoded URL still derives from LNBITS_BASEURL — that must be an externally reachable https URL for a real wallet to claim.) --- cashin_transport.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cashin_transport.py b/cashin_transport.py index a912180..c041f48 100644 --- a/cashin_transport.py +++ b/cashin_transport.py @@ -107,7 +107,10 @@ async def handle_create_withdraw(auth, request) -> dict: ) return { "link_id": link.id, - "lnurl": str(lnurl), + # `Lnurl.__str__` is the raw URL — wallets need the bech32 LNURL1… + # (lud01). Mirror withdraw's `_populate_lnurl` field convention. + "lnurl": str(lnurl.bech32), + "lnurl_url": str(lnurl.url), "net_sats": net_sats, "principal_sats": principal_sats, "fee_sats": fee_sats,