PHPackages                             rodion15/laravel-payok-io - 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. rodion15/laravel-payok-io

ActiveLibrary[Payment Processing](/categories/payments)

rodion15/laravel-payok-io
=========================

payok.io payments for Laravel

v1.0.2(2y ago)07MITPHPPHP &gt;=8.1

Since Jan 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Rodion15/laravel-payok-io)[ Packagist](https://packagist.org/packages/rodion15/laravel-payok-io)[ RSS](/packages/rodion15-laravel-payok-io/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel payment processor package for PayokIo gateway
=====================================================

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

Accept payments via PayokIo ([payok.io](https://payok.io/)) using this Laravel framework package ([Laravel](https://laravel.com)).

- receive payments, adding just the two callbacks

#### Laravel &gt;= 10.\*, PHP &gt;= 8.1

[](#laravel--10-php--81)

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

[](#installation)

Require this package with composer.

```
composer require rodion15/laravel-payok-io
```

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

```
Rodion15\PayokIo\PayokIoServiceProvider::class,
```

Add the `PayokIo` facade to your facades array:

```
'PayokIo' => Rodion15\PayokIo\Facades\PayokIo::class,
```

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

```
php artisan vendor:publish --provider="Rodion15\PayokIo\PayokIoServiceProvider"
```

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

[](#configuration)

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

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

Usage
-----

[](#usage)

1. Generate a payment url or get redirect:

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

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

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

You can add custom fields to your payment:

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

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

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

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

2. Process the request from PayokIo:

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

Important
---------

[](#important)

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

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

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

Example
-------

[](#example)

The process scheme:

1. The request comes from `payok.io` `GET` / `POST` `http://yourproject.com/payokio/result` (with params).
2. The function`PayokIoController@handlePayment` runs the validation process (auto-validation request params).
3. The method `searchOrder` will be called (see `config/payokio.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/payokio.php` `paidOrder`).

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

```
 Route::get('/payokio/result', 'PayokIoController@handlePayment');
```

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

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

```
class PayokIoController 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 PayokIo::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)

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

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1def894a3b64bb315c17f4522987b4390aebf2608ab6fb0d76a240c432567dc?d=identicon)[Rodion15](/maintainers/Rodion15)

---

Top Contributors

[![Rodion15](https://avatars.githubusercontent.com/u/50318836?v=4)](https://github.com/Rodion15 "Rodion15 (13 commits)")

### Embed Badge

![Health badge](/badges/rodion15-laravel-payok-io/health.svg)

```
[![Health](https://phpackages.com/badges/rodion15-laravel-payok-io/health.svg)](https://phpackages.com/packages/rodion15-laravel-payok-io)
```

###  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)
