lnbits / lndhub

Access lnbits from BlueWallet or Zeus
MIT License
5 stars 6 forks source link

Error at /addinvoice route when using BTCPay Server #18

Closed thespielplatz closed 11 months ago

thespielplatz commented 1 year ago

I would like to connect the lightning part of our BTCPay Server to our LNBits instance via the lndhub extension. With BlueWallet everything works great, but with BTCPay I got an error at https://lnbits.mydomain.com/lndhub/ext/addinvoice

{
    "detail": "Failed to create invoice"
}

After intercepting the calls, I found the difference between working and non-working:

Body Json - Working

{"amt":3831,"memo":"Paid to Sate Techniker (Order ID: test)","description_hash":null}

Body Json - Not working

{"amt":3831.0,"memo":"Paid to Sate Techniker (Order ID: test)","description_hash":null}

If looks like in the code there is a conversion from number to int?

#56: amount=int(data.amt),

But somehow the exception get's triggered. I would have liked to debug it myself, but I am too far of with python 🙈 Is it a bug? Can you help?

Cheers Fil