PHPackages                             czetech/paygateapi - 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. czetech/paygateapi

ActiveLibrary[Payment Processing](/categories/payments)

czetech/paygateapi
==================

Library for connecting with Payment Gateway

01PHP

Since Oct 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/czetech/paygateapi-php)[ Packagist](https://packagist.org/packages/czetech/paygateapi)[ RSS](/packages/czetech-paygateapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Paygateapi library
==================

[](#paygateapi-library)

**Paygateapi** is a PHP library to access the State Treasury of Slovak Republic Payment Gateway.

Requirements
------------

[](#requirements)

- PHP 7.1 and above
- Built-in libcurl support
- Git
- Composer

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

[](#installation)

The installation is done using a [Composer](https://getcomposer.org/). If you don't already have Composer installed, first install it by following one of these instructions depends on your OS of choice:

- [Composer installation instruction for Windows](https://getcomposer.org/doc/00-intro.md#installation-windows)
- [Composer installation instruction for Linux / Unix / macOS](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx)

To install the paygateapi library, run the following command in the library directory:

```
composer install

```

Usage
-----

[](#usage)

Availability of the payment gateway:

```
$paymentGate = new PaymentGate();

$status = $paymentGate->callIsActive();
var_dump($status);
```

Download the payment gateway certificate:

```
$paymentGate = new PaymentGate();

$cert = $paymentGate->callGetCertificate();
var_dump($cert);
```

Make a payment and check the status of payment:

```
$paymentGate = new PaymentGate();

$key = 'file://key.pem');
$cert = $paymentGate->callGetCertificate();

$paymentRequest = new PaymentRequest('MID00001', new DateTime(),
    'http://localhost:4200/', '1');
$paymentRequest->setVs('123456789');
$location = $paymentGate->callPaymentRequest($paymentRequest, $key);
var_dump($location);

$checkStatePaymentRequest = new CheckStatePaymentRequest("MID00001", '1');
$checkStatePaymentRequest->setVs('123456789');
$arrayStatusResponse = $paymentGate->callCheckStatePayment(
    $checkStatePaymentRequest, $key, $cert);
var_dump($arrayStatusResponse);
```

Make a refund and check the status of refund:

```
$paymentGate = new PaymentGate();

$key = 'file://key.pem');
$cert = $paymentGate->callGetCertificate();

$refundPaymentRequest = new RefundPaymentRequest("MID00001", '1', 10000);
$refundPaymentRequest->setVs(123456789);
$refundPaymentResult= $paymentGate->callRefundPayment($paymentRequest, $key,
    $cert);
var_dump($refundPaymentResult);

$checkStateRefundPaymentRequest = new CheckStateRefundPaymentRequest("MID00001",
    $refundPaymentResult->getRefundId());
$refundStateResponse = $paymentGate->callCheckStateRefundPayment(
    $checkStateRefundPaymentRequest, $key, $cert);
var_dump($refundStateResponse);
```

Generate and get a report:

```
$paymentGate = new PaymentGate();

$key = 'file://key.pem');

$reportRequest = new ReportRequest("MID00001", new DateTime());
$resultCreateReport = $paymentGate->callGenerateReports($reportRequest, $key);
var_dump($resultCreateReport);

$reportRequest = new GetReportRequest("MID00001",
    $resultCreateReport->getReportId());
$reportResultObject = $paymentGate->callGetReport($reportRequest, $key);
if (! $reportResultObject->getReady()) {
    sleep($reportResultObject->getTryAgain());
    $reportResultObject = $paymentGate->callGetReport($reportRequest, $key);
}
var_dump($reportResultObject);
```

Check the validity of result for the merchant:

```
$paymentGate = new PaymentGate();

$cert = $paymentGate->callGetCertificate();

$resultForMerchant = new ResultForMerchant('OK',
    '2d886f42ba58f8c9f057c3e8d4d76a09901f54ac966e8224066a900b120e2d92', '5');
$resultForMerchant->setVs('123456789');
$resultForMerchant->setSs('1111');
$resultForMerchant->setKs('1111');
$resultForMerchant->setSign(
    'SCcSuPZsInOq7H/h4Agph5GVCKxV2a2b3SILQCkngCHALn+T6zIHq1DiI7vQFENnlsmIow1k' .
    '+FYTRFNMFGbtgmU6zV+BIKXk4DG6qSpdGBu0iVvO/hctQlaZSBJ2P5JQOmSGcRsexHd01gyw' .
    '4RvrLlMU5QTMnExSG+09u7MB0QXVLbcZutpn/5s31VVv1lm3ReXBszVXTjo/6Jl0i36a9f48' .
    'jezfm0hgkAsfTAePgqGR/feOjugHEFNrxxdcSxpp6nsx8j9sPx2ItU8vkLSfYLtfvR6UMHw+' .
    'oRMpfLj8Aea53QLfzTCsfpS/K6vB2HaRJ5+JSAe6z/o9a0dzg6Paew==');
$validity = $resultForMerchant->verifySign($cert);
var_dump($validity);
```

Tests
-----

[](#tests)

There are two environment variables for configuration:

- PAYGATEAPI\_URL: Base URL for API, default value `https://sppay.hpito.sk/api/`
- PAYGATEAPI\_KEY: Path to private key, default value `key.pem`

It is necessary to place the private key named `key.pem` to a folder with a library or determine his path by setting environment variable:

```
export PAYGATEAPI_KEY=/full/path/to/private_key.pem

```

The unit test is started by Composer with argument `test`:

```
composer test

```

Or alternatively by running `./vendor/bin/phpunit` with argument `tests`:

```
./vendor/bin/phpunit tests

```

For more informations see [PHPUnit](https://phpunit.de).

Documentation
-------------

[](#documentation)

Documentation is generated by Composer with argument `docs`:

```
composer docs

```

Or alternatively by running `./vendor/bin/phpdoc`:

```
./vendor/bin/phpdoc

```

Documentation is generated in `build/docs` directory.

For more informations see [phpDocumentor](https://www.phpdoc.org/).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![czepiec](https://avatars.githubusercontent.com/u/11430642?v=4)](https://github.com/czepiec "czepiec (1 commits)")

---

Tags

api-clientbankingslovakia

### Embed Badge

![Health badge](/badges/czetech-paygateapi/health.svg)

```
[![Health](https://phpackages.com/badges/czetech-paygateapi/health.svg)](https://phpackages.com/packages/czetech-paygateapi)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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