2017 © Pedro Peláez
 

yii2-extension yii2-mellatbank

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

image

ahmadrezaei/yii2-mellatbank

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

  • Wednesday, October 25, 2017
  • by ahmadrezaei
  • Repository
  • 1 Watchers
  • 1 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

yii2 iranian bank mellat gateway extension

By this extension you can add mellat bank gateway to your yii2 project, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

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

or add, (*4)

"ahmadrezaei/yii2-mellatbank": "*"

to the require section of your composer.json file., (*5)

Configuring application

After extension is installed you need to setup auth client collection application component:, (*6)

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:, (*7)

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

Usage

For create a payment request:, (*8)

$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:, (*9)

/* @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;
}

The Versions

25/10 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Ahmad Rezaei

extension payment gateway yii2 mellatbank

23/02 2017

1.1.0

1.1.0.0

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

  Sources   Download

MIT

The Requires

 

by Ahmad Rezaei

extension payment gateway yii2 mellatbank

23/02 2017

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

by Ahmad Rezaei

extension payment gateway yii2 mellatbank