PHPackages                             tpay-com/tpay-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. [Payment Processing](/categories/payments)
4. /
5. tpay-com/tpay-php

ActiveLibrary[Payment Processing](/categories/payments)

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

Tpay.com library

2.4.8(9mo ago)25260.3k—7.7%25[1 PRs](https://github.com/tpay-com/tpay-php/pulls)7MITPHPPHP &gt;=5.6.0CI passing

Since Mar 7Pushed 9mo ago8 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (35)Used By (7)

Tpay
====

[](#tpay)

Library for all payment methods available in [Tpay](https://docs.tpay.com/).

[![Latest stable version](https://camo.githubusercontent.com/cde26cc8c914c1009966ec1c32fbb00c7274986f98b9db316a40a37049b3ac3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747061792d636f6d2f747061792d7068702e7376673f6c6162656c3d63757272656e7425323076657273696f6e)](https://packagist.org/packages/tpay-com/tpay-php)[![PHP version](https://camo.githubusercontent.com/391b5cfa7d8a7826adfcb745ed834b1a2a56ee6383b16e552972d898da0abaa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f747061792d636f6d2f747061792d7068702e737667)](https://php.net)[![License](https://camo.githubusercontent.com/5f325c5420ddbe56e1388ccfaa0f42cb7dc9194c089260f98328a497d0cee8a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747061792d636f6d2f747061792d7068702e737667)](LICENSE)[![CI status](https://github.com/tpay-com/tpay-php/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/tpay-com/tpay-php/actions)[![Type coverage](https://camo.githubusercontent.com/7b941f1c40d30fff0f8999911b7803133c662438ab436c2348021d4525bebb9a/68747470733a2f2f73686570686572642e6465762f6769746875622f747061792d636f6d2f747061792d7068702f636f7665726167652e737667)](https://shepherd.dev/github/tpay-com/tpay-php)

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

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

[](#installation)

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

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

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

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

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

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

Manual download:

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

[](#configuration)

The only thing you need to do is to set your API access data via `$this->` ([see examples](examples)). You can generate access keys in [Tpay's merchant panel](https://secure.tpay.com/panel).

The [`loader.php`](examples/BasicPaymentForm.php) file handles all required class loading, so you can include this file to any file you are editing. (remember to configure your current working path correctly).

All methods described in [Tpay documentation](https://docs.tpay.com) can be easily executed by extending required class in main [`src`](src) directory ([see examples](examples)).

##### Basic Payments and bank selection forms

[](#basic-payments-and-bank-selection-forms)

Example of usages: [basic](examples/BasicPaymentForm.php), [bank selection HTML form](examples/BankSelection.php), [bank selection API form](examples/BankSelectionAPI.php), [BLIK form](examples/BlikTransactionExample.php).

##### Transaction API / create, get, refund, report

[](#transaction-api--create-get-refund-report)

Example of usages: [create transaction](examples/TransactionApiExample.php), [refund transaction](examples/TransactionRefund.php), [refund transaction status](examples/TransactionRefundStatus.php).

##### Card Basic / Card On-Site

[](#card-basic--card-on-site)

Example of usages: [card basic form](examples/CardBasic.php), [card on-site gateway](examples/CardGate.php), [card payment links builder](examples/CardPaymentLinkBuilder.php), [card on-site gateway with saved cards](examples/CardGateExtended.php).

Logs
----

[](#logs)

Library has own logging system to save all confirmations and notifications sent by Tpay.com server, outgoing requests and exceptions. Be sure that file `src/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 under `Logs` directory.

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

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

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

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

You can also set you own Logger by this command it has to be compatible with `Psr\Log\LoggerInterface`:

```
Logger::setLogger(new CustomLogger());
```

The logs file names will be assigned automatically.

Custom templates path
---------------------

[](#custom-templates-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/';
```

Language
--------

[](#language)

Currently, the library supports two languages (English and Polish). Default language is English. Changing language example:

```
// All Tpay class constructors load Lang class
$tpay = new BankSelectionExample();

// After this line all static messages (input labels, buttons titles etc.) will be displayed in Polish
(new Util())->setLanguage('pl');

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

License
-------

[](#license)

This library is released under the [MIT License](http://www.opensource.org/licenses/MIT), but uses third party libraries that are distributed under their own terms ([see `LICENSE-3RD-PARTY.md`](LICENSE-3RD-PARTY.md)).

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance58

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 80.1% 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 ~96 days

Recently: every ~128 days

Total

33

Last Release

278d ago

Major Versions

1.0.5 → 2.0.02017-06-27

PHP version history (3 changes)1.0.0PHP &gt;=5.6.0

1.0.2PHP &gt;=5.4.0

1.0.5PHP &gt;=5.3.0

### 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

[![piotrjozwiak](https://avatars.githubusercontent.com/u/22236446?v=4)](https://github.com/piotrjozwiak "piotrjozwiak (173 commits)")[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (18 commits)")[![s4ddly](https://avatars.githubusercontent.com/u/110701663?v=4)](https://github.com/s4ddly "s4ddly (8 commits)")[![SzczepaniakG](https://avatars.githubusercontent.com/u/52274854?v=4)](https://github.com/SzczepaniakG "SzczepaniakG (4 commits)")[![krzGablo](https://avatars.githubusercontent.com/u/147171777?v=4)](https://github.com/krzGablo "krzGablo (3 commits)")[![BanczerowskiM](https://avatars.githubusercontent.com/u/90452844?v=4)](https://github.com/BanczerowskiM "BanczerowskiM (2 commits)")[![kwojc](https://avatars.githubusercontent.com/u/5415799?v=4)](https://github.com/kwojc "kwojc (2 commits)")[![thomas2411](https://avatars.githubusercontent.com/u/992685?v=4)](https://github.com/thomas2411 "thomas2411 (1 commits)")[![Karpol](https://avatars.githubusercontent.com/u/16548691?v=4)](https://github.com/Karpol "Karpol (1 commits)")[![pstasicki](https://avatars.githubusercontent.com/u/125288731?v=4)](https://github.com/pstasicki "pstasicki (1 commits)")[![erizodelbosque](https://avatars.githubusercontent.com/u/125289729?v=4)](https://github.com/erizodelbosque "erizodelbosque (1 commits)")[![Digital87](https://avatars.githubusercontent.com/u/3045250?v=4)](https://github.com/Digital87 "Digital87 (1 commits)")[![kdoroszewicz](https://avatars.githubusercontent.com/u/7294362?v=4)](https://github.com/kdoroszewicz "kdoroszewicz (1 commits)")

---

Tags

payment-gatewaypayment-integration

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)[paymentsuite/paymentsuite

PaymentSuite is an easy implementation for lot of Payment Methods for Symfony projects

2615.5k2](/packages/paymentsuite-paymentsuite)

PHPackages © 2026

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