betsuno/yii2-yandex-money

Yii2 component for yandex money integration in your web application

0.1 2018-02-13 17:14 UTC

This package is auto-updated.

Last update: 2024-04-06 22:41:37 UTC


README

This repo is fork of grigorieff/yii2-yandex-money was made because there was no stable release.

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

to the require section of your composer.json.

Configuration

Add to your app config:

    'components' => [

        .........

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

        .........

    ];

Usage

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

// get account info

$accountInfo = $ym->accountInfo();

.......

// get operation history with last 3 records
$operationHistory = $ym->operationHistory(['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([
    'request_id' => $request_payment->request_id,
]);

......

License

MIT

Requirements

This Yii2 component requires: