PHP code example of h4kuna / fio
1. Go to this page and download the library: Download h4kuna/fio 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/ */
h4kuna / fio example snippets
use h4kuna\Fio;
$fioFactory = new Fio\FioFactory(parse_ini_file($ini, true));
$fioRead = $fioFactory->createFioRead('my-account');
$fioPay = $fioFactory->createFioPay('wife-account');
$fioRead2 = $fioFactory->createFioRead(); // first in list is default, [my-account]
[
'my-alias' => [
'account' => '123456789',
'token' => 'abcdefg'
],
'next-alias' => [
'account' => '987654321',
'token' => 'tuvwxyz'
]
]
use h4kuna\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Read\TransactionList */
$list = $fioRead->movements(/* $from, $to */); // default is last week
foreach ($list as $transaction) {
/* @var $transaction Fio\Read\Transaction */
var_dump($transaction->moveId);
foreach ($transaction as $property => $value) {
var_dump($property, $value);
}
}
var_dump($list->getInfo());
use h4kuna\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Read\TransactionList */
$list = $fioRead->movementId(2, 2015); // second transaction of year 2015
use h4kuna\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Read\TransactionList */
$list = $fioRead->lastDownload();
// same use like above
var_dump($list->getInfo()->idLastDownload);
$fioRead->setLastDate('1986-12-30');
$list = $fioRead->lastDownload();
var_dump($list->getInfo()->idLastDownload);
$fioRead->setLastId(123456789);
$list = $fioRead->lastDownload();
var_dump($list->getInfo()->idLastDownload); // 123456789
/* @var $fioPay h4kuna\Fio\FioPay */
$fioPay->setLanguage('en');
$myFile = '/path/to/my/xml/or/abo/file.xml'; // file extension is important
$fioPay->send($myFile);
/* @var $national Fio\Pay\Payment\National */
$national = $fioPay->createNational($amount, $accountTo);
$national->setVariableSymbol($vs);
/* set next payment property $national->set* */
$fioPay->send();
/* @var $euro Fio\Pay\Payment\Euro */
$euro = $fioPay->createEuro($amount, $accountTo, $name);
$euro->setVariableSymbol($vs);
/* set next payment property $euro->set* */
$fioPay->send();
/* @var $international Fio\Pay\Payment\International */
$international = $fioPay->createInternational($amount, $accountTo, $bic, $name, $street, $city, $country, $info);
$international->setRemittanceInfo2('foo');
/* set next payment property $international->set* */
$fioPay->send();
foreach($pamentsRows as $row) {
/* @var $national Fio\Pay\Payment\National */
$national = $fioPay->createNational($row->amount, $row->accountTo);
$national->setVariableSymbol($row->vs);
}
$fioPay->send();