PHPackages                             click/module - 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. [API Development](/categories/api)
4. /
5. click/module

ActiveLibrary[API Development](/categories/api)

click/module
============

The library to integration with click

22194[2 issues](https://github.com/click-llc/click-integration-php/issues)[1 PRs](https://github.com/click-llc/click-integration-php/pulls)PHPCI failing

Since Sep 17Pushed 4y ago2 watchersCompare

[ Source](https://github.com/click-llc/click-integration-php)[ Packagist](https://packagist.org/packages/click/module)[ RSS](/packages/click-module/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

CLICK Integration PHP
=====================

[](#click-integration-php)

This library allows you to integrate payment acceptance using `"CLICK"` payment system into `PHP` web applications. For the library to function properly, the user must be connected to Click Merchant using the Shop API scheme. Detailed documentation is available here ****.

[![ClickLLC](https://camo.githubusercontent.com/007a1d05931de751c30dac4df6134cb5d1e8c1e98768a37da3a711d47bc93c5e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d434c49434b2532304c4c432d677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/007a1d05931de751c30dac4df6134cb5d1e8c1e98768a37da3a711d47bc93c5e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d434c49434b2532304c4c432d677265656e2e7376673f7374796c653d666c6174)

Installation via Git
--------------------

[](#installation-via-git)

```
git clone https://github.com/click-llc/click-integration-php.git
cd click-integration-php
composer install

```

After installing, you need to require autoloader

```
require(__DIR__ . '\vendor\autoload.php');
```

Documentation
-------------

[](#documentation)

### Configuration

[](#configuration)

Your can set your configurations via `click/configs.php` file.

#### Click configuration

[](#click-configuration)

```
return [
    ...
    'provider' => [
        'endpoint' => 'https://api.click.uz/v2/merchant/',
        'click' => [
            'merchant_id' => 1111,
            'service_id' => 2222,
            'user_id' => 3333,
            'secret_key' => 'AAAAAAAA'
        ]
    ]
    ...
]
```

#### Database configuration

[](#database-configuration)

```
return [
    ...
    'db' => [
        'dsn' => 'mysql:host=localhost;dbname=',
        'username' => 'root',
        'password' => ''
    ]
    ...
]
```

### Quick Start

[](#quick-start)

#### 1) Create Model

[](#1-create-model)

You can use the `\cick\models\Payments` model

```
use click\models\Payments;
$model = new Payments();
```

Or can create payments model yourself via `\click\models\Payments` class

```
use click\models\Payments;
class MyPayments extends Payments{
    ...
}
$model = new MyPayments();
```

#### SHOP Api methods

[](#shop-api-methods)

Prepare

```
$model->prepare([
    'click_trans_id' => 1111,
    'service_id' => 2222,
    'click_paydoc_id' => 3333,
    'merchant_trans_id' =>  '11111',
    'amount' => 1000.0,
    'action' => 0,
    'error' => 0,
    'error_note' => 'Success',
    'sign_time' => 'YYYY-MM-DD HH:mm:ss',
    'sign_string' => 'AAAAAAAAAAAAAAAAAAAAAAAAAA'
]);
```

Complete

```
$model->complete([
    'click_trans_id' => 1111,
    'service_id' => 2222,
    'click_paydoc_id' => 3333,
    'merchant_trans_id' =>  '11111',
    'merchant_prepare_id' => 11111,
    'amount' => 1000.0,
    'action' => 1,
    'error' => 0,
    'error_note' => 'Success',
    'sign_time' => 'YYYY-MM-DD HH:mm:ss',
    'sign_string' => 'AAAAAAAAAAAAAAAAAAAAAAAAAA'
]);
```

#### Merchant Api methods

[](#merchant-api-methods)

Note : All of the merchant api methods return the CLICK-MERCHANT-API response as arrays

Create invoice

```
$model->create_invoice([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'phone_number' => '998112222222'
]);
```

Check invoice status

```
$model->check_invoice([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'invoice_id' => 2222
]);
```

Create card token

```
$model->create_card_token([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'card_number' => 'AAAA-BBBB-CCCC-DDDD',
    'expire_date' => 'BBEE',
    'temporary' => 1
]);
```

Verify card token

```
$model->verify_card_token([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'sms_code' => '12345'
]);
```

Payment with card token

```
$model->payment_with_card_token([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'card_token' => 'AAAAAA-BBBB-CCCC-DDDDDDD'
]);
```

Delete card token

```
$model->delete_card_token([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'card_token' => 'AAAAAA-BBBB-CCCC-DDDDDDD'
]);
```

Check payment status by `payment_id`

```
$model->check_payment([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'payment_id' => 1111
]);
```

Check payment status by `merchant_trans_id`

```
$model->merchant_trans_id([
    'token' => 'aaaa-bbbb-cccc-ddddddd',
    'merchant_trans_id' => 1111
]);
```

Cancel payment (reversal)

```
$model->cancel([
    'token' => 'aaaa-bbbb-cccc-dddddddd',
    'payment_id' => 1111
]);
```

#### 2) Overwrite the some methods over the Payments

[](#2-overwrite-the-some-methods-over-the-payments)

```
use click\models\Payments;
class MyPayments extends Payments{
    /**
     * @param data array
     * @return response \GuzzleHttp\Client
     */
    public function on_invoice_creating($data){
        ...
        $response = $this->client->request('POST', 'invoice/create', [
            ...
        ]);
        ...
        return $response;
    }
    /**
     * @param request array
     * @param response \GuzzleHttp\Client object
     * @param token string
     * @return response array|null
     */
    public function on_invoice_created($request, $response, $token){
        ...
        if($response->getStatusCode() == 200){
            $result = (array)json_decode((string) $response->getBody());
            ...
            $this->model->update_by_token($token, [
                ...
            ]);
            ...
        }
        ...
        return $result;
    }
}
```

List of the Payments methods

1. `on_invoice_creating` and `on_invoice_created` for create invoice
2. `on_invoice_checking` and `on_invoice_checked` for check invoice
3. `on_canceling` and `on_canceled` for cancel payment
4. `on_card_token_creating` and `on_card_token_created` for create card token
5. `on_card_token_verifying` and `on_card_token_verified` for verify card token
6. `on_card_token_paying` and `on_card_token_payed` for payment via card token
7. `on_card_token_deleting` and `on_card_token_deleted` for delete card token
8. `on_payment_checking` and `on_payment_checked` for check payment status by merchant\_id
9. `on_checking_with_merchant_trans_id` and `on_checked_with_merchant_trans_id` for check payment status by merchant\_trans\_id

If you want check whether the payment user exists, complete this method

```
use click\models\Payments;
class MyPayments extends Payments{
    /**
     * @name on_user_is_exists method
     * @param payment array
     * @return response boolean|null
     */
    protected function on_user_is_exists($payment){
        ...
    }
}
```

Advanced
--------

[](#advanced)

### 1) Create the application for rest api

[](#1-create-the-application-for-rest-api)

```
use click\applications\Application;
use click\models\Payments;

$model = new Payments();
$application = new Application([
    'model' => $model
]);
```

### 2) Create the application with application session for authorization via token

[](#2-create-the-application-with-application-session-for-authorization-via-token)

```
use click\applications\Application;
use click\models\Payments;

Application::session('', ['/prepare', '/complete'], function(){
    $model = new Payments();
    $application = new Application([
        'model' => $model
    ]);
    $application->run();
});
```

#### SHOP Api methods

[](#shop-api-methods-1)

1. `/prepare` for prepare
2. `/complete` for complete

#### Merchant Api methods

[](#merchant-api-methods-1)

1. `/invoice/create` for create invoice
2. `/invoice/check` for check invoice
3. `/payment/status` for check payment status via payment\_id
4. `/payment/merchant_train_id` for check payment status via merchant\_trans\_id
5. `/cancel` for cancel payment
6. `/card/create` for create card token
7. `/card/verify` for verify card token
8. `/card/payment` for payment with card token
9. `/card/delete` for delete card token

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/956d767c2785cf89e2b85e42d0f08eadc7fa0664d0d26625c4aabebabaa55e93?d=identicon)[clickuzglobal](/maintainers/clickuzglobal)

---

Top Contributors

[![tensor2flow](https://avatars.githubusercontent.com/u/46782269?v=4)](https://github.com/tensor2flow "tensor2flow (31 commits)")[![akbar-pardayev](https://avatars.githubusercontent.com/u/43012562?v=4)](https://github.com/akbar-pardayev "akbar-pardayev (3 commits)")

---

Tags

clickclick-merchant-apiclick-shopping-apiclickuzphpphp-integrationuzuzbekistan

### Embed Badge

![Health badge](/badges/click-module/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M19](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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