PHPackages                             anvarulugov/click-integration-laravel - 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. anvarulugov/click-integration-laravel

ActiveLibrary[Payment Processing](/categories/payments)

anvarulugov/click-integration-laravel
=====================================

Laravel package that ports the core Click payment integration logic.

v1.0.0(6mo ago)01[3 PRs](https://github.com/anvarulugov/click-integration-laravel/pulls)MITPHPPHP ^8.1CI passing

Since Oct 30Pushed 1mo agoCompare

[ Source](https://github.com/anvarulugov/click-integration-laravel)[ Packagist](https://packagist.org/packages/anvarulugov/click-integration-laravel)[ Docs](https://github.com/anvarulugov/click-integration-laravel)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/anvarulugov-click-integration-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (16)Versions (5)Used By (0)

Click Integration Laravel
=========================

[](#click-integration-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2656ae2a9b2e9640d720747311ccd809fd945e2ea28ba9978fee04783bea845e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e766172756c75676f762f636c69636b2d696e746567726174696f6e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anvarulugov/click-integration-laravel)[![Total Downloads](https://camo.githubusercontent.com/45cb3e5a340c1d505305fa72d3794f76b473dc325cd17bfc5d92eb59c68682d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e766172756c75676f762f636c69636b2d696e746567726174696f6e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anvarulugov/click-integration-laravel)

Laravel-oriented port of the official [`click-integration-php`](https://github.com/click-llc/click-integration-php) library.
It wraps the Click Shop API and Merchant API flows in familiar Laravel service bindings, configuration and facades, so you can integrate Click in first-party Laravel applications without rewriting the business logic from scratch.

> The official Click payment documentation lives at ****.

Features
--------

[](#features)

- ✅ Laravel-native bindings &amp; facade for the Click payment client
- ✅ Multiple configured Click services (per `service_id` / merchant credentials)
- ✅ Publishable configuration &amp; migration stub for the `payments` table
- ✅ REST helper mirroring the original Application router (`/prepare`, `/complete`, `/invoice/*`, etc.)
- ✅ Extensible hooks: override any of the `Payments` lifecycle methods to customise behaviour

Requirements
------------

[](#requirements)

- PHP **8.4** or higher
- Laravel **11** or **12**

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

[](#installation)

```
composer require anvarulugov/click-integration-laravel
```

Publish the configuration (and optional migration) to tailor the package to your project:

```
php artisan vendor:publish --tag="click-integration-config"
php artisan vendor:publish --tag="click-integration-migrations"
```

Run the migration if you plan to use the bundled `payments` table schema:

```
php artisan migrate
```

Already have your own payments table? Skip the migration publish and adjust the repository as needed.

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

[](#configuration)

The published `config/click-integration.php` file mirrors the structure of the base PHP package, with first-class support for multiple services:

```
return [
    'provider' => [
        'endpoint' => env('CLICK_API_ENDPOINT', 'https://api.click.uz/v2/merchant/'),
        'default_service' => env('CLICK_DEFAULT_SERVICE', 'default'),
        'services' => [
            'default' => [
                'merchant_id' => env('CLICK_MERCHANT_ID'),
                'service_id'  => env('CLICK_SERVICE_ID'),
                'user_id'     => env('CLICK_USER_ID'),
                'secret_key'  => env('CLICK_SECRET_KEY'),
            ],
            // 'secondary' => [
            //     'merchant_id' => env('CLICK_SECONDARY_MERCHANT_ID'),
            //     'service_id'  => env('CLICK_SECONDARY_SERVICE_ID'),
            //     'user_id'     => env('CLICK_SECONDARY_USER_ID'),
            //     'secret_key'  => env('CLICK_SECONDARY_SECRET_KEY'),
            // ],
        ],
    ],
    'database' => [
        'connection' => env('CLICK_DB_CONNECTION'),
        'table'      => env('CLICK_PAYMENTS_TABLE', 'payments'),
    ],
    'session' => [
        'header' => env('CLICK_SESSION_AUTH_HEADER', 'Auth'),
    ],
];
```

> **Security tip:** keep the credential values in environment variables / secret storage. Only the service keys themselves need to live in version control.

Quick Start
-----------

[](#quick-start)

### Resolve the payment service

[](#resolve-the-payment-service)

```
use Click\Integration\Facades\ClickIntegration;

// Uses the default service defined in config
$payments = ClickIntegration::payments();

// Target a specific service/merchant pair
$secondary = ClickIntegration::payments(['service' => 'secondary']);
```

### Shop API methods

[](#shop-api-methods)

```
// Prepare
$prepareResponse = $payments->prepare($request->all());

// Complete
$completeResponse = $payments->complete($request->all());
```

### Merchant API methods

[](#merchant-api-methods)

```
$payments->create_invoice([
    'token'        => 'uuid-token',
    'phone_number' => '998901234567',
]);

$payments->check_invoice([
    'token'      => 'uuid-token',
    'invoice_id' => 2222,
]);

$payments->create_card_token([
    'token'       => 'uuid-token',
    'card_number' => '4444-4444-4444-4444',
    'expire_date' => '0128',
    'temporary'   => 1,
]);

$payments->verify_card_token([
    'token'    => 'uuid-token',
    'sms_code' => '12345',
]);

$payments->payment_with_card_token([
    'token'      => 'uuid-token',
    'card_token' => 'CARDTOKEN',
]);

$payments->delete_card_token([
    'token'      => 'uuid-token',
    'card_token' => 'CARDTOKEN',
]);

$payments->check_payment([
    'token'      => 'uuid-token',
    'payment_id' => 1111,
]);

$payments->merchant_trans_id([
    'token'             => 'uuid-token',
    'merchant_trans_id' => 7777,
]);

$payments->cancel([
    'token'      => 'uuid-token',
    'payment_id' => 1111,
]);
```

All methods return associative arrays mirroring Click’s API responses. Exceptions surface as `Click\Integration\Exceptions\ClickException` using Click’s official error codes.

REST Application Helper
-----------------------

[](#rest-application-helper)

If you expose Click endpoints directly (like the original PHP library), you can use the application runner to dispatch the correct handler based on the request path:

```
use Click\Integration\Facades\ClickIntegration;
use Illuminate\Support\Facades\Route;

Route::any('/click/{any?}', function () {
    return response()->json(
        ClickIntegration::application()->run()
    );
})->where('any', '.*');
```

Need to switch to a different service profile?

```
return response()->json(
    ClickIntegration::application(['service' => 'secondary'])->run()
);
```

### Session helper

[](#session-helper)

`Click\Integration\Application\Application::session()` mirrors the original library’s token-based guard:

```
use Click\Integration\Application\Application;
use Click\Integration\Facades\ClickIntegration;

Application::session(env('CLICK_SESSION_TOKEN'), ['/prepare', '/complete'], function () {
    ClickIntegration::application()->run();
});
```

Requests for endpoints listed in the `$access` array bypass the session guard. All other routes must provide the header defined by `click-integration.session.header` (defaults to `Auth`).

Extending the Payments client
-----------------------------

[](#extending-the-payments-client)

Create your own class extending `Click\Integration\Services\Payments` to customise any of the lifecycle hooks (they mirror the base PHP package):

```
use Click\Integration\Services\Payments as BasePayments;
use Psr\Http\Message\ResponseInterface;

class MyPayments extends BasePayments
{
    protected function on_invoice_creating(array $payload): ResponseInterface
    {
        // Inspect or modify payload before forwarding to Click
        return parent::on_invoice_creating($payload);
    }

    protected function on_invoice_created(array $request, ResponseInterface $response, string $token): ?array
    {
        $result = parent::on_invoice_created($request, $response, $token);

        // Add custom bookkeeping here...

        return $result;
    }
}
```

Bind your custom class in a service provider:

```
$this->app->bind(\Click\Integration\Services\Payments::class, MyPayments::class);
```

Testing
-------

[](#testing)

```
composer test
```

The package ships with Pest &amp; PHPUnit support through Orchestra Testbench.

Roadmap &amp; Ideas
-------------------

[](#roadmap--ideas)

- Artisan commands to manage Click service credentials
- Example HTTP controllers for webhook-style integrations
- Demo application / Postman collection

Contributions and ideas are welcome—open an issue or submit a pull request!

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for a full list of updates.

Credits
-------

[](#credits)

- [click-llc/click-integration-php](https://github.com/click-llc/click-integration-php) – original library
- [Click LLC](https://click.uz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for details.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance81

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

195d ago

### Community

Maintainers

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

---

Top Contributors

[![anvarulugov](https://avatars.githubusercontent.com/u/10881762?v=4)](https://github.com/anvarulugov "anvarulugov (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelpaymentclickshop-apianvarulugov

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/anvarulugov-click-integration-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/anvarulugov-click-integration-laravel/health.svg)](https://phpackages.com/packages/anvarulugov-click-integration-laravel)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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