feat: implement Stripe transaction history and refund functionality f…#104
Merged
Conversation
…k in transaction history
…ed state and enhancing refund status display
e750c45 to
79866bb
Compare
martin0024
requested changes
Jun 22, 2026
martin0024
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89
Overview
Admins can view a customer’s Stripe charge history and issue full or partial refunds directly from the Users table, without leaving the app.
Backend (actions.ts, schema.ts)
getUserTransactions — lists charges for a Stripe customer with cursor pagination (starting_after / ending_before), expanded refunds and payment intents, and mapped descriptions from charge / PI / metadata.
createTransactionRefund — creates refunds via Stripe with idempotency keys, admin auth, server-side refundable balance checks, and returns the updated charge for the UI.
Zod schemas for list params and refund payloads.
UI (user-transactions-modals.tsx, user-actions-cell.tsx)
Receipt icon on each user row (when they have a stripeCustomerId) opens a transactions modal.
Paginated table: date, description, amount, refund status.
Row click opens a refund dialog with refund history, partial amount input, and confirm-before-submit for full/partial refunds.
Toast feedback for success, pending, and error states.
Testing
Unit tests (actions.test.ts)
getUserTransactions: admin guard, charge mapping from Stripe list response.
createTransactionRefund: unauthorized, fully refunded charge, over-cap partial, successful full refund with updated transaction.
Screenshots / Screencasts
Checklist
Notes