webgriffe/payum-lock-request-extension
Payum extension for PHP that locks payment requests to prevent duplicate or concurrent processing. It wraps gateway actions with a lock, guarding capture, authorize, and status calls against double submits and race conditions. Registers as a standard Payum extension; no gateway changes needed.
Architecture fit
ExtensionInterface with onPreExecute / onExecute / onPostExecute hooks, which is exactly where a cross-cutting concurrency guard belongs. Because it is an extension rather than a gateway fork, it composes with any gateway (Stripe, PayPal, Adyen, offline) without touching gateway code or your domain layer.symfony/lock is the correct abstraction: store-backed locking (Redis, PDO, DynamoDB, flock, semaphore) means correctness is a function of shared-store topology rather than in-process state. That is the only model that survives a multi-node deployment.Payment entities) and weakest where the upstream gateway already enforces idempotency keys (Stripe). In the latter case this becomes defense-in-depth, not the primary control — important for scoping expectations.execute calls after a redirect round-trip.Integration feasibility
composer require, register the extension on PayumBuilder, wire a LockFactory. No migrations, no schema changes, no gateway reconfiguration.Technical risk
Key questions
execute path, or also notify/token-verification callbacks? Webhooks racing a synchronous capture are the more common source of concurrent writes.payum/payum version constraint, and supported PHP matrix?Stack fit (Laravel/PHP)
symfony/lock + Payum). Laravel integration is by composition, not package auto-discovery. In practice you are either already on Sylius/Symfony, or hand-wiring Payum into a Laravel service provider via the (stale) payum/laravel-payum bridge.Cache::lock() on a Redis or database store — the same distributed-mutex primitive, but framework-native configuration, observability, and support. Functionally interchangeable with this package for the guard-rail use case.Migration path and sequencing
Cache::lock / symfony/lock) inside your own payment module with your own tests.Compatibility
payum/payum constraint, symfony/lock major version, and PHP 8.x support before committing.array, file, or a per-node store in a load-balanced deployment — that silently reduces the mutex to a no-op.Maintenance
Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?