Fix Pay User lightning payment bugs

- Fix default amount showing fiat instead of sats when lightning payment selected
- Fix invoice response field name (bolt11 instead of payment_request)
- Fix NameError in payables/pay endpoint (wallet -> auth.user_id)
- Add get_user_wallet_settings_by_prefix() for truncated 8-char user IDs
- Update user-wallet endpoint to handle truncated IDs from Beancount accounts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-01-19 07:17:12 -05:00
parent 8d9e14ee5a
commit c4f784360d
3 changed files with 40 additions and 5 deletions

View file

@ -1424,7 +1424,7 @@ window.app = Vue.createApp({
maxAmount: maxAmountSats, // Positive sats amount castle owes
maxAmountFiat: maxAmountFiat, // EUR or other fiat amount (positive)
fiatCurrency: fiatCurrency,
amount: fiatCurrency ? maxAmountFiat : maxAmountSats, // Default to fiat if available
amount: maxAmountSats, // Default to sats since lightning is the default payment method
payment_method: 'lightning', // Default to lightning for paying
description: '',
reference: '',
@ -1456,8 +1456,9 @@ window.app = Vue.createApp({
memo: `Payment from Castle to ${this.payUserDialog.username}`
}
)
console.log(invoiceResponse)
const paymentRequest = invoiceResponse.data.payment_request
const paymentRequest = invoiceResponse.data.bolt11
// Pay the invoice from Castle's wallet
const paymentResponse = await LNbits.api.request(