PHPackages                             kent-payment/yii2-kent-payment - 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. kent-payment/yii2-kent-payment

ActiveYii2-extension[Payment Processing](/categories/payments)

kent-payment/yii2-kent-payment
==============================

this is Knet payment type via yii 2.0

17PHP

Since Jun 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/alnazer/yii2-kent-payment)[ Packagist](https://packagist.org/packages/kent-payment/yii2-kent-payment)[ RSS](/packages/kent-payment-yii2-kent-payment/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Knet Payment Via Yii 2.0 framework
==================================

[](#knet-payment-via-yii-20-framework)

this is Knet payment type via yii 2.0

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

[](#installation)

unzip all files and insert int to Path

```
frontend/components/

```

create folder components under folder frontend if is not existe

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
1- add your resource.cgn file in to Path knet\resource

```

How you can use this class

2- in your controller paste this code

```
use frontend\components\KnetPayment;
    /**
     * Do knet paymet action .
     *
     * @return mixed
     */
    public function actionPayment()
    {
        $knet = new KnetPayment();
        $knet->response_url = Url::to(['site/knetresponce'],'https'); // back response
        $knet->error_url = Url::to(['site/kneterror'],'https'); // back error
        $knet->ammount = 10; // your ammount or cost you can use decimal 10.33
        $knet->udf1 = "";
        $knet->udf2 = "";
        $knet->udf3 = "";
        $knet->udf4 = "";
        $knet->udf5 = "";
        $knet->action = 1;/leav it
        $knet->currency = 414;//Kw dinar
        $knet->lang = "ARA"; //default arabic lang
        $knet->alias = "your knet alias";
        $result = $knet->run(); // return json data
        $result = json_decode($result);

        if($result->status == 'success'){
            // redirect to knet url $result->url;
            $this->redirect($result->url);
        }else{
          // Display error here
        }
    }

```

in SiteController.php or other controller you choose you must add to actions

```
    /**
     *knet Responce result .
     *
     * @return mixed
     */
    public function actionKnetResponce()
    {
        // Do your action here

        $PaymentID = $_POST['PaymentID']; // Reads the value of the Payment ID passed by GET request by the user.
        $result = $_POST['Result']; // Reads the value of the Result passed by GET request by the user.
        $postdate = $_POST['PostDate']; // Reads the value of the PostDate passed by GET request by the user.
        $tranid = $_POST['TranID']; // Reads the value of the TranID passed by GET request by the user.
        $auth = $_POST['Auth']; // Reads the value of the Auth passed by GET request by the user.
        $ref = $_POST['Ref']; // Reads the value of the Ref passed by GET request by the user.
        $trackid = $_POST['TrackID'];  // Reads the value of the TrackID passed by GET request by the user.
        $udf1 = $_POST['UDF1'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf2 = $_POST['UDF2'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf3 = $_POST['UDF3'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf4 = $_POST['UDF4'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf5 = $_POST['UDF5'];  // Reads the value of the UDF1 passed by GET request by the user.

        echo "REDIRECT= Url::to(['site/knetresult',$_POST],'https');
    }
     /**
     *knet result Page .
     *
     * @return mixed
     */
    public function actionKnetResult()
    {
      // display result page
    }

    /**
     *knet Error result .
     *
     * @return mixed
     */
    public function actionknetError()
    {
      $PaymentID = $_GET['PaymentID'];
      //Display error page
    }
        /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                //'only' => ['knetresponce'],
                'rules' => [
                    [
                        'actions' => ['knetresponce'],
                        'allow' => true,
                        'roles' => ['?'],
                    ],
                ],
            ],
        ];
    }

```

if Payment operation success return json code

```
{"status":"success","payment_id":"xxxxxxxxx650","url":"https:\/\/www.knetpay.com.kw:443\/CGW\/hppaction?formAction=com.aciworldwide.commerce.gateway.payment.action.HostedPaymentPageAction&?PaymentID=xxxxxxxxx650"}

```

else if Payment operation fail return json code

```
{"status":"error","payment_id":"","url":"","msg":"RROR - CGW000186-Tran Amount Invalid"}
---------------------------
msg is knet responce error

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2820271?v=4)[alnazer](/maintainers/alnazer)[@alnazer](https://github.com/alnazer)

---

Top Contributors

[![alnazer](https://avatars.githubusercontent.com/u/2820271?v=4)](https://github.com/alnazer "alnazer (23 commits)")

### Embed Badge

![Health badge](/badges/kent-payment-yii2-kent-payment/health.svg)

```
[![Health](https://phpackages.com/badges/kent-payment-yii2-kent-payment/health.svg)](https://phpackages.com/packages/kent-payment-yii2-kent-payment)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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