PHPackages                             weishaypt/laravel-freekassa-ru - 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. weishaypt/laravel-freekassa-ru

ActiveLibrary[Payment Processing](/categories/payments)

weishaypt/laravel-freekassa-ru
==============================

freekassa.ru payments for Laravel

v4.0.0(1y ago)51.5k3[1 issues](https://github.com/MagicByteTeam/laravel-freekassa-ru/issues)MITPHPPHP &gt;=8.2

Since Sep 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MagicByteTeam/laravel-freekassa-ru)[ Packagist](https://packagist.org/packages/weishaypt/laravel-freekassa-ru)[ RSS](/packages/weishaypt-laravel-freekassa-ru/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (16)Used By (0)

Laravel payment processor package for FreeKassa gateway
=======================================================

[](#laravel-payment-processor-package-for-freekassa-gateway)

Accept payments via FreeKassa.ru ([freekassa.ru](https://freekassa.ru/)) using this Laravel framework package ([Laravel](https://laravel.com)).

- receive payments, adding just the two callbacks

#### Laravel &gt;= 11.\*, PHP &gt;= 8.2

[](#laravel--11-php--82)

> To use the package for Laravel 10.\* use the [2.x](https://github.com/MagicByteTeam/laravel-freekassa-ru/tree/3.x) branch
>
> To use the package for Laravel 9.\* use the [2.x](https://github.com/MagicByteTeam/laravel-freekassa-ru/tree/2.x) branch
>
> To use the package for Laravel 6.\* use the [1.x](https://github.com/MagicByteTeam/laravel-freekassa-ru/tree/1.x) branch

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

[](#installation)

Require this package with composer.

```
composer require weishaypt/laravel-freekassa-ru
```

If you don't use auto-discovery, add the ServiceProvider to the providers array in `config/app.php`

```
Weishaypt\FreeKassa\FreeKassaServiceProvider::class,
```

Add the `FreeKassa` facade to your facades array:

```
'FreeKassa' => Weishaypt\FreeKassa\Facades\FreeKassa::class,
```

Copy the package config to your local config with the publish command:

```
php artisan vendor:publish --provider="Weishaypt\FreeKassa\FreeKassaServiceProvider"
```

Configuration
-------------

[](#configuration)

Once you have published the configuration files, please edit the config file in `config/freekassa.php`.

- Create an account on [freekassa.ru](freekassa.ru)
- Add your project, copy the `project_id`, `secret_key` and `secret_key_second` params and paste into `config/freekassa.php`
- After the configuration has been published, edit `config/freekassa.php`
- Set the callback static function for `searchOrder` and `paidOrder`
- Create route to your controller, and call `FreeKassa::handle` method

Usage
-----

[](#usage)

1. Generate a payment url or get redirect:

```
$amount = 100; // Payment`s amount

$url = FreeKassa::getPayUrl($amount, $order_id);

$redirect = FreeKassa::redirectToPayUrl($amount, $order_id);
```

You can add custom fields to your payment:

```
$rows = [
    'time' => Carbon::now(),
    'info' => 'Local payment'
];

$url = FreeKassa::getPayUrl($amount, $order_id, $desc, $payment_methood, $rows);

$redirect = FreeKassa::redirectToPayUrl($amount, $order_id, $desc, $payment_methood, $rows);
```

`$desc` and `$payment_methood` can be null.

2. Process the request from FreeKassa:

```
FreeKassa::handle(Request $request)
```

Important
---------

[](#important)

You must define callbacks in `config/freekassa.php` to search the order and save the paid order.

```
'searchOrder' => null  // FreeKassaController@searchOrder(Request $request)
```

```
'paidOrder' => null  // FreeKassaController@paidOrder(Request $request, $order)
```

Example
-------

[](#example)

The process scheme:

1. The request comes from `freekassa.ru` `GET` / `POST` `http://yourproject.com/freekassa/result` (with params).
2. The function`FreeKassaController@handlePayment` runs the validation process (auto-validation request params).
3. The method `searchOrder` will be called (see `config/freekassa.php` `searchOrder`) to search the order by the unique id.
4. If the current order status is NOT `paid` in your database, the method `paidOrder` will be called (see `config/freekassa.php` `paidOrder`).

Add the route to `routes/web.php`:

```
 Route::get('/freekassa/result', 'FreeKassaController@handlePayment');
```

> **Note:**don't forget to save your full route url (e.g.  ) for your project on [freekassa.ru](freekassa.ru).

Create the following controller: `/app/Http/Controllers/FreeKassaController.php`:

```
class FreeKassaController extends Controller
{
    /**
     * Search the order in your database and return that order
     * to paidOrder, if status of your order is 'paid'
     *
     * @param Request $request
     * @param $order_id
     * @return bool|mixed
     */
    public function searchOrder(Request $request, $order_id)
    {
        $order = Order::where('id', $order_id)->first();

        if($order) {
            $order['_orderSum'] = $order->sum;

            // If your field can be `paid` you can set them like string
            $order['_orderStatus'] = $order['status'];

            // Else your field doesn` has value like 'paid', you can change this value
            $order['_orderStatus'] = ('1' == $order['status']) ? 'paid' : false;

            return $order;
        }

        return false;
    }

    /**
     * When paymnet is check, you can paid your order
     *
     * @param Request $request
     * @param $order
     * @return bool
     */
    public function paidOrder(Request $request, $order)
    {
        $order->status = 'paid';
        $order->save();

        //

        return true;
    }

    /**
     * Start handle process from route
     *
     * @param Request $request
     * @return mixed
     */
    public function handlePayment(Request $request)
    {
        return FreeKassa::handle($request);
    }
}
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please send me an email at  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Weishaypt](https://github.com/Weishaypt)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

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

Recently: every ~156 days

Total

15

Last Release

463d ago

Major Versions

v1.0.6 → 2.x-dev2022-11-25

v2.0.0 → v3.0.02023-05-22

v3.2.0 → v4.0.02025-02-03

PHP version history (3 changes)1.0.0PHP &gt;=7.2

2.x-devPHP &gt;=8.1

v4.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/73f9030664ecfdbf2ed12919dadac7aca59e2dc3769ee111ab1153d2bc7286fd?d=identicon)[Weishaypt](/maintainers/Weishaypt)

---

Top Contributors

[![Weishaypt](https://avatars.githubusercontent.com/u/40069228?v=4)](https://github.com/Weishaypt "Weishaypt (16 commits)")

### Embed Badge

![Health badge](/badges/weishaypt-laravel-freekassa-ru/health.svg)

```
[![Health](https://phpackages.com/badges/weishaypt-laravel-freekassa-ru/health.svg)](https://phpackages.com/packages/weishaypt-laravel-freekassa-ru)
```

###  Alternatives

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[ssheduardo/redsys-laravel

Package redsys for laravel

100129.5k1](/packages/ssheduardo-redsys-laravel)[duncanmcclean/simple-commerce

A simple, yet powerful e-commerce addon for Statamic.

16313.2k2](/packages/duncanmcclean-simple-commerce)[tsaiyihua/laravel-ecpay

ecpay library for laravel

6416.3k](/packages/tsaiyihua-laravel-ecpay)[alifaraun/laravel-moamalat-pay

Easy - Moamalat Lightbox integration for Laravel.

1914.0k](/packages/alifaraun-laravel-moamalat-pay)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

322.8k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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