Download the PHP package rodion15/laravel-payok-io without Composer
On this page you can find all versions of the php package rodion15/laravel-payok-io. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rodion15/laravel-payok-io
More information about rodion15/laravel-payok-io
Files in rodion15/laravel-payok-io
Package laravel-payok-io
Short Description payok.io payments for Laravel
License MIT
Informations about the package laravel-payok-io
Laravel payment processor package for PayokIo gateway
Accept payments via PayokIo (payok.io) using this Laravel framework package (Laravel).
- receive payments, adding just the two callbacks
Laravel >= 10.*, 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 PayokIo
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/payokio.php
.
- Create an account on payok.io
- Add your project, copy the
project_id
,secret_key
params and paste intoconfig/payokio.php
- After the configuration has been published, edit
config/payokio.php
- Set the callback static function for
searchOrder
andpaidOrder
- Create route to your controller, and call
PayokIo::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 PayokIo:
Important
You must define callbacks in config/payokio.php
to search the order and save the paid order.
Example
The process scheme:
- The request comes from
payok.io
GET
/POST
http://yourproject.com/payokio/result
(with params). - The function
PayokIoController@handlePayment
runs the validation process (auto-validation request params). - The method
searchOrder
will be called (seeconfig/payokio.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/payokio.php
paidOrder
).
Add the route to routes/web.php
:
Note: don't forget to save your full route url (e.g. http://example.com/payokio/result ) for your project on payok.io.
Create the following controller: /app/Http/Controllers/PayokIoController.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
- Rodion15
- All Contributors
License
The MIT License (MIT). Please see License File for more information.