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

ActiveLibrary

fride/php-sdk
=============

Fride PHP SDK (HTTP client without external deps, composer or plain require)

1.0.4(4mo ago)021MITPHPPHP &gt;=7.4

Since Oct 4Pushed 4mo agoCompare

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

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Fride PHP SDK
=============

[](#fride-php-sdk)

Простой PHP SDK для интеграции с сервисом Fride без внешних зависимостей (кроме cURL и стандартного JSON), поддерживает использование через Composer и через обычный require.

Установка через Composer
------------------------

[](#установка-через-composer)

```
composer require fride/php-sdk
```

Подключение через require без Composer
--------------------------------------

[](#подключение-через-require-без-composer)

```
require __DIR__ . '/php-sdk/src/autoload.php';
```

Быстрый старт с общим клиентом
------------------------------

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

```
use Fride\Bootstrap;
use Fride\Schemas\InvoiceCreateRequest;
use Fride\Schemas\InvoiceGetInfoRequest;
use Fride\Schemas\PayoffCreateRequest;
use Fride\Schemas\PayoffGetInfoRequest;
use Fride\Schemas\MerchantGetServicesRequest;

// {YOUR_API_KEY}, {BASE_URL}, {timeoutSeconds, default: 30}, {connectTimeoutSeconds, default: 10}
$fride = new Bootstrap('YOUR_API_KEY', 'https://api.fride.io');

// Создание заказа
$createInvReq = InvoiceCreateRequest::fromArray([
  'merchant_id' => '48ceb004-06b1-4ed6-9b61-aa8ad0dc5ae0',
  'order_id' => 'my_order_id_1',
  'amount' => 10.28,
  'currency' => 'USD',
  'comment' => 'Order #1',
]);
$invoice = $fride->invoices()->create($createInvReq);

// Получение информации о заказе
$getInfoInvReq = InvoiceGetInfoRequest::fromArray([
  'merchant_id' => '48ceb004-06b1-4ed6-9b61-aa8ad0dc5ae0',
  'order_id' => 'my_order_id_1',
]);
$infoInv = $fride->invoices()->getInfo($getInfoInvReq);

// Получение баланса
$balance = $fride->accounts()->getBalance();

// Получение доступных методов оплаты
$merchantServices = $fride->services()->getMerchantServices(MerchantGetServicesRequest::fromArray([
  'merchant_id' => '48ceb004-06b1-4ed6-9b61-aa8ad0dc5ae0',
]));

// Создание выплаты
$createPayoffReq = PayoffCreateRequest::fromArray([
  'service' => 'tron',
  'wallet_to' => 'Txxxx',
  'amount' => 1000.50,
  'subtract' => 2,
  'order_id' => 'Payoff-1',
]);
$payoff = $fride->payoffs()->create($createPayoffReq);

// Получение информации о выплате
$infoPayoff = $fride->payoffs()->getInfo(PayoffGetInfoRequest::fromArray([
  'payoff_id' => '24f48f28-4b02-42c7-ad0e-ab14ec7a7d05'
]));

// Получение курса валют
$rates = $fride->payoffs()->getRates();

// Получение списка доступных банков для выплаты через СБП
$sbpBanks = $fride->payoffs()->getSbpBanks();

// Получение доступных методов выплат
$payoffServices = $fride->services()->getPayoffServices();
```

Использование без общего клиента
--------------------------------

[](#использование-без-общего-клиента)

```
use Fride\Client;
use Fride\Api\Payoffs;
use Fride\Schemas\PayoffGetInfoRequest;

$payoffsClient = new Fride\Api\Payoffs(
	new Client('YOUR_API_KEY', 'https://api.fride.io')
);

// Получение информации о выплате
$payoffInfo = $payoffsClient->getInfo(PayoffGetInfoRequest::fromArray([
  'payoff_id' => '24f48f28-4b02-42c7-ad0e-ab14ec7a7d05'
]));
```

Обработка ошибок
----------------

[](#обработка-ошибок)

- Если HTTP статус не 200 — кидается `Fride\Exceptions\FrideApiException`.
    - Если в теле ответа есть поле `error` (string) — его текст попадёт в исключение.
    - Иначе будет сообщение: «Неизвестная ошибка».
- Сетевые и транспортные ошибки — `Fride\Exceptions\FrideHttpException`.

### Доступ к контексту ошибки

[](#доступ-к-контексту-ошибки)

```
use Fride\Exceptions\FrideApiException;
use Fride\Exceptions\FrideHttpException;

try {
  $balance = $fride->accounts()->getBalance();
} catch (FrideApiException $e) {
  $e->getStatusCode();     // HTTP статус
  $e->getUrl();            // URL запроса
  $e->getMethod();         // Метод (GET/POST)
  $e->getResponseBody();   // Сырое тело ответа
  $e->getResponseData();   // Декодированный JSON (если есть)
  $e->getHeaders();        // Ответные заголовки (map lowercase)
  $e->getRequestBody();    // Тело отправленного запроса (если было)
} catch (FrideHttpException $e) {
  $e->getCurlCode();       // Код ошибки cURL
  $e->getUrl();
  $e->getMethod();
}
```

Webhook подпись
---------------

[](#webhook-подпись)

```
use Fride\Webhook\Signature;

$isValid = Signature::check($rawJsonBody, $headerSignature, $secretKey);
```

Требования
----------

[](#требования)

- PHP &gt;= 7.4
- Расширение cURL

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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

Every ~21 days

Total

5

Last Release

141d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74f9f2099473513d63c8bb611ea8bf07356490facc91d32e9f30789cfa87cf78?d=identicon)[FrideIO](/maintainers/FrideIO)

---

Top Contributors

[![FrideIO](https://avatars.githubusercontent.com/u/235985986?v=4)](https://github.com/FrideIO "FrideIO (6 commits)")

### Embed Badge

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

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

PHPackages © 2026

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