Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Refund Plugin Laravel Package

sylius/refund-plugin

Sylius Refund Plugin adds refund management to Sylius e-commerce stores. Administrators can create and process order and payment refunds, track refund states and items, and integrate refund workflows with Sylius resources and admin UI.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor to conditional. sylius/refund-plugin is not a generic PHP refund library; it is a Sylius plugin. Sylius is a Symfony-based e-commerce stack built on Doctrine ORM, Symfony DI/service tagging, Sylius ResourceBundle, and Winzou/Messenger-driven state machines. Every extension point it uses — RefundResource, grid/CRUD definitions, state machine callbacks on sylius_order_payment transitions, resource repositories, form types, and Twig/Admin UI hooks — has no analogue in Laravel. There is no composer-level interop: the package's service providers are Symfony compiler passes, not Laravel service providers, and its entities extend Sylius core models rather than Eloquent. For a Laravel codebase the realistic "integration" is zero code reuse — at best it serves as a reference implementation of refund domain modelling.

Integration feasibility.

Scenario Feasibility Notes
Existing Sylius 1.x store High Add via Composer, run migrations, wire refund payment methods; this is the intended path
Laravel app, headless Sylius as a separate backend Low Would require running a second runtime, syncing orders/customers, and proxying refund state — cost far exceeds writing the refund domain natively
Laravel app wanting refund logic None directly Port the concepts (Refund, RefundPayment, CreditMemo, state transitions) into Eloquent/domain services
Non-Sylius Symfony app Low Doctrine/state-machine parts portable only with substantial rework

Technical risk.

  • Version coupling: the plugin tracks Sylius minor versions tightly; a Sylius core upgrade can break it. Confirm the release/PHP/Symfony constraint matrix against the actual target version.
  • Data anomaly to verify: the stated last release date of 2026-10-06 is in the future. Treat this as a bad metadata signal and validate against Packagist/GitHub tags before any decision — do not plan against an unverified release.
  • Adoption signal is weak: 73 stars, 0 dependents, score 25.4. Low dependents does not mean low quality (plugins are consumed by applications, not libraries), but it does mean thin public evidence of production use at scale, few StackOverflow answers, and a small pool of people who have debugged it.
  • Money correctness: refunds are the highest-risk surface in commerce — partial refunds, multi-currency rounding, tax reversal, idempotency against duplicate gateway callbacks, and reconciliation against PSP settlement reports. Any implementation, ported or native, must own these explicitly.

Key questions for the requester.

  1. Is the target application actually on Sylius/Symfony, or Laravel? If Laravel, this package is out of scope and the exercise becomes "build vs. buy a Laravel refund module."
  2. What PSPs are in play (Stripe, Adyen, Mollie, Braintree)? Native SDKs plus Laravel Cashier may cover most needs without a Sylius dependency.
  3. Is the requirement refunds as a workflow (approval, credit memo, partials, offline refunds) or just call the gateway's refund API? Only the former justifies porting this much domain model.
  4. Who owns accounting/ERP reconciliation downstream? Credit memo format and export shape are usually dictated by finance, not by the plugin.

Integration Approach

Stack fit. Assume a Laravel/PHP target unless told otherwise. Score this package as not integrable and reclassify it as a design reference. The core entities worth mirroring are: Refund (aggregate root, tied to a Payment/Order, amount, currency, state), RefundPayment (the actual money movement, with gateway reference and idempotency key), and CreditMemo (the accounting document, often a generated PDF with sequential numbering). The valuable part is the state machine: requested → accepted/rejected → completed/failed, with units split per payment method.

Migration path.

  1. Nothing to migrate if you are on Laravel. Do not attempt to install Sylius into a Laravel app; the Doctrine/Symfony footprint is not worth it.
  2. If the org genuinely runs Sylius, the path is: composer require sylius/refund-plugin, enable the bundle, run Doctrine migrations, configure refund payment methods, and assign the refund-related state machine transitions and admin permissions.
  3. If migrating off Sylius toward Laravel, treat this plugin as the spec: export the refund/credit-memo schema, reimplement as Eloquent models plus a Laravel state machine (symfony/workflow is usable standalone, or use spatie/laravel-model-states), and backfill historical refunds.

Compatibility. Pin explicitly. Check PHP version, Sylius minor version, Symfony major, and Doctrine DBAL. If the 2026 release date is inaccurate, determine the actual latest tag and its Sylius constraint before scoping any work. Assume no compatibility with PHP 8.4 / Symfony 7 unless the composer.json says so.

Sequencing (Laravel-native build, recommended).

  1. Domain model + migrations: refunds, refund_lines (per order item / per payment), refund_transactions, credit_notes. Unique constraint on (payment_id, idempotency_key).
  2. Gateway integration behind an interface (RefundGateway::refund(amount, currency, reference)) with adapters per PSP; persist raw request/response payloads.
  3. State machine with explicit terminal states and a reconciliation job that polls PSPs for refunds stuck in pending.
  4. Admin UI (Filament/Nova) for approve/reject and partial amount entry, with a hard cap against captured amount minus prior refunds.
  5. Credit note numbering and PDF generation — assign only after finance signs off on the sequence and format.
  6. Reporting: refund rate by SKU, by payment method, by reason code.

Operational Impact

Maintenance. If you fork or vendor this plugin, you inherit a Sylius-version treadmill: every Sylius minor upgrade requires a plugin compatibility bump, and you are maintaining Symfony DI wiring for a codebase your team may not know. On the Laravel-native path, maintenance is ordinary application code your team already owns — materially lower long-term cost, which is the strongest argument against adopting the package outside Sylius.

Support. No vendor support; MIT with best-effort maintainer attention. The Sylius org gives it some legitimacy, but 73 stars and 0 dependents means community troubleshooting is scarce. Budget for reading source rather than finding answers. If the plugin is business-critical (it touches money), assume you will be the maintainer of last resort.

Scaling. Refund volume is a small fraction of order volume, so throughput is not the concern — consistency is. Watch: DB transactions spanning refund state and gateway calls (never hold a transaction open across an HTTP call), queue-based processing with retries, and a reconciliation job that tolerates PSP eventual consistency. Sylius's resource/Doctrine layer is fine here; the failure risk is in the money movement, not the ORM.

Failure modes to design for.

  • Gateway succeeds, local write fails → money out, no record. Mitigate with idempotency keys and a post-hoc PSP ledger import.
  • Duplicate webhook/callback → double refund. Mitigate with unique keys on (payment_id, gateway_refund_id).
  • Partial refund over-capture due to concurrent admin actions → use row-level locking or a refund-balance check inside a transaction.
  • Currency rounding drift across multiple partials → refund in minor units (integers), never floats.
  • Credit note numbering collisions under concurrency → DB sequence, not application-level max()+1.
  • State machine drift after upgrade (if on Sylius) → integration tests around refund transitions in CI.

Ramp-up. On Sylius: a Symfony-comfortable developer needs roughly 1–2 weeks to be productive, plus time to learn the Sylius resource/state-machine conventions (the real cost). A Laravel-only team would need weeks of Symfony context switching for a package they cannot use anyway — not justified. On the Laravel-native path, a mid-level developer with the gateway docs can ship the core refund flow in 1–2 weeks, with credit notes and reconciliation adding another 1–2 weeks. Either way, allocate explicit time for finance/accounting review, which historically consumes more calendar time than the engineering.

Bottom line. For a Laravel stack: do not adopt. Use it as a checklist for domain completeness and build natively against your PSP SDKs. For a Sylius stack: viable and probably the path of least resistance, contingent on verifying the actual latest release and its Sylius version constraint, since the reported release date is not credible as given.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox