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

ActiveLibrary[Payment Processing](/categories/payments)

maksa988/laravel-freekassa
==========================

FreeKassa payments for Laravel

v4.0.0(5y ago)152.7k↓50%9[3 issues](https://github.com/maksa988/laravel-freekassa/issues)MITPHPPHP &gt;=7.3CI failing

Since Jan 15Pushed 5y ago3 watchersCompare

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

READMEChangelog (9)Dependencies (4)Versions (16)Used By (0)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/09d2ed793e3f13c8f59760e68d2759a1dd3e31891151276bef2aded1ce316d9a/68747470733a2f2f706f7365722e707567782e6f72672f6d616b73613938382f6c61726176656c2d667265656b617373612f762f737461626c65)](https://packagist.org/packages/maksa988/laravel-freekassa)[![Build Status](https://camo.githubusercontent.com/b96a3d7cfd62aa83c57a817f5a1d83931de116120273b334225ad05ffdfeaef9/68747470733a2f2f7472617669732d63692e6f72672f6d616b73613938382f6c61726176656c2d667265656b617373612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/maksa988/laravel-freekassa)[![StyleCI](https://camo.githubusercontent.com/c4d77e9a4efd83826fbb6f6ba784b5624450eea42ed3dc1a83a6bd5e49016e24/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136353735313635302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/165751650)[![CodeFactor](https://camo.githubusercontent.com/fca6b4fc888a032b741bd08e6236c886c9e37b09906a5429747d1e186946756c/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6d616b73613938382f6c61726176656c2d667265656b617373612f6261646765)](https://www.codefactor.io/repository/github/maksa988/laravel-freekassa)[![Total Downloads](https://camo.githubusercontent.com/38a38e71f9a39b939b53757a0efc303836fb855ebfefd7b4c36f6808953c97d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616b73613938382f6c61726176656c2d667265656b617373612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maksa988/laravel-freekassa)[![License](https://camo.githubusercontent.com/138030356f3743f0bbb06545eed2ac7018c7c7a619b3fe1ab81279856fc0c152/68747470733a2f2f706f7365722e707567782e6f72672f6d616b73613938382f6c61726176656c2d667265656b617373612f6c6963656e7365)](https://packagist.org/packages/maksa988/laravel-freekassa)

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

- receive payments, adding just the two callbacks

#### Laravel &gt;= 8.\*, PHP &gt;= 7.3

[](#laravel--8-php--73)

> To use the package for Laravel 7.\* use the [3.x](https://github.com/maksa988/laravel-freekassa/tree/3.x) branch

> To use the package for Laravel 6.\* use the [2.x](https://github.com/maksa988/laravel-freekassa/tree/2.x) branch

> To use the package for Laravel 5.\* use the [1.x](https://github.com/maksa988/laravel-freekassa/tree/1.x) branch

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

[](#installation)

Require this package with composer.

```
composer require maksa988/laravel-freekassa
```

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

```
Maksa988\FreeKassa\FreeKassaServiceProvider::class,
```

Add the `FreeKassa` facade to your facades array:

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

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

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

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

[](#configuration)

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

- Create an account on [free-kassa.ru](http://free-kassa.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, $email, $phone, $rows);

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

`$email` and `$phone` 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 `free-kassa.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 [free-kassa.ru](free-kassa.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)

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

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

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

Total

12

Last Release

2059d ago

Major Versions

1.x-dev → 2.x-dev2020-01-28

v2.0.0 → v3.0.02020-05-13

v3.0.0 → v4.0.02020-09-22

PHP version history (5 changes)v1.0.0PHP &gt;=5.6.4

v1.0.4PHP &gt;=7.1

2.x-devPHP &gt;=7.2

v3.0.0PHP &gt;=7.2.5

v4.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/20fbc1e64ffeb6456030e392c1f59eb47a5e9dbb4406aa117ce2a343a4c9f1ba?d=identicon)[maksa988](/maintainers/maksa988)

---

Top Contributors

[![maksa988](https://avatars.githubusercontent.com/u/5982466?v=4)](https://github.com/maksa988 "maksa988 (48 commits)")

---

Tags

accept-paymentsfeekassafreekassalaravellaravel-5-packagelaravel-6-packagelaravel-freekassalaravel-paymentspayment

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[lemonsqueezy/laravel

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

58596.1k](/packages/lemonsqueezy-laravel)[evryn/laravel-toman

A simple stable Laravel package to handle popular payment gateways in Iran including ZarinPal and IDPay.

1079.9k](/packages/evryn-laravel-toman)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)[digikraaft/laravel-paystack-webhooks

Handle Paystack webhooks in a Laravel application

177.5k1](/packages/digikraaft-laravel-paystack-webhooks)[wandesnet/mercadopago-laravel

PHP SDK for integration with Mercado Pago

252.4k](/packages/wandesnet-mercadopago-laravel)

PHPackages © 2026

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