PHPackages                             terentev-space/qiwi-php-client - 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. terentev-space/qiwi-php-client

ActiveLibrary[API Development](/categories/api)

terentev-space/qiwi-php-client
==============================

Universal payments API SDK (UNOFICIAL QIWI CLIENT)

0.1.1(3y ago)3199MITPHPPHP &gt;=7.1

Since Sep 14Pushed 3y ago1 watchersCompare

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

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

Qiwi Php Client
===============

[](#qiwi-php-client)

[![Latest Version](https://camo.githubusercontent.com/ae850ee14467977e6558999c34450ff28c8d5779b990dd75b0caa03c79708391/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f746572656e7465762d73706163652f716977692d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/terentev-space/qiwi-php-client/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/be1435db90ebafdca3f47af08ece9a7758574a47972acd0944391f6dc1fbd51d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746572656e7465762d73706163652f716977692d7068702d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/terentev-space/qiwi-php-client)

Especially for **[🦊 Zorra Telecom](https://zorra.com)** and **👥 Everyone else**

Привет
------

[](#привет)

Attention: At the moment the number of methods is very limited, they will be added later if QIWI does not make a normal alternative... Внимание: На данный момент количество методов сильно ограниченно, они будут добавлены позже, если QIWI не сделает нормальную альтернативу...

Минимальный набор API - ЕСТЬ
----------------------------

[](#минимальный-набор-api---есть)

#### ✅ [Создание счета](https://developer.qiwi.com/ru/payments/#invoice_put)

[](#-создание-счета)

Запрос создает платежный счет.

```
PUT /payin/v1/sites/{siteId}/bills/{billId}

```

#### ✅ [Статус счета](https://developer.qiwi.com/ru/payments/#invoice-details)

[](#-статус-счета)

Запрос предназначен для получения деталей платежного счета. В успешном ответе приходит список данных по счету и его платежам с запрошенным billId.

```
GET /payin/v1/sites/{siteId}/bills/{billId}/details

```

#### ❔ [Получение списка платежей по счету](https://developer.qiwi.com/ru/payments/#invoice-payments)

[](#-получение-списка-платежей-по-счету)

Получение списка платежей по счету

```
GET /payin/v1/sites/{siteId}/bills/{billId}

```

*МОЖНО ИСПОЛЬЗОВАТЬ: [Статус счета](https://developer.qiwi.com/ru/payments/#invoice-details)*

#### ❌ [Платеж](https://developer.qiwi.com/ru/payments/#payments)

[](#-платеж)

Запрос создает платежную транзакцию.

```
PUT /payin/v1/sites/{siteId}/payments/{paymentId}

```

*ПОКА НЕ ПРИГОДИЛСЯ*

#### ❔ [Статус платежа](https://developer.qiwi.com/ru/payments/#payment_get)

[](#-статус-платежа)

Получить информацию о платежной транзакции.

```
GET /payin/v1/sites/{siteId}/payments/{paymentId}

```

*ПОКА НЕ ПРИГОДИЛСЯ*

*МОЖНО ИСПОЛЬЗОВАТЬ: [Статус счета](https://developer.qiwi.com/ru/payments/#invoice-details)*

#### ❌ [Завершение аутентификации клиента](https://developer.qiwi.com/ru/payments/#payment_complete)

[](#-завершение-аутентификации-клиента)

После успешного прохождения дополнительной аутентификации, ТСП необходимо отправить запрос с параметрами соответствующими типу дополнительной аутентификации для завершения проверки.

```
POST /payin/v1/sites/{siteId}/payments/{paymentId}/complete

```

*ПОКА НЕ ПРИГОДИЛСЯ*

#### ❌ [Подтверждение платежа](https://developer.qiwi.com/ru/payments/#capture)

[](#-подтверждение-платежа)

Подтверждает платеж после холдирования средств. Если используется двухшаговый сценарий, то мерчанту необходимо отправить этот запрос после авторизации платежа.

```
PUT /payin/v1/sites/{siteId}/payments/{paymentId}/captures/{captureId}

```

*ПОКА НЕ ПРИГОДИЛСЯ*

#### ❌ [Статус подтверждения](https://developer.qiwi.com/ru/payments/#capture_get)

[](#-статус-подтверждения)

Запрашивает статус указанного подтверждения платежа.

```
GET /payin/v1/sites/{siteId}/payments/{paymentId}/captures/{captureId}

```

*ПОКА НЕ ПРИГОДИЛСЯ*

#### ❌ [Операция возврата](https://developer.qiwi.com/ru/payments/#refund-api)

[](#-операция-возврата)

Запрос предназначен для возврата средств по завершенному платежу. ТСП может выполнить несколько запросов для возврата частичных сумм.

```
PUT /payin/v1/sites/{siteId}/payments/{paymentId}/refunds/{refundId}

```

*ПОКА НЕ ПРИГОДИЛСЯ*

Install
-------

[](#install)

#### Composer

[](#composer)

```
composer require terentev-space/qiwi-php-client
```

Usage
-----

[](#usage)

1. Set up QIWI:
2. Connect the library
3. Prepare

```
// Factories
$configFactory = new \QiwiClient\Factories\ConfigFactory();
$clientFactory = new \QiwiClient\Factories\ClientFactory();

// Make Config
$config = $configFactory->make(
    'siteId',
    'token',
    'publicKey' // optional
);
/* OR */
$config = new \QiwiClient\Entities\ClientConfig(
    'siteId',
    'publicKey',
    'token'
);

// Make Client
$client = $clientFactory->make(
    'siteId',
    'token',
    'publicKey' // optional
);
/* OR */
$client = Qiwi::client(
    'siteId',
    'token'
);
/* OR */
$client = new \QiwiClient\Client(
    $config,
    new \GuzzleHttp\Client(),
    new \Psr\Log\NullLogger()
);
```

4. Use

```
$billId = '...';

$amount = 1.01;
/* OR */
$amount = 1.019; // = 1.01

$currency = Qiwi::CURRENCY_RUB;
/* OR */
$currency = 'RUB';

$expiration = null; // +1 day
/* OR */
$expiration = '2022-01-01T00:00:00+00:00';
/* OR */
$expiration = new DateTime();
/* OR */
$expiration = $datetime->format(\QiwiClient\Qiwi::DATETIME_FORMAT);

$flags = [
    \QiwiClient\Qiwi::FLAG_SALE, // optional
    \QiwiClient\Qiwi::FLAG_BIND_PAYMENT_TOKEN, // optional
];

$account = 'string(64) - id';
$email = 'string(64) or null - email';
$phone = 'string(15) or null - phone';

$country = 'string(1000) or null';
$city = 'string(1000) or null';
$region = 'string(1000) or null';
$details = 'string(1000) or null';

$pan = 'string(19) or null';
$wallet = 'string(64) or null';
$inn = 'string(12) or null';
$phone = 'string(15) or null';
$bankAccount = 'string(20) or null';
$bic = 'string(9) or null';

$cf1 = 'string(256) or null';
$cf2 = 'string(256) or null';
$cf3 = 'string(256) or null';
$cf4 = 'string(256) or null';
$cf5 = 'string(256) or null';
$merchantThemeCode = 'string(256) or null';
$merchantContractId = 'string(256) or null';
$merchantBookingNumber = 'string(256) or null';
$merchantPhone = 'string(256) or null';
$merchantFullName = 'string(256) or null';
$invoiceCallbackUrl = 'string(256) or null';

/** @var array $cheque Данные чека для операции. */
$cheque = [/* ... */];

$request = PaySiteBillQuery::make($billId, $amount, $currency)
    ->setExpirationDateTime($expiration) // optional
    ->setFlags(...$flags) // optional
    ->setCustomer(
        $account,
        $email, // optional
        $phone // optional
    ) // optional
    ->setAddress(
        $country, // optional
        $city, // optional
        $region, // optional
        $details // optional
    ) // optional
    ->setReceiverData(
        $pan, // optional
        $wallet, // optional
        $inn, // optional
        $phone, // optional
        $bankAccount, // optional
        $bic // optional
    ) // optional
    ->setCustomFields(
        $cf1, // optional
        $cf2, // optional
        $cf3, // optional
        $cf4, // optional
        $cf5, // optional
        $merchantThemeCode, // optional
        $merchantContractId, // optional
        $merchantBookingNumber, // optional
        $merchantPhone, // optional
        $merchantFullName, // optional
        $invoiceCallbackUrl // optional
    ) // optional
    ->setCheque($cheque)
;
/* OR */
$request = [
    'billId' => $billId,
    'amount' => [
        'value' => $amount,
        'currency' => $currency,
    ],
    'expirationDateTime' => $expiration,
    'flags' => $flags,
    'customer' => [
        'account' => $account,
        'email' => $email,
        'phone' => $phone,
    ],
    'address' => [
        'country' => $country,
        'city' => $city,
        'region' => $region,
        'details' => $details,
    ],
    'receiverData' => [
        'pan' => $pan,
        'wallet' => $wallet,
        'inn' => $inn,
        'phone' => $phone,
        'bankAccount' => $bankAccount,
        'bic' => $bic,
    ],
    'customFields' => [
        'cf1' => $cf1,
        'cf2' => $cf2,
        'cf3' => $cf3,
        'cf4' => $cf4,
        'cf5' => $cf5,
        'merchantThemeCode' => $merchantThemeCode,
        'merchantContractId' => $merchantContractId,
        'merchantBookingNumber' => $merchantBookingNumber,
        'merchantPhone' => $merchantPhone,
        'merchantFullName' => $merchantFullName,
        'invoiceCallbackUrl' => $invoiceCallbackUrl,
    ],
    'cheque' => $cheque,
];

$response = $client->paySiteBill($request);
$response->getCode(); // Response code 200
$response->getBody(); // Response data array
/** @var \QiwiClient\Entities\Results\PaySiteBillResult $data */
$data = $response->parseData();

// ...
$billId = $data->getBillId();
// 1.01
$amount = $data->getAmountValue();
// RUB
$currency = $data->getAmountCurrency();
// 2000-00-00T00:00:00+00:00
$exp = $data->getExpirationDateTime();
// 00000000-0000-0000-0000-000000000000
$invoice = $data->getInvoiceUid();
// CREATED
$status = $data->getStatusValue();
// 2000-00-00T00:00:00+00:00
$statusChanged = $data->getStatusChangedDateTime();
// https://oplata.qiwi.com/form?invoiceUid=00000000-0000-0000-0000-000000000000
$url = $data->getPayUrl();

$response = $client->getSiteBillDetails('1663126085');
$response->getCode(); // Response code 200
$response->getBody(); // Response data array
/** @var \QiwiClient\Entities\Results\GetSiteBillDetailsResult $data */
$data = $response->parseData();

// ...
$billId = $data->getBillId();
// 1.01
$amount = $data->getAmountValue();
// RUB
$currency = $data->getAmountCurrency();
// CREATED
$status = $data->getStatusValue();
// 2000-00-00T00:00:00+00:00
$statusChanged = $data->getStatusChangedDateTime();
/* ... */
// https://oplata.qiwi.com/form?invoiceUid=00000000-0000-0000-0000-000000000000
$url = $data->getPayUrl();

/** @var \QiwiClient\Entities\Items\SiteBillPayment $payment */
$payment = $data->getPayments()[0];

// siteId
$siteId = $payment->getSiteId();
// ...
$billId = $payment->getBillId();
// 1.01
$amount = $payment->getAmountValue();
// RUB
$currency = $payment->getAmountCurrency();
// CREATED
$status = $payment->getStatusValue();
/* ... */
// []
$status = $payment->getCustomFields();
```

Доработка библиотеки
--------------------

[](#доработка-библиотеки)

1. В библиотеке присутствует [Dockerfile](Dockerfile), сбилдить образ докера можно так: `docker build -t "qiwi-php-client" .`
2. Запускать докер-контейнер можно так: `docker run -it -v $(pwd):/qiwi-php-client qiwi-php-client bash`
3. При первом запуске надо подтянуть зависимости, в контейнере выполнить: `composer install`
4. Настроено тестовое окружение, для его работы неоходимо скопировать файл `phpunit.xml.dist` в `phpunit.xml`
5. Запуск тестов в контейнере: `./vendor/bin/phpunit`

Credits
-------

[](#credits)

- [Ivan Terentev](https://github.com/terentev-space)
- [All Contributors](https://github.com/terentev-space/qiwi-php-client/contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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

1333d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4afdc3f257a628f254362fec69d58dc8d6dfe8ecf2b326e845d992f02495a001?d=identicon)[terentev-space](/maintainers/terentev-space)

---

Top Contributors

[![terentev-space](https://avatars.githubusercontent.com/u/26274186?v=4)](https://github.com/terentev-space "terentev-space (4 commits)")

---

Tags

clientphpphp-libraryphp7qiwiqiwi-apizorraphpapiclientqiwi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/terentev-space-qiwi-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/terentev-space-qiwi-php-client/health.svg)](https://phpackages.com/packages/terentev-space-qiwi-php-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69333.0M114](/packages/algolia-algoliasearch-client-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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