PHP library to communicate with banks through the EBICS protocol (Electronic Banking Internet Communication Standard).
Supports EBICS versions 2.4, 2.5, 3.0 and signature/encryption variants E002, X002, A005, A006.
| Item | Version |
|---|---|
| PHP | 8.5+ (^8.5) |
| PHPUnit | ~10.5 |
| PHPStan | ~2.1 |
| PHPCS | ~3.13 (PSR-12) |
| Composer | latest |
bcmath, curl, dom, json, openssl, zip, zlib, libxml
The project uses Docker for a consistent development environment.
docker/
├── docker-compose.yml
└── php-cli/
├── Dockerfile (php:8.5.4-cli + xdebug + extensions)
└── php.ini
| Target | Image | Container Name |
|---|---|---|
php-cli-ebics-client-php |
php-cli-ebics-client-php:8.5.4-cli |
php-cli-ebics-client-php |
Network mode: host (for easy access to local services).
Xdebug is pre-installed and enabled (port 9003).
| Command | Alias | Description |
|---|---|---|
make docker-up |
u, start |
Start Docker containers |
make docker-down |
d, stop |
Stop Docker containers |
make docker-build |
build |
Rebuild Docker images |
make docker-install |
install |
Run composer install in container |
make docker-php |
php |
Open a bash shell in the PHP container |
make check |
— | Run PHPCBF, PHPCS, PHPStan, PHPUnit |
make credentials-pack |
— | Zip test credentials |
make credentials-unpack |
— | Unzip test credentials |
| Command | Description |
|---|---|
composer code-test |
Run PHPUnit tests |
composer code-style |
Run PHPCS |
composer code-analyse |
Run PHPStan |
├── src/ # PSR-4: EbicsApi\Ebics\
│ ├── Contracts/ # Interfaces
│ ├── Exceptions/ # Custom exception classes
│ ├── Factories/ # Factory classes (Crypt, Signature, etc.)
│ ├── Models/ # Data models (Key, KeyPair, Keyring, Buffer, etc.)
│ ├── Services/ # Business logic services
│ └── EbicsClient.php # Main client entry point
├── tests/ # PSR-4: EbicsApi\Ebics\Tests\
│ ├── _data/ # Test data & keyring files
│ ├── _fixtures/ # Test fixtures (XML files, keys)
│ ├── _workspace/ # Generated test artifacts
│ └── AbstractEbicsTestCase.php # Base test class with helpers
├── doc/schema/ # EBICS XSD schemas
└── docker/ # Docker configuration
- PSR-12 coding style (enforced by PHPCS).
- PHPStan level enforced via
phpstan.neon. - Source code lives in
src/; tests live intests/. - PHPCS targets
src/only (tests excluded inphpcs.xml). - Tests may use snake_case method names where needed (PHPCS exclusion).
CRITICAL: Agents MUST use Docker for all project-related commands (tests, linting, analysis, composer). The local environment does not have PHP installed.
All commands execute inside Docker:
# Start environment
make docker-up
# Run full quality check
make check
# Or individually:
docker compose -p ebics-client-php exec php-cli-ebics-client-php ./vendor/bin/phpunit
docker compose -p ebics-client-php exec php-cli-ebics-client-php ./vendor/bin/phpcs
docker compose -p ebics-client-php exec php-cli-ebics-client-php ./vendor/bin/phpstan
# Open shell
make docker-php- Base class:
AbstractEbicsTestCase(provides client setup, keyring, credentials). - Test groups (PHPUnit
@group): e.g.@group crypt-services. - Credentials stored in
tests/_data/credentials/credentials_<id>.json. - Keyrings stored in
tests/_data/workspace/keyring_<id>.json. - Fixtures (static XML/JSON) in
tests/_fixtures/.
// In any test extending AbstractEbicsTestCase:
$client = $this->setupClientV24($credentialsId); // EBICS 2.4
$client = $this->setupClientV25($credentialsId); // EBICS 2.5
$client = $this->setupClientV30($credentialsId); // EBICS 3.0Pass $fake = true or $debug = true to setupClient*() to use FakerHttpClient (returns fixture data) or DebuggerHttpClient (logs requests).
| Concept | Description |
|---|---|
| Keyring | Holds user & bank signatures (A = authentication, X = signing, E = encryption), passwords, and optional X.509 certificates. |
| Signature A | Authentication signature (versions A005 / A006). |
| Signature X | Transaction signing (version X002). |
| Signature E | Encryption (version E002). |
| CryptService | All crypto ops: hashing, AES-128-CBC encrypt/decrypt, RSA sign/encrypt, key generation, nonces, order IDs. |
| KeyPair | Public key + private key + password bundle. |
- Classes marked
@internalmay change without notice.
The library must have zero external production dependencies. This is a core design principle. Only PHP extensions are allowed in require.
composer.jsonrequiresection may only containphp ^8.5andext-*entries.- When a PSR interface is needed (e.g. PSR-3 Logger), copy it into
src/Contracts/. - PSR-18 HTTP client: the library uses its own
HttpClientInterfaceinsrc/Contracts/(not PSR-18). - PSR-3 Logger:
LoggerInterfaceis defined insrc/Contracts/LoggerInterface.php.
The EbicsClient uses LoggerInterface (PSR-3 compatible) for logging transaction steps, HTTP requests, errors, and other important events.