PHPackages                             paysys/tatrapay - 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. paysys/tatrapay

ActiveLibrary[Payment Processing](/categories/payments)

paysys/tatrapay
===============

Library for Tatra bank TatraPay gateway in Nette framework.

v0.1-alpha.1(9y ago)03MITPHPPHP &gt;=7.1

Since Mar 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/PaySys/TatraPay)[ Packagist](https://packagist.org/packages/paysys/tatrapay)[ Docs](https://github.com/PaySys/TatraPay)[ RSS](/packages/paysys-tatrapay/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

PaySys\\TatraPay
================

[](#paysystatrapay)

[![Build Status](https://camo.githubusercontent.com/d388ae277984d3ed2bb279e502b9e86b9b6eb412844e59fc509121d65c76659e/68747470733a2f2f7472617669732d63692e6f72672f5061795379732f54617472615061792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PaySys/TatraPay)[![Code Quality](https://camo.githubusercontent.com/e2a4b9f1aea647f312ad6b496887718f133a64b2d6d3472258588670f4fc5b9d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5061795379732f54617472615061792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PaySys/TatraPay/)[![Code Coverage](https://camo.githubusercontent.com/a44d5f55db752083c3edfc0ca5220501c73c2daa2f56de758bfe58ab03c03fa8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5061795379732f54617472615061792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PaySys/TatraPay/)[![Packagist](https://camo.githubusercontent.com/038706620b01405bd0067d0c0f4f08901610bff64c24ac88425357709ae67c1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5061795379732f74617472617061792e737667)](https://packagist.org/packages/PaySys/TatraPay)[![MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)

Library for implement TatraPay gateway ([v4.0 with HMAC &amp; ECDSA](http://www.tatrabanka.sk/tatrapay/TatraPay_technicka_prirucka_HMAC.pdf)) from Tatra Banka in Nette framework.

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

[](#requirements)

Requires PHP 7.1 or later.

Use universal libraty [PaySys\\PaySys](https://github.com/PaySys/PaySys).

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

[](#installation)

The best way to install Unique is use [Composer](http://getcomposer.org) package [`PaySys/TatraPay`](https://packagist.org/packages/PaySys/TatraPay).

```
$ composer require paysys/tatrapay
```

Configuration
-------------

[](#configuration)

```
extensions:
	TatraPay: PaySys\TatraPay\DI\TatraPayExtension

TatraPay:
	mid: '1234'
	key: '64-bit hexadecimal string'
```

Events
------

[](#events)

### Object `PaySys\PaySys\Button`

[](#object-paysyspaysysbutton)

EventParametersDescription$onBeforePayRequest\\PaySys\\PaySys\\IPayment $paymentOccurs before pay request$onPayRequest\\PaySys\\PaySys\\IPayment $paymentOccurs on pay request### Service `PaySys\TatraPay\Security\Response`

[](#service-paysystatrapaysecurityresponse)

EventParametersDescription$onResponsearray $parametersOccurs on response from bank$onSuccessarray $parametersOccurs on success payment response from bank$onFailarray $parametersOccurs on fail payment response from bank$onErrorarray $parameters, \\PaySys\\PaySys\\Exception $eOccurs on damaged response from bankExample
-------

[](#example)

### Generating payment button

[](#generating-payment-button)

Set `PaySys\TatraPay\Payment`.

Button need `PaySys\PaySys\IConfiguration` service. Use DI generated factory `PaySys\TatraPay\IButtonFactory` for getting configured `PaySys\PaySys\Button` component.

Now set `$onPayRequest` event on `PaySys\PaySys\Button` for redirect to TatraPay gateway. Signed redirect URL is genereated by service `PaySys\TatraPay\Security\Request->getUrl(PaySys\TatraPay\Payment $payment)`.

```
class OrderPresenter extends Presenter
{
	/** @var \PaySys\TatraPay\IButtonFactory @inject */
	public $tatraPayButtonFactory;

	/** @var \PaySys\TatraPay\Security\Request @inject */
	public $tatraPayRequest;

	protected function createComponentTatraPayButton()
	{
		$payment = new \PaySys\TatraPay\Payment("12.34", "00456", "John Doe");
		$button = $this->tatraPayButtonFactory->create($payment);
		$button->onPayRequest[] = function ($payment) {
			$this->redirectUrl($this->TatraPayRequest->getUrl($payment));
		};
		return $button;
	}
}
```

### Process payment response

[](#process-payment-response)

#### Event-driven processing

[](#event-driven-processing)

Default is Bank response routed to included presenter `TatraPay:TatraPay:process`. In this case are automatic called events on service `PaySys\TatraPay\Security\Response`.

For processing payment by events use for example [Kdyby\\Events](https://github.com/Kdyby/Events).

#### Own presenter

[](#own-presenter)

Too it's possible write own `Nette\Application\UI\Presenter` for hnadling payment. In this case are events called same as before example.

```
class OrderPresenter extends Presenter
{
	/** @var Nette\Http\IRequest @inject */
	public $httpRequest;

	/** @var \PaySys\TatraPay\Security\Response @inject */
	public $bankResponse;

	public function actionProcessTatraPay()
	{
		try {
			$this->bankResponse->paid($this->httpRequest->getQuery());
			// store info about payment
			$this->flashMessage('Thanks for payment.', 'success');
		} catch (\PaySys\PaySys\Exception $e) {
			// log
			$this->flashMessage('Payment failed. Please try it later.', 'danger');
		}
		$this->redirect('finish');
	}
}
```

Now just add route to configuration:

```
tatraPay:
	rurl: Order:processTatraPay
```

Exceptions
----------

[](#exceptions)

```
class \PaySys\PaySys\Exception extends \Exception {}
class \PaySys\PaySys\SignatureException extends \PaySys\PaySys\Exception {}
class \PaySys\PaySys\ServerException extends \PaySys\PaySys\Exception {}
class \PaySys\PaySys\InvalidArgumentException extends \PaySys\PaySys\Exception {}
class \PaySys\PaySys\ConfigurationException extends \PaySys\PaySys\Exception {}
```

###  Health Score

20

—

LowBetter than 16% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/449a7c90ef6867e1933b546f9e309c7e68c5604067940a7e89c5bb8227f90830?d=identicon)[romanmatyus](/maintainers/romanmatyus)

---

Top Contributors

[![romanmatyus](https://avatars.githubusercontent.com/u/1110294?v=4)](https://github.com/romanmatyus "romanmatyus (2 commits)")

---

Tags

gatewayBanktatrapaytatrabank

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/paysys-tatrapay/health.svg)

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

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

943327.8k5](/packages/shetabit-payment)[shetabit/multipay

PHP Payment Gateway Integration Package

291345.8k3](/packages/shetabit-multipay)[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[aharen/pay

Payment processing with Bank of Maldives/Maldives Payment Gateway (MPG), Maldives Islamic Bank (MIB) &amp; MFaisaa by Oooredoo Maldives.

271.0k](/packages/aharen-pay)

PHPackages © 2026

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