grigorieff/yii2-yandex-money

Yii2 component for yandex modey integration in your web application

dev-master 2015-06-22 12:53 UTC

This package is not auto-updated.

Last update: 2024-04-27 14:59:19 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist grigorieff/yii2-yandex-money "*"

or add

"grigorieff/yii2-yandex-money": "*"

to the require section of your composer.json.

Configuration

Add to your app config:

    'components' => [

        .........

        'ym' => [
            'class' => 'grigorieff\ym\YMComponent',
            'client_id' => '......',
            'code' => '......',
            'redirect_uri' => '......',
            'client_secret' => '......'
        ],

        .........

    ];

Usage

$ym = Yii::$app->ym;

// get account info

$accountInfo = $ym->accountInfo();

.......

// get operation history with last 3 records
$operationHistory = $ym->->operationHistory(array("records"=>3));

......

// make request payment
$requestPayment = $ym->requestPayment([
    "pattern_id" => "p2p",
    "to" => $money_wallet,
    "amount_due" => $amount_due,
    "comment" => $comment,
    "message" => $message,
    "label" => $label,
]);

......

// call process payment to finish payment
$processPayment = $ym->processPayment(array(
    "request_id" => $request_payment->request_id,
));

......

License

MIT

Requirements

This Yii2 component require Yandex Money SDK