8000 GitHub - racinmat/fio: Read and send payment order for FIO bank
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

racinmat/fio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fio

Build Status

Support Fio API. Default read via json file.

Installation to project

The best way to install h4kuna/fio is using Composer:

$ composer require h4kuna/fio

Example NEON config

extensions:
    fioExtension: h4kuna\Fio\DI\FioExtension

fioExtension:
    # mandatory
    account: 2600267402/2010
    token: 5asd64as5d46ad5a6

    # optional
    temp: %tempDir%/fio
    transactionClass: \h4kuna\Fio\Response\Read\Transaction # if you need change name of property

How to use

Reading

Read range between date.

use h4kuna\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 */
    dump($transaction->moveId);
    foreach ($transaction as $property => $value) {
        dump($property, $value);
    }
}

dump($list->getInfo());

You can download transaction by id of year.

use h4kuna\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.

After download it automaticaly set new break point.

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

Change your break point.

By date.

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

By movement ID.

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

Custom Transaction class

By default is h4kuna\Fio\Response\Read\Transaction if you want other names for properties. You can set by Neon.

fioExtension:
    transactionClass: \MyTransaction

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

<?php

use h4kuna\Fio\Response\Read\ATransaction

/**
 * @property-read float $amount [1]
 * @property-read string $to_account [2]
 * @property-read string $bank_code [3]
 */
class MyTransaction extends ATransaction
{
	/** custom method */
	public function setBank_code($value)
	{
		return str_pad($value, 4, '0', STR_PAD_LEFT);
	}
}

Payment (writing)

Api has three response languages, default is set cs. For change:

/* @var $fioPay h4kuna\Fio\FioPay */
$fioPay->setLanguage('en');

For send request is method send whose accept, file path to your xml or abo file or instance of class Property.

$myFile = '/path/to/my/xml/or/abo/file'
$fioPay->send($myFile);

Object pay only to czech or slovak:

/* @var $national h4kuna\Fio\Request\Pay\Payment\National */
$national = $fioPay->createNational($amount, $accountTo);
$national->setVariableSymbol($vs);
/* set next payment property $national->set* */
$fioPay->send($national);

Euro zone payment:

/* @var $euro h4kuna\Fio\Request\Pay\Payment\Euro */
$euro = $fioPay->createEuro($amount, $accountTo, $bic, $name, $country);
$euro->setVariableSymbol($vs);
/* set next payment property $euro->set* */
$fioPay->send($euro);

International payment:

/* @var $international h4kuna\Fio\Request\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($international);

Send more payments in one request:

foreach($pamentsRows as $row) {
	/* @var $national h4kuna\Fio\Request\Pay\Payment\National */
	$national = $fioPay->createNational($row->amount, $row->accountTo);
	$national->setVariableSymbol($row->vs);
	$fioPay->addPayment($national);
}
$fioPay->send();

About

Read and send payment order for FIO bank

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.6%
  • Shell 0.4%
0