PHP code example of betsuno / yii2-yandex-money

1. Go to this page and download the library: Download betsuno/yii2-yandex-money library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

betsuno / yii2-yandex-money example snippets


    'components' => [

        .........

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

        .........

    ];

$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,
]);

......


php composer.phar