redsys/messages
Redsys Messages is a PHP library for building and validating Redsys payment gateway messages, including signed requests and notifications. It helps Laravel/PHP apps handle merchant parameters and HMAC SHA-256 signatures when integrating Redsys payments.
What this package actually is: Despite the "Laravel package" framing, eusonlito/redsys-Messages is a reference-data library — a lookup table mapping Redsys response identifiers (Ds_Response, 4-digit codes, and Ds_ErrorCode, SIS* codes) to human-readable Spanish messages, plus a thin accessor and Laravel service provider. It is not a payment gateway client, signer, or HTTP integration. It is a display/translation layer that sits downstream of whichever Redsys SDK you actually use to build and validate the signed request.
Architecture fit: Good fit as an adjacent dependency, not a core one. In a Laravel codebase it belongs in the presentation/diagnostics boundary: given a raw gateway response, resolve a merchant-facing message. It should never be consulted for business logic (authorization decisions must be driven by your own explicit code branches, not by string matching against a third-party message catalog). Recommended pattern: wrap it behind your own RedsysResponseResolver interface so the package is an implementation detail you can replace with a vendored array in an afternoon.
Integration feasibility: Low effort. Composer require, Laravel auto-discovery, optional config publish. The real work is not wiring — it is auditing the data: coverage of the 0000–0099 authorized range, the 0900/0902/0903/0904 refund/confirmation family, the 0190/0191/0192 authorization variants, and the full SIS error namespace. Expect gaps.
Technical risk:
composer audit / policy-exception cost.Ds_Response in 0000–0099 is a success, not an error). A naive lookup table is easy to mis-key.Key questions:
Ds_Response from Ds_ErrorCode namespaces, or does it flatten both into one map?null?Recommendation: Do not adopt as a runtime dependency. Vendor the data — extract the code→message array, review it against the current Redsys manual, and maintain it as an internal config file with a test for every code you actually branch on. Keep the package as a citation in the PR description. The value is the collated data, not the 200 lines of PHP around it.
Stack fit: Compatible in spirit with any Laravel 6+ app, but verify composer.json constraints before assuming Laravel 10/11 support — a 2021 release may cap at ^8.0. If it does not install, that is not a blocker: the payload is copy-pasteable data.
Migration path: Additive only — there is nothing to migrate from unless you currently hardcode Redsys messages in controllers or Blade templates. If you do, this is a clean opportunity to consolidate scattered if ($code == '0184') strings into a single resolver.
Compatibility: Pairs with any Redsys request builder (eusonlito/redsys-php, sermepa, or an in-house signer). It neither requires nor conflicts with them. It has no opinion on signature computation (Ds_SignatureVersion, HMAC_SHA256 ordering) and provides no help there.
Sequencing:
config/redsys/messages.php or a RedsysMessages value object; delete the dependency.resolve(string $code, string $source): RedsysMessage returning a structured object (code, category, merchant message, customer message, retryable flag), not a bare string.Ds_Response/Ds_ErrorCode alongside the resolved message; emit a metric on unknown-code hits.unknown case.Do not surface the package's Spanish strings directly to end users; they are diagnostic text, not UX copy.
Maintenance: Effectively single-maintainer and stale. Budget near-zero effort for the code, but a recurring quarterly-ish data review is mandatory — Redsys adds or redefines codes around 3DS/SCA/PSD2 changes. Vendoring converts an unmaintainable dependency into a maintainable 1-file artifact you control.
Support: No commercial backing, no issue-triage SLA, no changelog discipline. Escalation path is the Redsys merchant portal and the integration manuals (Spanish). Internal support burden concentrates on one question: "the customer saw a blank/failed payment screen and we don't know why" — mitigated entirely by logging raw codes and always rendering a generic fallback message.
Scaling: Not a factor. Static in-memory arrays, microseconds per lookup, negligible opcache footprint. No cache, queue, or connection pool implications. Scales linearly with traffic at effectively zero marginal cost.
Failure modes:
null message rendered into a customer-facing error pane. Highest-probability failure; mitigate with a mandatory fallback string and an alert on unresolvable codes.SIS* error as a Ds_Response (or vice versa) yields a confidently wrong message.0001 as an error when it is an authorized response; this can mislead support staff into refunding valid transactions.Ramp-up: A developer wires it in under an hour. The real onboarding cost is domain literacy, not tooling: understanding the 0000–0099 success band, authorization vs. confirmation vs. refund semantics, and that Redsys error codes are batch-level outcomes rather than clean per-card reasons. Plan for a short internal write-up and a glossary — that knowledge is worth more than the package and is precisely why vendoring the data (with citations to the manual) beats depending on a 10-star repository.
How can I help you explore Laravel packages today?