PHPackages                             ahmadrezaei/yii2-mellatbank - 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. ahmadrezaei/yii2-mellatbank

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

ahmadrezaei/yii2-mellatbank
===========================

By this extension you can add mellat bank gateway to your yii2 project

1.1.0(9y ago)1591MITPHP

Since Feb 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ahmadrezaei/yii2-mellatbank)[ Packagist](https://packagist.org/packages/ahmadrezaei/yii2-mellatbank)[ RSS](/packages/ahmadrezaei-yii2-mellatbank/feed)WikiDiscussions master Synced 2mo ago

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

yii2 iranian bank mellat gateway extension
==========================================

[](#yii2-iranian-bank-mellat-gateway-extension)

By this extension you can add mellat bank gateway to your yii2 project

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist ahmadrezaei/yii2-mellatbank "*"

```

or add

```
"ahmadrezaei/yii2-mellatbank": "*"

```

to the require section of your `composer.json` file.

Configuring application
-----------------------

[](#configuring-application)

After extension is installed you need to setup auth client collection application component:

```
return [
    'components' => [
        'mellatbank' => [
            'class' => 'ahmadrezaei\yii\mellatbank\components\Mellatbank',
            'username' => 'YOUR-USERNAME',
            'password' => 'YOUR-PASSWORD',
            'terminal' => 'YOUR-TERMINAL-ID',
            'mysql' => true, // If you want to save records in db
        ]
        // ...
    ],
    // ...
];
```

If you want to save records in database, create migrations:

```
php yii migrate -p=@vendor/ahmadrezaei/yii2-mellatbank/migrations

```

Usage
-----

[](#usage)

For create a payment request:

```
$amount = 10000; // Rial
$callBackUrl = Url::to(['callback']); // callback url
/* @var $mellatbank \ahmadrezaei\yii\mellatbank\components\Mellatbank */
$mellatbank = Yii::$app->mellatbank;
$mellatbank->createPayment($amount, $callBackUrl);
```

For verify payment request:

```
/* @var $mellatbank \ahmadrezaei\yii\mellatbank\components\Mellatbank */
$mellatbank = Yii::$app->mellatbank;
$result = $mellatbank->verify();
if( $result ) {
    // payment is successfull
    $transactionID = $mellatbank->transactionId;
    $resCode = $mellatbank->resultCode;
} else {
    // payment is unsuccessfull
    $resCode = $mellatbank->resultCode;
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

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

Every ~0 days

Total

2

Last Release

3366d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fcd1eebad6858e0c8792f140e9f0c7a4c6a964105e6968fe776825a36f33140?d=identicon)[ahmadrezaei](/maintainers/ahmadrezaei)

---

Top Contributors

[![ahmadrezaei](https://avatars.githubusercontent.com/u/7928105?v=4)](https://github.com/ahmadrezaei "ahmadrezaei (4 commits)")[![Adsensor](https://avatars.githubusercontent.com/u/30296591?v=4)](https://github.com/Adsensor "Adsensor (1 commits)")

---

Tags

yii2extensionpaymentgatewaymellatbank

### Embed Badge

![Health badge](/badges/ahmadrezaei-yii2-mellatbank/health.svg)

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

PHPackages © 2026

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