Add plugin purchase refund system - #342
Merged
Merged
Conversation
Adds ability for admins to refund plugin purchases from Filament, including Stripe refund, license revocation, and payout cancellation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # package-lock.json
Resolves conflicts in PluginPayoutFactory (kept main's states and added cancelled) and package-lock.json (took main's). Main added a Held payout status that gets promoted to Pending, and a manual retry for Failed payouts. The refund only cancelled Pending payouts, so a refunded purchase could still pay out later. It now cancels any payout that isn't already cancelled, and still reverses ones that were transferred. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admin license tables, Third-Party Sales and Payouts now show who refunded a sale, when, and the Stripe refund ID. Third-Party Sales gets the Refund button and a Refunded filter too. The refund action is now one shared Filament action. Buyers no longer see refunded plugins under Purchased Plugins; they show as refunded in Purchase History instead. Both pages fit on mobile without scrolling sideways. On the developer dashboard, refunded payouts show as Refunded instead of Failed, refunds don't count as sales, pending payouts say when they should reach the seller's Stripe account, and the plugin and payout lists use the same table style as the rest of the dashboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lockfile got regenerated with a local npm while resolving merge conflicts, which dropped @docsearch/css. CI installs from the lockfile, so the asset build failed before any tests ran. This branch doesn't touch JS dependencies, so it now uses main's lockfile as-is. Also adds a test that a refunded buyer loses access and gets it back by buying the plugin again through the normal checkout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
isActive(), theactive()scope, and thesales_viewChanges
PayoutStatusenum: AddedCancelledcasePluginPayoutmodel: AddedmarkAsCancelled(),isCancelled(),cancelled()scopePluginLicensemodel: AddedisRefunded(),isRefundable(),refundedBy()relationship; updatedisActive()andactive()scopeStripeConnectService: AddedrefundPaymentIntent()andreverseTransfer()methodsRefundPluginPurchaseaction: Orchestrates Stripe refund → DB transaction (license revocation + payout cancellation/reversal)refunded_at,stripe_refund_id,refunded_bytoplugin_licenses; updatessales_viewto exclude refunded rowsPluginPayoutFactorywithtransferred()/cancelled()states; addedrefunded()state toPluginLicenseFactoryTest plan
tests/Feature/PluginPurchaseRefundTest.php)🤖 Generated with Claude Code