PHPackages                             tpay-com/tpay-openapi-php - 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. [API Development](/categories/api)
4. /
5. tpay-com/tpay-openapi-php

ActiveLibrary[API Development](/categories/api)

tpay-com/tpay-openapi-php
=========================

Tpay OpenAPI library

2.4.3(1mo ago)8197.2k—0.8%15[2 PRs](https://github.com/tpay-com/tpay-openapi-php/pulls)5MITPHPPHP &gt;=5.6.0CI passing

Since Sep 4Pushed 1mo ago5 watchersCompare

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

READMEChangelog (10)Dependencies (14)Versions (48)Used By (5)

Tpay OpenAPI library
====================

[](#tpay-openapi-library)

Library for all methods available via OpenAPI [Tpay](https://openapi.tpay.com/).

[![Latest stable version](https://camo.githubusercontent.com/0e82fc5c89e56a3ddcb9d3c409dd5c6e6b9f4c3bfe4545695d003a43c481e8d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747061792d636f6d2f747061792d6f70656e6170692d7068702e7376673f6c6162656c3d63757272656e7425323076657273696f6e)](https://packagist.org/packages/tpay-com/tpay-openapi-php)[![PHP version](https://camo.githubusercontent.com/dcaf5f61c4875acc51b98293429d4c12be8c207de5f5befe6ed218a997b07fbe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f747061792d636f6d2f747061792d6f70656e6170692d7068702e737667)](https://php.net)[![License](https://camo.githubusercontent.com/894c8c0da663408fca9e2d4c8fb01704b113b16ba1dd95ba5bb799f3bb16373b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747061792d636f6d2f747061792d6f70656e6170692d7068702e737667)](LICENSE)[![CI status](https://github.com/tpay-com/tpay-openapi-php/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/tpay-com/tpay-openapi-php/actions)[![Type coverage](https://camo.githubusercontent.com/e5aa29285ec45088c7699b6ee9e2639cb2b9f74a42d06b172c30cba7e14b2d0e/68747470733a2f2f73686570686572642e6465762f6769746875622f747061792d636f6d2f747061792d6f70656e6170692d7068702f636f7665726167652e737667)](https://shepherd.dev/github/tpay-com/tpay-openapi-php)

[Polish version 🇵🇱 wersja polska](./README_PL.md)

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

[](#installation)

Install via [Composer](https://getcomposer.org):

```
composer require tpay-com/tpay-openapi-php
```

Install via [Git](https://git-scm.com) over SSH:

```
git clone git@github.com:tpay-com/tpay-openapi-php.git
```

Install via [Git](https://git-scm.com) over HTTPS:

```
git clone https://github.com/tpay-com/tpay-openapi-php.git
```

Manual download:

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

[](#configuration)

The only thing you need to do is to set your [OAuth](https://oauth.net) credentials like in example config file ([see example](examples/ExamplesConfig.php)). You can generate access keys in [Tpay's merchant panel](https://panel.tpay.com).

The [`src/Loader.php`](src/Loader.php) file handles all required class loading, so you can include this file to any file you are editing.

All methods described in [Tpay OpenAPI documentation](https://openapi.tpay.com) can be easily executed by running one of the library methods like:

```
$cache = new Cache(/** here you can inject your PSR6 or PSR16 cache storage object */);
$tpayApi = new TpayApi($cache,'12345-132123', '456');
$transactions = $tpayApi->Transactions->getTransactions();
```

##### Credentials

[](#credentials)

All currently available API methods have an example usage in [`Examples`](examples) directory. You can obtain sandbox credentials by registering on  website.

### Examples of usage

[](#examples-of-usage)

##### Frontend forms and payment handlers:

[](#frontend-forms-and-payment-handlers)

[Payment method choice form](examples/TransactionsApi/BankSelectionForm.php), [BLIK method form](examples/TransactionsApi/BlikPayment.php), [simple credit card form](examples/TransactionsApi/CardGate.php), [extended credit card form](examples/TransactionsApi/CardGateExtended.php), [recurrent payment example](examples/TransactionsApi/RecurrentPayment.php), [payment notification webhook](examples/Notifications/PaymentNotificationExample.php).

##### Merchant accounts registration (for partners only)

[](#merchant-accounts-registration-for-partners-only)

[Example of usages](examples/AccountsApi/AccountsApiExample.php).

Logs
----

[](#logs)

Library has own logging system to save all API calls, responses, webhook notifications, and exceptions. Make sure that `Logs` directory is writable and add rule to Apache `.htaccess` or NGINX to deny access to this area from browser. The log files are created for each day separately.

The logging is enabled by default, but you can disable this feature by command:

```
Logger::disableLogging();
```

You can also set your own logging path by this command:

```
Logger::setLogPath('/my/own/path/Logs/');
```

The logs file names will be assigned automatically.

You can replace the logging system above by setting up your own implementation of `Psr\Log\LoggerInterface` with:

```
Logger::setLogger($logger);
```

Custom templates and static files path
--------------------------------------

[](#custom-templates-and-static-files-path)

You can set your own templates path, so you can copy and modify the `phtml` template files from this library.

```
Util::$customTemplateDirectory = '/my/own/templates/path/';
```

You can set your own static files path, so you can copy and modify the `css` and `js` files from this library. By default, the path is based on `$_SERVER['REQUEST_URI']` value.

```
Util::$libraryPath = '/my/own/path/';
```

Language
--------

[](#language)

The library supports two languages (English and Polish). Default language is English. Change language example:

```
// Any time you construct the class providing payment forms, you can pass the language in constructor
$paymentForms = new PaymentForms('pl');
// After this line all static messages (input labels, buttons titles etc.) will be displayed in Polish

// If you want to access translations manually, use:
$lang = new Lang();
$lang->setLang('pl'); // for setting language
$lang->lang('pay'); // to echo translated key
```

License
-------

[](#license)

This library is released under the [MIT License](http://www.opensource.org/licenses/MIT).

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~58 days

Recently: every ~7 days

Total

42

Last Release

53d ago

Major Versions

1.8.0 → 2.0.02025-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dcff1f4946f5f9513219ae1de2da28b89f32aec2f6dc5034a1a1f6da05bcef4?d=identicon)[piotrjozwiak](/maintainers/piotrjozwiak)

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

---

Top Contributors

[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (30 commits)")[![piotrjozwiak](https://avatars.githubusercontent.com/u/22236446?v=4)](https://github.com/piotrjozwiak "piotrjozwiak (26 commits)")[![aleksanderkakol](https://avatars.githubusercontent.com/u/36276392?v=4)](https://github.com/aleksanderkakol "aleksanderkakol (13 commits)")[![kwojc](https://avatars.githubusercontent.com/u/5415799?v=4)](https://github.com/kwojc "kwojc (13 commits)")[![s4ddly](https://avatars.githubusercontent.com/u/110701663?v=4)](https://github.com/s4ddly "s4ddly (11 commits)")[![KamilBalwierz](https://avatars.githubusercontent.com/u/2470799?v=4)](https://github.com/KamilBalwierz "KamilBalwierz (8 commits)")[![krzGablo](https://avatars.githubusercontent.com/u/147171777?v=4)](https://github.com/krzGablo "krzGablo (4 commits)")[![pstasicki](https://avatars.githubusercontent.com/u/125288731?v=4)](https://github.com/pstasicki "pstasicki (2 commits)")[![michalbasinskiTpay](https://avatars.githubusercontent.com/u/120574392?v=4)](https://github.com/michalbasinskiTpay "michalbasinskiTpay (2 commits)")[![rgwsk65](https://avatars.githubusercontent.com/u/6093113?v=4)](https://github.com/rgwsk65 "rgwsk65 (2 commits)")[![radowoj-tpay](https://avatars.githubusercontent.com/u/160029194?v=4)](https://github.com/radowoj-tpay "radowoj-tpay (1 commits)")[![scardinius](https://avatars.githubusercontent.com/u/8309610?v=4)](https://github.com/scardinius "scardinius (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tpay-com-tpay-openapi-php/health.svg)

```
[![Health](https://phpackages.com/badges/tpay-com-tpay-openapi-php/health.svg)](https://phpackages.com/packages/tpay-com-tpay-openapi-php)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69433.0M114](/packages/algolia-algoliasearch-client-php)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)

PHPackages © 2026

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