Download the PHP package maksa988/laravel-freekassa without Composer
On this page you can find all versions of the php package maksa988/laravel-freekassa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maksa988/laravel-freekassa
More information about maksa988/laravel-freekassa
Files in maksa988/laravel-freekassa
Package laravel-freekassa
Short Description FreeKassa payments for Laravel
License MIT
Informations about the package laravel-freekassa
Laravel payment processor package for FreeKassa gateway
Accept payments via FreeKassa (free-kassa.ru) using this Laravel framework package (Laravel).
- receive payments, adding just the two callbacks
Laravel >= 8.*, PHP >= 7.3
To use the package for Laravel 7.* use the 3.x branch
To use the package for Laravel 6.* use the 2.x branch
To use the package for Laravel 5.* use the 1.x branch
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 free-kassa.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:
$email
and $phone
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
free-kassa.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 free-kassa.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
- Maksa988
- All Contributors
License
The MIT License (MIT). Please see License File for more information.