PHPackages                             oda79/robokassa-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. oda79/robokassa-php

ActiveLibrary[Payment Processing](/categories/payments)

oda79/robokassa-php
===================

Lightweight PHP library for Robokassa payment integration

v1.0.0(1mo ago)00MITPHPPHP &gt;=7.4CI passing

Since Mar 17Pushed 1mo agoCompare

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

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

robokassa-php
=============

[](#robokassa-php)

[![PHP](https://camo.githubusercontent.com/7404ac2849f95f99ace60c4b949c4e57e3188dfc0d5df7a913378138ac571fb6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d626c7565)](https://camo.githubusercontent.com/7404ac2849f95f99ace60c4b949c4e57e3188dfc0d5df7a913378138ac571fb6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e342d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)[![Packagist Version](https://camo.githubusercontent.com/ebd7659f9d9da40947cc2f259f0c654377c1a4119cd79035a89c25c6561ea13f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f646137392f726f626f6b617373612d706870)](https://camo.githubusercontent.com/ebd7659f9d9da40947cc2f259f0c654377c1a4119cd79035a89c25c6561ea13f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f646137392f726f626f6b617373612d706870)[![Packagist Downloads](https://camo.githubusercontent.com/99a4c0dfb54df5b815d5215b24b1dfbcb684fd24955adce5384bfb84f7df7f10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f646137392f726f626f6b617373612d706870)](https://camo.githubusercontent.com/99a4c0dfb54df5b815d5215b24b1dfbcb684fd24955adce5384bfb84f7df7f10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f646137392f726f626f6b617373612d706870)[![Tests](https://github.com/oda79/robokassa-php/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/oda79/robokassa-php/actions/workflows/tests.yaml/badge.svg?branch=main)

Lightweight PHP library for Robokassa payment integration (framework-agnostic).

This package provides a small, framework-agnostic integration layer for:

- building Robokassa payment fields
- creating fiscal receipt items
- calculating payment signatures
- verifying ResultURL and SuccessURL signatures
- parsing callback payloads
- rendering an auto-submit HTML payment form

It does **not** include any business logic, database layer, or framework-specific routing.

Features
--------

[](#features)

- Plain PHP integration
- Supports payment receipt (`Receipt`)
- Supports test mode credentials
- Supports `SuccessUrl2`, `FailUrl2`, `ResultUrl2`
- Supports `shp_*` custom parameters
- Verifies callback signatures
- Optional file logging

Design principles
-----------------

[](#design-principles)

- No framework dependencies
- No business logic inside the library
- Explicit configuration
- Minimal surface area

Requirements
------------

[](#requirements)

- PHP 7.4+

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

[](#installation)

### Composer

[](#composer)

```
composer require oda79/robokassa-php
```

### Manual

[](#manual)

Copy `src/Robokassa` folder to your project and include it manually.

Basic Usage
-----------

[](#basic-usage)

```
require_once __DIR__ . '/src/Robokassa.php';

$config = require __DIR__ . '/examples/config.example.php';

$robokassa = new \SwimLeague\Robokassa\Robokassa($config);

$fields = $robokassa->buildPaymentData([
    'invoice_id' => '100001',
    'amount' => '790',
    'email' => 'customer@example.com',
    'description' => 'Online commission payment',
    'receipt_items' => [
        $robokassa->makeReceiptItem('Online commission', '790'),
    ],
    'shp' => [
        'shp_id' => '1',
    ],
]);

echo $robokassa->renderRedirectForm($fields);
```

Callback verification
---------------------

[](#callback-verification)

```
$request = $_POST;
$parsed = $robokassa->parseCallbackRequest($request);

if (!$robokassa->verifyResultSignature($request)) {
    http_response_code(400);
    echo 'bad sign';
    exit;
}

echo 'OK' . $parsed['InvId'];
```

Tests
-----

[](#tests)

```
composer install
composer test
```

Notes
-----

[](#notes)

- Payment status should be updated only from ResultURL callback, not from success/fail return pages.
- Fiscal receipt generation is asynchronous and is not returned in the standard payment callback.
- Application-specific input forms should be handled outside of the library.

Examples
--------

[](#examples)

See `examples/` folder for:

- Basic payment form generation `examples/basic-payment.php`
- Callback handler example `examples/callback-handler.php`
- Form POST adapter example `examples/form-post-adapter.php`
- Return URL handlers `examples/return-ok.php` and `examples/return-fail.php`

WordPress integration
---------------------

[](#wordpress-integration)

See `docs/WORDPRESS_INTEGRATION.md`.

License
-------

[](#license)

MIT License. See `LICENSE` file for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

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

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/215eeb121ab95f39171233ffc8700afa0ebe7356fe2f5f4b93fe722b1dbcedf8?d=identicon)[oda79](/maintainers/oda79)

---

Top Contributors

[![oda79](https://avatars.githubusercontent.com/u/28699239?v=4)](https://github.com/oda79 "oda79 (3 commits)")

---

Tags

payment-gatewaypayment-integrationphprobokassarobokassa-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oda79-robokassa-php/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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