karser/robokassa-bundle
Symfony bundle for integrating the Robokassa payment gateway. It generates signed payment URLs, handles result and success callbacks, and lets you configure merchant credentials, currency, and test mode in your Symfony application.
Architecture fit
karser/robokassa-bundle is a Symfony bundle (DI extension + KarserRobokassaBundle), not a Laravel package. It has no service provider, no publishable config, no facade, and no Laravel-idiomatic contracts. In a Laravel codebase it is not installable in the normal sense — it is source material.JMSPaymentCoreBundle's PaymentSystem/PaymentInstruction model. That means adopting it imports two EOL layers (JMS Payment and Symfony 2/3-era DI) to solve what is fundamentally a ~300-line HTTP + signature problem.InvoiceURL redirect, ResultURL server callback, SuccessURL/FailURL returns, InvId correlation, and the signature construction over MerchantLogin:OutSum:InvId:Password. Roughly 80% of the package's worth is that specification; 20% is implementation.PaymentGateway interface with vendor-neutral DTOs (PaymentIntent, CallbackResult, ReconciliationRecord), Robokassa becomes one adapter among several (YooKassa, Tinkoff, Stripe). The bundle can inform that adapter; it cannot be it.Integration feasibility
| Path | Feasibility | Notes |
|---|---|---|
composer require karser/robokassa-bundle in Laravel |
Reject | Pulls Symfony 2.8/3.x and JMS Payment; conflicts with Laravel 9+ (Symfony 6/7 components) |
| Fork and port Symfony bundle → Laravel service provider | Medium effort | Retains an abstraction layer you don't want; porting cost exceeds rewrite cost |
| Use as reference implementation; write native Laravel adapter | Recommended | ~2–4 dev-days; zero transitive baggage |
| Substitute a maintained Robokassa SDK | Evaluate | Prefer only if actively maintained and PHP 8.2+/Laravel 11 compatible |
php: ^5.6 || ^7.0 and symfony/symfony: ^2.8 || ^3.0 in composer.json. Verify directly — this is a 10-minute check that gates the whole decision.Technical risk
InvId uniqueness enforcement. Assume you must re-audit rather than inherit.Key questions
composer.json constraints (PHP, Symfony, JMS Payment)? Does it run at all on PHP 8.x?PaymentGateway abstraction already, or would this be the first?Stack fit
composer.json under any Laravel version currently supported.app/Services/Payments/Robokassa/ implementing an internal PaymentGateway contract. Components: RobokassaSignature (algorithms + hash selection), RobokassaClient (HTTP via Laravel's Http facade, explicit timeouts and retries), ResultController (callback endpoint), Payment model + state machine, ReconcileRobokassaPayments job.InvId/OutSum string fields and kopeck precision must be normalized at the boundary; downstream code should see integer minor units and internal IDs.Migration path
Compatibility
ext-json, ext-hash, and hash algorithm availability.OutSum vs outSum, InvId vs invId); casing mismatches are a common source of silent signature failures.Sequencing
composer.json; stand up Robokassa sandbox/test credentials; confirm signature construction and receipt requirements; test a full redirect → callback cycle with a hand-rolled script.InvId; state machine that rejects illegal transitions; return the exact response body Robokassa expects for acknowledgement.Maintenance
Support
Scaling
InvId allocation must be handled at the application layer — the bundle offers no guidance and a fork inherits that gap.Failure modes
| Failure | Impact | Mitigation |
|---|---|---|
| Callback never arrives | Order stuck pending, customer paid but unfulfilled | Scheduled reconciliation job; never rely on callback alone |
| Duplicate callbacks | Double fulfillment / double credit | Unique constraint on InvId + idempotent handler |
| Signature mismatch | Payment rejected or, worse, spoofed acceptance | Timing-safe comparison; alert on mismatch rate |
| Rounding/precision error | Off-by-kopeck mismatches in reconciliation | Integer minor units end-to-end; never float |
| Fiscalization rejection (54-FZ) | Legally non-compliant receipts | Validate receipt payload in sandbox before launch |
| Out-of-order or late callbacks | State machine corruption | Monotonic state transitions; reject backwards moves |
| Gateway timeout on redirect | Abandoned carts | Explicit HTTP timeouts; surface a retry path to the user |
Ramp-up
TPM recommendation: Do not adopt. Score the package as reference material only. The MIT license, simple protocol, and tiny surface area mean a native Laravel adapter is cheaper, safer, and fully supportable — and the 2018 timestamp plus 0 dependents means the alternative carries all the risk with none of the leverage. Gate the decision on one question: does the merchant require 54-FZ receipts and SBP? If yes, this package is disqualified outright rather than merely deprecated.
How can I help you explore Laravel packages today?