Skip to content

POS-1: Add refund feature to transaction history screen#56

Open
forge0x wants to merge 1 commit intolnflash:mainfrom
forge0x:feature/pos-1-refund-transactions
Open

POS-1: Add refund feature to transaction history screen#56
forge0x wants to merge 1 commit intolnflash:mainfrom
forge0x:feature/pos-1-refund-transactions

Conversation

@forge0x
Copy link
Copy Markdown

@forge0x forge0x commented May 2, 2026

Summary

Adds a Refund button to each completed transaction in the transaction history screen, allowing merchants to refund the original amount back to the customer via LNURL-withdraw.

Changes

  • New hook useRefund (src/hooks/useRefund.tsx) — Encapsulates the refund flow with confirmation dialog, double-tap protection, and user feedback
  • TransactionHistory slice — Added refundingIds state, setRefunding and markRefunded reducers
  • TransactionData type — Added optional refunded boolean flag
  • TransactionHistory screen — Refund button next to Reprint, shows "Refunding..." during processing, "Refunded" badge on completed refunds

Technical Details

  • Refund button only shows on completed transactions with satAmount > 0 that haven't been refunded yet
  • Confirmation dialog shows amount before initiating
  • Double-tap protection via ref-based tracking
  • clearTransactionHistory also resets refunding state

Closes #46

- New useRefund hook with LNURL-withdraw confirmation flow
- Refund button on completed, non-zero transactions
- Refunding state with double-tap protection
- Refunded badge on completed refunds
- TransactionData.refunded flag and refundingIds slice state
- Clear history resets refunding state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] - add refund feature in transaction history screen

1 participant