PHPackages                             krzysiekpiasecki/dotphpay - 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. krzysiekpiasecki/dotphpay

AbandonedArchivedLibrary[Payment Processing](/categories/payments)

krzysiekpiasecki/dotphpay
=========================

Dotpay is the most comprehensive online worldwilde payments solution dedicated for polish ecommerce. This repository comes with middlewares for payments implementation and validation layer.

v0.19(8y ago)0111MITPHP

Since Mar 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/krzysiekpiasecki/dotphpay)[ Packagist](https://packagist.org/packages/krzysiekpiasecki/dotphpay)[ RSS](/packages/krzysiekpiasecki-dotphpay/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (17)Versions (21)Used By (0)

Dotphpay
========

[](#dotphpay)

Dotpay is the most comprehensive online worldwilde payments solution dedicated for polish ecommerce. This repository comes with middlewares for payments implementation and validation layer.

[![Dotpay](https://raw.githubusercontent.com/krzysiekpiasecki/Dotpayds/master/dotpay_logo.png)](https://raw.githubusercontent.com/krzysiekpiasecki/Dotpayds/master/dotpay_logo.png)

Documentation
=============

[](#documentation)

Are you interested in more details? [Here's the complete documentation of API](https://krzysiekpiasecki.github.io/dotphpay/).

Using this library
==================

[](#using-this-library)

### Install

[](#install)

The source code is distributed via [Composer](https://getcomposer.org) and [Packagist](https://packagist.org/packages/krzysiekpiasecki/dotphpay).

```
composer require krzysiekpiasecki/dotphpay
```

Payment Middleware
------------------

[](#payment-middleware)

Custom domain payment handler must implement only the interface \\Dotpay\\Server\\Handler\\PaymentHandlerInterface. You have to use it at least for persisting client payments, before redirecting the client to the payment gateway.

```
class BusinessPaymentHandler implements \Dotpay\Server\Handler\PaymentHandlerInterface
{
    public function handle(Payment $payment)
    {
        // TODO: Implement handle() method.
    }
}
```

After implementing the handler, create [PSR-15](https://www.php-fig.org/psr/psr-15/) compatible request object, for example using [Zend Diactoros](https://github.com/zendframework/zend-diactoros) component.

```
$psrRequest = Zend\Diactoros\ServerRequestFactory::fromGlobals(
    $_GET,
    $_POST
);
```

At the end, call the payment middleware to execute your own payment handler and then to send a redirect response to the client using for example [Zend Diactoros](https://github.com/zendframework/zend-diactoros) component.

```
$paymentMiddleware = new \Dotpay\Server\Payment();

$httpResponse = $paymentMiddleware->process(
    $psrRequest,
    new \Dotpay\Server\Handler\PaymentHandler(
        '747789',
        'Np3n4QmXxp6MOTrLCVs905fdrGf3QIGm',
        new BusinessPaymentHandler()
    )
);

$emitter = new \Zend\Diactoros\Response\SapiEmitter();
$emitter->emit($httpResponse);
```

URLC Middleware
---------------

[](#urlc-middleware)

Custom domain URLC handler must implement only the interface \\Dotpay\\Server\\Handler\\URLCHandlerInterface. You have to use it to confirm transaction complete or handle status changing.

```
class BusinessURLCHandler implements \Dotpay\Server\Handler\URLCHandlerInterface
{
    public function handle(\Dotpay\Response\URLC $URLC)
    {
        // TODO: Implement handle() method.
    }
}
```

After implementing the handler, create [PSR-15](https://www.php-fig.org/psr/psr-15/) compatible request object, for example with [Zend Diactoros](https://github.com/zendframework/zend-diactoros) component.

```
$psrRequest = \Zend\Diactoros\ServerRequestFactory::fromGlobals(
    $_POST
);
```

At the end, call the URLC middleware to execute your own URLC handler and then send a response "OK" to Dotpay, when the transaction was handled correctly, using for example [Zend Diactoros](https://github.com/zendframework/zend-diactoros)component.

```
$urlcMiddleware = new \Dotpay\Server\Payment();

$httpResponse = $urlcMiddleware->process(
    $psrRequest,
    new \Dotpay\Server\Handler\URLCHandler(
        'Np3n4QmXxp6MOTrLCVs905fdrGf3QIGm',
        new BusinessURLCHandler()
    )
);

$emitter = new \Zend\Diactoros\Response\SapiEmitter();
$emitter->emit($httpResponse);
```

Error Code Middleware
---------------------

[](#error-code-middleware)

Custom domain handler for getting error codes from Dotpay server must implement only the interface \\Dotpay\\Server\\Handler\\ErrorCodeHandlerInterface.

```
class BusinessErrorCodeHandler implements \Dotpay\Server\Handler\ErrorCodeHandlerInterface  {
    public function handle(string $errorCode)
    {
        // TODO: Implement handle() method with custom logic
    }
}
```

After implementing the handler, create [PSR-15](https://www.php-fig.org/psr/psr-15/) compatible request object, for example with [Zend Diactoros](https://github.com/zendframework/zend-diactoros) component.

```
$psrRequest = Zend\Diactoros\ServerRequestFactory::fromGlobals(
    $_GET
);
```

At the end, call the error code middleware to execute your own error code handler.

```
$errorCodeMiddleware = new \Dotpay\Server\ErrorCode();

$httpResponse = $errorCodeMiddleware->process(
     $psrRequest,
     new \Dotpay\Server\Handler\ErrorCodeHandler(
         new BusinessErrorCodeHandler()
     )
);
```

Validation layer
----------------

[](#validation-layer)

This library uses Symfony Validator component to validate the request. If you want, you can use validation layer provided by this library standalone. Example of validation is here:

```
use Symfony\Component\Validator\Validation;

$validator = Validation::createValidator();
$violations = $validator->validate('-1',
    new \Dotpay\Request\Validator\Constraint\IdConstraint()
);

if (0 !== count($violations)) {
    // there are errors, now you can show them
    foreach ($violations as $violation) {
        echo $violation->getMessage().'';
        // Output: The value "-1" is not a valid 'id' parameter
    }
}
```

Additional resources
--------------------

[](#additional-resources)

[Dotpay Technical Manual For Payments Implementation](https://ssl.dotpay.pl/s2/login/cloudfs1/magellan_media/common_file/dotpay_technical_manual_for_payments_implementation.pdf)
[Using Symfony Validation component](https://symfony.com/doc/current/components/validator.html)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 87.8% 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 ~13 days

Recently: every ~56 days

Total

20

Last Release

2731d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/16c9504da9e751d3555b16b9a1d81685cff9ca38f7bdbaacbcbce730a4dafc9c?d=identicon)[krzysztek](/maintainers/krzysztek)

---

Top Contributors

[![krzysiekpiasecki](https://avatars.githubusercontent.com/u/4520629?v=4)](https://github.com/krzysiekpiasecki "krzysiekpiasecki (108 commits)")[![bystrzano4](https://avatars.githubusercontent.com/u/11520033?v=4)](https://github.com/bystrzano4 "bystrzano4 (15 commits)")

---

Tags

dotpaydotpay-paymentsdotpay-serverecommercemiddlewareonline-paymentspaymentpayment-handlerphpurlc-handlerurlc-middleware

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/krzysiekpiasecki-dotphpay/health.svg)

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

###  Alternatives

[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[payum/payum-bundle

One million downloads of Payum already! Payum offers everything you need to work with payments. Check more visiting site.

59510.3M40](/packages/payum-payum-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[thelia/thelia

Thelia is an ecommerce CMS.

8715.1k](/packages/thelia-thelia)

PHPackages © 2026

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