Skip to content

Add admin Payouts section with failure tracking and manual retry#439

Merged
simonhamp merged 3 commits into
mainfrom
admin-payouts
Jul 23, 2026
Merged

Add admin Payouts section with failure tracking and manual retry#439
simonhamp merged 3 commits into
mainfrom
admin-payouts

Conversation

@simonhamp

Copy link
Copy Markdown
Member

What

Adds a Payouts section to the Filament admin (under Products) for monitoring third-party plugin sales payouts.

List view

  • Plugin name, customer email, amount paid, amount due to the seller (based on their payout percentage at the time of sale), status badge, paid-out indicator, and attempt count
  • Filterable by status

Detail view

  • Full payout breakdown: amounts, platform fee, Stripe transfer ID, timestamps, and the latest failure reason when a payout has failed
  • Attempt History relation manager showing every transfer attempt with its charge ID, transfer ID, and Stripe error message

Failure tracking (new)

We previously only logged Stripe transfer errors — they weren't stored. Now:

  • plugin_payouts gains failure_reason, attempt_count, and last_attempted_at
  • New plugin_payout_attempts table records each attempt (success or failure) with the charge ID and error message, e.g. The currency of source_transaction's balance transaction (usd) must be the same as the transfer currency (eur)
  • StripeConnectService::processTransfer() persists these on every attempt; a successful transfer clears the failure reason

Manual retry

A Retry Payout button (list row + detail header, visible only for failed payouts) resets the payout to pending and immediately dispatches ProcessPayoutTransfer onto the queue.

Why

Failed payouts were only visible in logs, making it hard to see which sellers hadn't been paid and why. This gives admins visibility into every payout's state and history, plus a one-click retry once the underlying issue (e.g. currency mismatch) is fixed.

Tests

  • StripeConnectPayoutFailureTest — failure reason + attempt persisted on error; succeeded attempt recorded on success
  • PluginPayoutResourceTest — list/detail rendering, amounts shown, status filter, attempt history, retry action dispatches the job and resets status, retry hidden for transferred payouts

🤖 Generated with Claude Code

simonhamp and others added 2 commits July 23, 2026 00:57
Adds a Filament resource for plugin payouts showing plugin, customer,
amounts, and payout status. Records every transfer attempt (with the
Stripe error on failure) in a new plugin_payout_attempts table, stores
the latest failure reason on the payout, and adds a Retry Payout action
that resets the payout to pending and re-dispatches the transfer job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- New admin Third-Party Sales screen showing every paid third-party
  plugin sale with its payout status and a Missing badge for orphans
- Payouts are now always created at sale time; Held when the seller's
  Stripe Connect account can't yet receive payouts, healed to Pending
  by the daily payouts:process-eligible run
- Remove the Ultra/Max 0% platform fee rule; splits always respect the
  developer account's payout percentage
- New payouts:backfill command (with --dry-run) to create missing
  payout records for historical sales

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simonhamp
simonhamp marked this pull request as ready for review July 23, 2026 00:34
@simonhamp
simonhamp merged commit a6b37bd into main Jul 23, 2026
2 checks passed
@simonhamp
simonhamp deleted the admin-payouts branch July 23, 2026 00:49
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.

1 participant