PHPackages                             dpayglobal/dpay-php-sdk - 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. dpayglobal/dpay-php-sdk

ActiveLibrary

dpayglobal/dpay-php-sdk
=======================

Official dpay.pl PHP SDK

0.1.1(yesterday)01↑2900%Apache-2.0PHP &gt;=7.4

Since Jul 21Compare

[ Source](https://github.com/dpayglobal/dpay-php-sdk)[ Packagist](https://packagist.org/packages/dpayglobal/dpay-php-sdk)[ Docs](https://dpay.pl)[ RSS](/packages/dpayglobal-dpay-php-sdk/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

dpay PHP SDK
============

[](#dpay-php-sdk)

Oficjalna biblioteka PHP do integracji z API płatności [dpay.pl](https://dpay.pl).

Wymagania
---------

[](#wymagania)

- PHP 7.4 lub nowszy (testowane do PHP 8.5)
- Rozszerzenia: `curl`, `json`, `openssl`

Instalacja
----------

[](#instalacja)

```
composer require dpayglobal/dpay-php-sdk
```

Szybki start
------------

[](#szybki-start)

```
use DPay\DPayClient;
use DPay\Money;
use DPay\Payment\RegisterPaymentRequest;
use DPay\Payment\ReturnUrls;
use DPay\Payment\TransactionType;

$dpay = new DPayClient([
    'service' => 'nazwa_serwisu',
    'secret_hash' => 'twoj_secret_hash',
]);

$payment = $dpay->payments->register(
    RegisterPaymentRequest::create(
        Money::pln(1050),
        TransactionType::TRANSFERS,
        new ReturnUrls(
            'https://twojsklep.pl/sukces',
            'https://twojsklep.pl/blad',
            'https://twojsklep.pl/ipn'
        )
    )
        ->withDescription('Zamówienie #1234')
        ->withCustom('order-1234')
);

if ($payment->getRedirectUrl() !== null) {
    header('Location: ' . $payment->getRedirectUrl());
    exit;
}
```

Obsługa IPN
-----------

[](#obsługa-ipn)

dpay.pl uznaje IPN za dostarczony wyłącznie, gdy body odpowiedzi to dokładnie `OK`. Kod HTTP nie jest sprawdzany. Zawsze weryfikuj kwotę z własnym zamówieniem.

```
use DPay\Exception\SignatureVerificationException;
use DPay\Ipn\IpnEvent;
use DPay\Ipn\IpnVerifier;

try {
    $event = IpnVerifier::constructEvent(
        (string) file_get_contents('php://input'),
        'twoj_secret_hash'
    );

    if ($event->isTransfer() || $event->isCapture()) {
        markOrderAsPaid($event->getId(), $event->getAmount());
    }

    http_response_code(200);
    echo IpnEvent::ACK;
} catch (SignatureVerificationException $exception) {
    http_response_code(400);
    echo 'Invalid signature';
}
```

Zwroty
------

[](#zwroty)

```
use DPay\Money;

$dpay->refunds->create('identyfikator-transakcji');
$dpay->refunds->create('identyfikator-transakcji', Money::pln(500), 'reklamacja');

$availability = $dpay->refunds->checkAvailability('identyfikator-transakcji');
if ($availability->isAvailable()) {
    // ...
}
```

Szczegóły transakcji i banki
----------------------------

[](#szczegóły-transakcji-i-banki)

```
$transaction = $dpay->payments->details('identyfikator-transakcji');
$transaction->isPaid();
$transaction->getAvailableRefundAmount()->toDecimal();
$transaction->getRefunds();

$banks = $dpay->banks->forService();
```

Obsługa błędów
--------------

[](#obsługa-błędów)

Wszystkie wyjątki SDK implementują `DPay\Exception\ExceptionInterface`.

```
use DPay\Exception\ApiErrorException;
use DPay\Exception\InvalidRequestException;
use DPay\Exception\TransportException;

try {
    $payment = $dpay->payments->register($request);
} catch (InvalidRequestException $exception) {
    $exception->getFieldErrors();
} catch (ApiErrorException $exception) {
    $exception->getHttpStatus();
    $exception->getErrorCode();
} catch (TransportException $exception) {
    // błąd sieci - status płatności nieznany, użyj payments->details()
}
```

Konfiguracja
------------

[](#konfiguracja)

OpcjaTypOpis`service`stringNazwa Punktu Płatności z panel.dpay.pl (wymagane)`secret_hash`stringKlucz Secret Hash (wymagane)`timeout`intTimeout HTTP w sekundach (domyślnie 30)`http_client`HttpClientInterfaceWłasny klient HTTP (testy, proxy)`base_urls`arrayNadpisanie hostów APILicencja
--------

[](#licencja)

Apache-2.0

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

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

Total

2

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11840133?v=4)[dpay](/maintainers/dpay)[@dpay](https://github.com/dpay)

---

Tags

sdkpaymentsblikcardsdPay

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dpayglobal-dpay-php-sdk/health.svg)

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

###  Alternatives

[transbank/transbank-sdk

Transbank SDK

62676.5k14](/packages/transbank-transbank-sdk)[tatter/stripe

Stripe SDK integration for CodeIgniter 4

115.3k](/packages/tatter-stripe)

PHPackages © 2026

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