Fix Dogecoin & Monero multi-output refunds with proper fee handling
- Add payment amount to shop output for overpayment refunds
- Both XMR and DOGE now send payment + restocking fee to shop
- Fix insufficient funds error by using conservative fee buffer (0.01 DOGE)
- Round outputs down to 3 decimal places to avoid precision issues
- Update sendmany to try actual account first (where funds are located)
- Add better error handling for different account formats
- Fix fee calculation to properly account for Dogecoin's fee-on-top model
The issue was that sendmany adds network fee on top of outputs, and we were trying to send exactly the wallet balance, leaving no room for fees. Now we reserve 0.01 DOGE for fees and round conservatively.
Summary by CodeRabbit
- New Features
- Multi-output refunds for DOGE and XMR, splitting amounts between customer and shop with optional fee buffer and balance checks.
- Dogecoin fee check/fix targets added to tooling and help output.
- Allow link color styling in rich text and preserve shop styling context.
- Checkout and quotes pages recognize new/renamed payment statuses for improved terminal handling.
- Bug Fixes
- Smarter single-item cart redirect: only auto-opens digital products with files; otherwise redirects to invoice.
- Tests
- Comprehensive tests for multi-output refunds and edge cases.
- Chores
- Track sweep confirmation counts; database migration included.
Edited by CodeRabbit