PHPackages                             slevomat/csob-gateway - 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. slevomat/csob-gateway

ActiveLibrary[Payment Processing](/categories/payments)

slevomat/csob-gateway
=====================

CSOB payment gateway client

6.2.2(1mo ago)29168.5k—5.9%111MITPHPPHP ^8.1CI passing

Since Jan 11Pushed 1mo ago19 watchersCompare

[ Source](https://github.com/slevomat/csob-gateway)[ Packagist](https://packagist.org/packages/slevomat/csob-gateway)[ RSS](/packages/slevomat-csob-gateway/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (31)Used By (1)

CSOB gateway
============

[](#csob-gateway)

[![Build status](https://github.com/slevomat/csob-gateway/workflows/Build/badge.svg?branch=master)](https://github.com/slevomat/csob-gateway/actions?query=workflow%3ABuild+branch%3Amaster)[![Code coverage](https://camo.githubusercontent.com/3c9b1ed73f2cf85784e4a1d99b20b4c635540d346749b35dc7311aa0a67e4085/68747470733a2f2f636f6465636f762e696f2f67682f736c65766f6d61742f63736f622d676174657761792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/slevomat/csob-gateway)[![Latest Stable Version](https://camo.githubusercontent.com/8ef16f8b0cbf1e1fd863062e55e41d88ae91c17130e193e419bc8d277cdf81b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c65766f6d61742f63736f622d676174657761792e737667)](https://packagist.org/packages/slevomat/csob-gateway)[![Composer Downloads](https://camo.githubusercontent.com/1f3f8a717aea77776fc5d0a9371e04a7d25d1510b5e51117cc814d1c9c862019/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c65766f6d61742f63736f622d676174657761792e737667)](https://packagist.org/packages/slevomat/csob-gateway)

This repository provides a client library for ČSOB Payment Gateway.

- [CSOB payment gateway wiki](https://github.com/csob/paymentgateway/wiki)
- [CSOB eAPI 1.9](https://github.com/csob/platebnibrana/wiki/Vol%C3%A1n%C3%AD-rozhran%C3%AD-eAPI)

Library supports **all endpoints of eAPI 1.9** except NEJsplátku (loan@shop). Pull requests are welcome.

Older available versions (not actively maintained):

- Version 5.\* supports PHP 7.2 and eAPI 1.8
- Version 4.\* supports PHP 7.2 and eAPI 1.7
- Version 3.\* supports PHP 7 and eAPI 1.6.
- Version 2.\* supports PHP 7 and eAPI 1.5.
- Version 1.\* supports PHP 5.6 and eAPI 1.5.

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

[](#installation)

The best way to install slevomat/csob-gateway is using [Composer](http://getcomposer.org/):

```
> composer require slevomat/csob-gateway

```

Usage
-----

[](#usage)

First you have to initialize the payment in gateway and redirect customer to its interface.

**WARNING**: Please note, that all the prices are in hundredths of currency units. It means that when you wanna init a payment for 1.9 EUR, you should pass here the integer 190.

```
$apiClient = new ApiClient(
	new CurlDriver(),
	new CryptoService(
		$privateKeyFile,
		$bankPublicKeyFile
	),
	'https://api.platebnibrana.csob.cz/api/v1.8'
);

$requestFactory = new RequestFactory('012345');

// cart has to have at least 1 but most of 2 items
$cart = new Cart(Currency::EUR);
$cart->addItem('Nákup', 1, 1.9 * 100);

$customer = new Customer(
    'Jan Novák',
    'jan.novak@example.com',
    mobilePhone: '+420.800300300',
    customerAccount: new CustomerAccount(
        new DateTimeImmutable('2022-01-12T12:10:37+01:00'),
        new DateTimeImmutable('2022-01-15T15:10:12+01:00'),
    ),
    customerLogin: new CustomerLogin(
        CustomerLoginAuth::ACCOUNT,
        new DateTimeImmutable('2022-01-25T13:10:03+01:00'),
    ),
);

$order = new Order(
    OrderType::PURCHASE,
    OrderAvailability::NOW,
    null,
    OrderDelivery::SHIPPING,
    OrderDeliveryMode::SAME_DAY,
    addressMatch: true,
    billing: new OrderAddress(
        'Karlova 1',
        null,
        null,
        'Praha',
        '11000',
        null,
        Country::CZE,
    ),
);

$paymentResponse = $requestFactory->createInitPayment(
	123,
	PayOperation::PAYMENT,
	PayMethod::CARD,
	true,
	$returnUrl,
	HttpMethod::POST,
	$cart,
    $customer,
    $order,
    'some-base64-encoded-merchant-data',
    '123',
    Language::CZ,
    1800,
    1,
    2,
)->send($apiClient);
$payId = $paymentResponse->getPayId();

$processPaymentResponse = $requestFactory->createProcessPayment($payId)->send($apiClient);

// redirect to gateway
header('Location: ' . $processPaymentResponse->getGatewayLocationUrl());
```

After customer returns from gateway, he is redirected to `$returnUrl` where you have to process the payment.

```
try {
    $receivePaymentResponse = $requestFactory->createReceivePaymentRequest()->send($apiClient, $_POST /* $_GET */);
    if ($receivePaymentResponse->getPaymentStatus() === PaymentStatus::S7_AWAITING_SETTLEMENT) {
        // payment was successful!
    }
} catch (VerificationFailedException | InvalidSignatureException $e) {
    // request was not send from csob api
}
```

Please refer to the CSOB documentation and learn what states you should to check, they are all available as PaymentStatus::S\* constants.

Custom `ApiClientDriver`
------------------------

[](#custom-apiclientdriver)

API calls are made through `ApiClientDriver` interface. Library contains two default implementations of driver - CurlDriver and GuzzleDriver. You can also create your own driver by implementing the `ApiClientDriver` interface, and passing it to `ApiClient` constructor.

`CurlDriver` communicates via `curl` PHP extension, `GuzzleDriver` uses [guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle) library. If you want to use GuzzleDriver you need to require `guzzlehttp/guzzle` package in your composer.json.

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity44

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 56.6% 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 ~133 days

Recently: every ~303 days

Total

29

Last Release

53d ago

Major Versions

2.2.0 → 3.0.02016-07-21

2.x-dev → 3.0.12016-09-05

3.1.0 → 4.0.02017-11-20

4.3.0 → 5.0.02019-11-14

5.3.1 → 6.0.02022-09-21

PHP version history (6 changes)1.0.0PHP ^5.6.0|^7.0

2.0.0PHP ^7.0

4.0.0PHP ^7.1

4.3.0PHP ^7.2

5.1.0PHP ^7.2 || ^8.0

6.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/acc323747135bdd72731aafc0052a920b5e67c6cb8ffac74bf4b9eb44e9c0c90?d=identicon)[slevomat](/maintainers/slevomat)

---

Top Contributors

[![janlanger](https://avatars.githubusercontent.com/u/415695?v=4)](https://github.com/janlanger "janlanger (116 commits)")[![Daaarkling](https://avatars.githubusercontent.com/u/10207494?v=4)](https://github.com/Daaarkling "Daaarkling (39 commits)")[![pepakriz](https://avatars.githubusercontent.com/u/383294?v=4)](https://github.com/pepakriz "pepakriz (23 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (12 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (7 commits)")[![fprochazka](https://avatars.githubusercontent.com/u/158625?v=4)](https://github.com/fprochazka "fprochazka (2 commits)")[![x3wil](https://avatars.githubusercontent.com/u/3617293?v=4)](https://github.com/x3wil "x3wil (1 commits)")[![JanBukva](https://avatars.githubusercontent.com/u/7108035?v=4)](https://github.com/JanBukva "JanBukva (1 commits)")[![ludekbenedik](https://avatars.githubusercontent.com/u/454618?v=4)](https://github.com/ludekbenedik "ludekbenedik (1 commits)")[![mhujer](https://avatars.githubusercontent.com/u/353372?v=4)](https://github.com/mhujer "mhujer (1 commits)")[![obud](https://avatars.githubusercontent.com/u/40399469?v=4)](https://github.com/obud "obud (1 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

---

Tags

csob-gatewaypaymentgatewaycardcsobpaymentgateway

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/slevomat-csob-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/slevomat-csob-gateway/health.svg)](https://phpackages.com/packages/slevomat-csob-gateway)
```

###  Alternatives

[mrprompt/cielo

Integration with Cielo gateway.

481.9k1](/packages/mrprompt-cielo)

PHPackages © 2026

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