PHPackages                             be-lenka/fio-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. be-lenka/fio-php-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

be-lenka/fio-php-sdk
====================

Read JSON file from Fio bank and can send request.

1.0.1(1y ago)081MITPHP

Since May 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/be-lenka/fio-php-sdk)[ Packagist](https://packagist.org/packages/be-lenka/fio-php-sdk)[ Docs](https://github.com/be-lenka/fio-php-sdk)[ RSS](/packages/be-lenka-fio-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Fio
===

[](#fio)

Support [Fio API](http://www.fio.sk/docs/cz/API_Bankovnictvi.pdf). Read is provided via json file.

### Installation to project

[](#installation-to-project)

The best way to install be-lenka/fio-php-sdk is using Composer:

```
$ composer require be-lenka/fio-php-sdk
```

### How to use

[](#how-to-use)

Here is [example](tests/origin/FioTest.php) and run via cli. This script require account.ini in same directory, whose looks like.

```
[my-account]
account = 123456789
token = abcdefghijklmn

[wife-account]
account = 987654321
token = zyxuvtsrfd
```

FioFactory class help you create instances of classes FioPay and FioRead.

```
use Belenka\Fio;
$fioFactory = new Fio\Utils\FioFactory([
	'my-alias' => [
		'account' => '123456789',
		'token' => 'abcdefg'
	],
	'next-alias' => [
		'account' => '987654321',
		'token' => 'tuvwxyz'
	]
]);

$fioRead = $fioFactory->createFioRead('my-account');
$fioPay = $fioFactory->createFioPay('wife-account');
```

Reading
-------

[](#reading)

#### Read range between date.

[](#read-range-between-date)

```
use Belenka\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Response\Read\TransactionList */
$list = $fioRead->movements(/* $from, $to */); // default is last week

foreach ($list as $transaction) {
    /* @var $transaction Fio\Response\Read\Transaction */
    var_dump($transaction->moveId);
    foreach ($transaction as $property => $value) {
        var_dump($property, $value);
    }
}

var_dump($list->getInfo());
```

#### You can download transaction by id of year.

[](#you-can-download-transaction-by-id-of-year)

```
use Belenka\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Response\Read\TransactionList */
$list = $fioRead->movementId(2, 2015); // second transaction of year 2015
```

#### Very useful method where download last transactions.

[](#very-useful-method-where-download-last-transactions)

After download it automaticaly set new break point.

```
use Belenka\Fio;
/* @var $fioRead Fio\FioRead */
/* @var $list Fio\Response\Read\TransactionList */
$list = $fioRead->lastDownload();
// same use like above
var_dump($list->getInfo()->idLastDownload);
```

#### Change your break point.

[](#change-your-break-point)

By date.

```
$fioRead->setLastDate('1986-12-30');
$list = $fioRead->lastDownload();
var_dump($list->getInfo()->idLastDownload);
```

By movement ID.

```
$fioRead->setLastId(123456789);
$list = $fioRead->lastDownload();
var_dump($list->getInfo()->idLastDownload); // 123456789
```

#### Custom Transaction class

[](#custom-transaction-class)

By default is Belenka\\Fio\\Response\\Read\\Transaction if you want other names for properties. Let's define as second parameter to FioFactory.

Define annotation and you don't forget id in brackets.

```
