btcpayserver icon indicating copy to clipboard operation
btcpayserver copied to clipboard

[Bug]: The defaultDescription of refund LNURL (withdrawRequest) is not correct type

Open Perlover opened this issue 3 years ago • 1 comments

What is your BTCPay version?

v1.6.12.0

How did you deploy BTCPay Server?

LunaNode hosting, Docker inside

What happened?

When returning funds via Lightning, the defaultDescription field is incorrectly generated as null (should be string type - LUD-03 specs)

How did you encounter this bug?

  1. To pay Lightning invoice, for example through POS
  2. In Admin area click by "Notification" icon then "Details" link of any paid invoice
  3. Click "Issue Refund" green button then may be to choose "Off-Chain" method (we should use Lightning refund type)
  4. When we see a refund page - click by "QR-Code icon" then "Bech32" type button (the bug was seen by me in the SBW wallet)
  5. Scan by SBW wallet and get error "Expected String as JsString, but got null"
  6. To understand error we should decode LNURL, for example through Lightning Decoder and to click by "Callback URL"
  7. The Callback URL will have a JSON data like this: {"callback":"https://DOMAIN.COM/BTC/UILNURL/withdraw/pp/PAGfvWxoEfTU4ky6CmqawN8JxN3","k1":"PAGfvWxoEfTU4ky6CmqawN8JxN3","tag":"withdrawRequest","defaultDescription":null,"minWithdrawable":1000,"maxWithdrawable":395000,"currentBalance ":395000,"balanceCheck":"https://DOMAIN.COM/BTC/UILNURL/withdraw/pp/PAGfvWxoEfTU4ky6CmqawN8JxN3"}
  8. There is the defaultDescription field as null type but the LUD-03 requires the String type. The null value is not string type.

Relevant log output

{"callback":"https://DOMAIN.COM/BTC/UILNURL/withdraw/pp/PAGfvWxoEfTU4ky6CmqawN8JxN3","k1":"PAGfvWxoEfTU4ky6CmqawN8JxN3","tag":"withdrawRequest","defaultDescription":null,"minWithdrawable":1000,"maxWithdrawable":395000,"currentBalance ":395000,"balanceCheck":"https://DOMAIN.COM/BTC/UILNURL/withdraw/pp/PAGfvWxoEfTU4ky6CmqawN8JxN3"}

What browser do you use?

Firefox v106.*

Additional information

No response

Are you sure this is a bug report?

  • [X] I confirm this is a bug report

Perlover avatar Nov 01 '22 11:11 Perlover

@Kukks Can you check this one?

pavlenex avatar Nov 14 '22 09:11 pavlenex