PHPackages                             avaibooksports/redsys-messages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. avaibooksports/redsys-messages

ActiveLibrary[Payment Processing](/categories/payments)

avaibooksports/redsys-messages
==============================

Redsys/Sermepa/Servired gateway message lists

0.2.2(11mo ago)28.3k↓33.9%1MITPHPPHP ^7.4||^8.0CI passing

Since Nov 24Pushed 11mo agoCompare

[ Source](https://github.com/AvaiBookSports/redsys-messages)[ Packagist](https://packagist.org/packages/avaibooksports/redsys-messages)[ RSS](/packages/avaibooksports-redsys-messages/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (6)Used By (1)

Redsys Messages
===============

[](#redsys-messages)

[![Tests status](https://github.com/AvaiBookSports/redsys-messages/workflows/Test/badge.svg)](https://github.com/AvaiBookSports/redsys-messages/workflows/Test/badge.svg)[![Quality assurance status](https://github.com/AvaiBookSports/redsys-messages/workflows/Quality%20assurance/badge.svg)](https://github.com/AvaiBookSports/redsys-messages/workflows/Quality%20assurance/badge.svg)

Installation
------------

[](#installation)

```
composer require avaibooksports/redsys-messages

```

Usage
-----

[](#usage)

To use the built-in translations, just load the standard catalog:

```
use AvaiBookSports\Component\RedsysMessages;

$redsysMessages = new RedsysMessages\Factory(new RedsysMessages\Loader\CatalogLoader());

// Returns "Expired card"
$redsysMessages->createCatalogByLanguage('en')->getDsResponseMessage('0101');

// You can load catalogs by ISO 639-1 and ISO 639-2
$redsysMessages->createCatalogByLanguage('eng')->getDsResponseMessage('0101');

// There is a different library for error messages. Those error codes can be provided by Redsys in two different formats:
$redsysMessages->createCatalogByLanguage('en')->getErrorMessage('9002'));
$redsysMessages->createCatalogByLanguage('en')->getErrorMessage('SIS0002')); // Alias of '9002'
```

### Creating and loading custom catalogs

[](#creating-and-loading-custom-catalogs)

To load a custom catalog, you must implement one or multiple classes implementing `AvaiBookSports\Component\RedsysMessages\CatalogInterface`.

After that, you just have to invoke the factory with an `ArrayLoader`:

```
// src/Redsys/Messages/Italian.php

namespace App\Redsys\Messages;

use AvaiBookSports\Component\RedsysMessages\CatalogInterface;

class English implements CatalogInterface
{
    /**
     * @var string[]
     */
    private $dsResponseMessages = [
        '0101' => 'Carta scaduta',
        // ...
    ];

    /**
     * {@inheritdoc}
     */
    public static function getIso639Alpha2()
    {
        return 'it';
    }

    /**
     * {@inheritdoc}
     */
    public static function getIso639Alpha3()
    {
        return 'ita';
    }

    /**
     * {@inheritdoc}
     */
    public function getDsResponseMessage($code)
    {
        if (array_key_exists($code, $this->dsResponseMessages)) {
            return $this->dsResponseMessages[$code];
        }

        return null;
    }
}
```

```
use AvaiBookSports\Component\RedsysMessages;

$redsysMessages = new RedsysMessages\Factory(
    new RedsysMessages\Loader\ArrayLoader([
        \App\Redsys\Messages\Italian::class,
        // ...
    ])
);

// "Carta scaduta"
$redsysMessages->createCatalogByLanguage('it')->getDsResponseMessage('0101');
```

Loading multiple catalogs
-------------------------

[](#loading-multiple-catalogs)

Probably you will want to load all the catalogs included in this library, and some custom catalogs for not supported languages.

You can use the `ChainLoader` for that purpose:

```
use AvaiBookSports\Component\RedsysMessages;

$redsysMessages = new RedsysMessages\Factory(
    new RedsysMessages\ChainLoader([
        new RedsysMessages\Loader\CatalogLoader(),
        new RedsysMessages\Loader\ArrayLoader([
            \App\Redsys\Messages\Italian::class,
            // ...
        ])
        new App\Redsys\Loader\MyCustomLoader(), // Maybe you want to implement your own loader?
    ])
);
```

`AvaiBookSports\Component\RedsysMessages\CatalogInterface\Factory` will allow as a parameter any class implementing `AvaiBookSports\Component\RedsysMessages\CatalogInterface\CatalogLoaderInterface`, and `ChainLoader` will allow you to load multiple catalogs at once, so nothing stops you from making your custom catalog loader.

Contributing
------------

[](#contributing)

Contributions are very welcome, especially catalog translations. If you made your catalog to support your native language, please consider making a pull request.

- Just keep an eye on the tests `vendor/bin/simple-phpunit` and don't use type-hinting except for `array` and `object`to support PHP 5. Use phpDoc.
- Fix your code formatting with `vendor/bin/php-cs-fixer fix`
- Take a look at `psalm` to check what you can improve

Following these steps will guarantee you a green check in the pull request!

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance50

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~411 days

Total

5

Last Release

355d ago

PHP version history (2 changes)0.1PHP &gt;=5.6

0.2.2PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/462de3bc6b5b394cc968eb74fc519cb923d18903f79cad6dc0397f9607b41f36?d=identicon)[DevNIX](/maintainers/DevNIX)

![](https://www.gravatar.com/avatar/5c50d60c9284f51fd09d97f4febc222b0d65f2c2e0b3979f811a081e921e7b30?d=identicon)[PabloOntivero](/maintainers/PabloOntivero)

---

Top Contributors

[![eusonlito](https://avatars.githubusercontent.com/u/644551?v=4)](https://github.com/eusonlito "eusonlito (21 commits)")[![devnix](https://avatars.githubusercontent.com/u/1777519?v=4)](https://github.com/devnix "devnix (12 commits)")[![AlvaroCodina](https://avatars.githubusercontent.com/u/17389134?v=4)](https://github.com/AlvaroCodina "AlvaroCodina (4 commits)")[![nerburish](https://avatars.githubusercontent.com/u/5610788?v=4)](https://github.com/nerburish "nerburish (1 commits)")

---

Tags

gatewaymessagesmultilanguageredsyssermepaserviredtpvgatewaymessagessermeparedsystpvservired

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/avaibooksports-redsys-messages/health.svg)

```
[![Health](https://phpackages.com/badges/avaibooksports-redsys-messages/health.svg)](https://phpackages.com/packages/avaibooksports-redsys-messages)
```

###  Alternatives

[sermepa/sermepa

Pasarela de pago Redsys, Sermepa

207395.1k7](/packages/sermepa-sermepa)[redsys/messages

Redsys/Sermepa/Servired TPV Messages lists

10212.9k7](/packages/redsys-messages)[redsys/tpv

Package to connect with Redsys/Sermepa/Servired TPV

63144.9k](/packages/redsys-tpv)[ssheduardo/redsys-laravel

Package redsys for laravel

100129.5k1](/packages/ssheduardo-redsys-laravel)[commerceredsys/sermepa

Payment gateway library for spanish banks that use Sermepa/Redsýs systems.

1062.0k](/packages/commerceredsys-sermepa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
