Download the PHP package bigenergy/laravel-freekassa-ru without Composer
On this page you can find all versions of the php package bigenergy/laravel-freekassa-ru. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bigenergy/laravel-freekassa-ru
More information about bigenergy/laravel-freekassa-ru
Files in bigenergy/laravel-freekassa-ru
Package laravel-freekassa-ru
Short Description freekassa.ru payments for Laravel 9.0+
License MIT
Informations about the package laravel-freekassa-ru
Laravel payment processor package for FreeKassa gateway
Accept payments via FreeKassa.ru (freekassa.ru) using this Laravel framework package (Laravel).
- receive payments, adding just the two callbacks
Laravel >= 9.*, PHP >= 8.1
Installation
Require this package with composer.
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Add the FreeKassa
facade to your facades array:
Copy the package config to your local config with the publish command:
Configuration
Once you have published the configuration files, please edit the config file in config/freekassa.php
.
- Create an account on freekassa.ru
- Add your project, copy the
project_id
,secret_key
andsecret_key_second
params and paste intoconfig/freekassa.php
- After the configuration has been published, edit
config/freekassa.php
- Set the callback static function for
searchOrder
andpaidOrder
- Create route to your controller, and call
FreeKassa::handle
method
Usage
1) Generate a payment url or get redirect:
You can add custom fields to your payment:
$desc
and $payment_methood
can be null.
2) Process the request from FreeKassa:
Important
You must define callbacks in config/freekassa.php
to search the order and save the paid order.
Example
The process scheme:
- The request comes from
freekassa.ru
GET
/POST
http://yourproject.com/freekassa/result
(with params). - The function
FreeKassaController@handlePayment
runs the validation process (auto-validation request params). - The method
searchOrder
will be called (seeconfig/freekassa.php
searchOrder
) to search the order by the unique id. - If the current order status is NOT
paid
in your database, the methodpaidOrder
will be called (seeconfig/freekassa.php
paidOrder
).
Add the route to routes/web.php
:
Note: don't forget to save your full route url (e.g. http://example.com/freekassa/result ) for your project on freekassa.ru.
Create the following controller: /app/Http/Controllers/FreeKassaController.php
:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please send me an email at [email protected] instead of using the issue tracker.
Credits
- Weishaypt
- All Contributors
License
The MIT License (MIT). Please see License File for more information.