All Projects → h4kuna → Fio

h4kuna / Fio

Read and send payment order for FIO bank

Projects that are alternatives of or similar to Fio

Supervisord
Async first supervisord HTTP API Client for PHP 7
Stars: ✭ 14 (-65.85%)
Mutual labels:  api-client
Checkout Sdk Node
Checkout.com SDK for Node.js. Documentation here:
Stars: ✭ 28 (-31.71%)
Mutual labels:  api-client
Adyen Ruby Api Library
Adyen API Library for Ruby
Stars: ✭ 35 (-14.63%)
Mutual labels:  api-client
Sense Client
Quick and dirty Ruby client for the Hello Sense sleep tracker. Based on http://jeffhuang.com/extracting_my_data_from_the_hello_sense.html
Stars: ✭ 20 (-51.22%)
Mutual labels:  api-client
Elasticsearch Java Rest
Elasticsearch Java Rest 手册
Stars: ✭ 27 (-34.15%)
Mutual labels:  api-client
Python Adguardhome
Asynchronous Python client for the AdGuard Home API
Stars: ✭ 29 (-29.27%)
Mutual labels:  api-client
Kubernetes Client
Simplified Kubernetes API client for Node.js.
Stars: ✭ 874 (+2031.71%)
Mutual labels:  api-client
Appnexus Client
🐍 General purpose Python client for the AppNexus API
Stars: ✭ 37 (-9.76%)
Mutual labels:  api-client
Sevenbridges R
Seven Bridges API Client, CWL Schema, Meta Schema, and SDK Helper in R
Stars: ✭ 27 (-34.15%)
Mutual labels:  api-client
Cricinfo
Python library for accessing information from http://cricinfo.com (Live scores and updates)
Stars: ✭ 32 (-21.95%)
Mutual labels:  api-client
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-51.22%)
Mutual labels:  api-client
Hoppscotch
👽 Open source API development ecosystem https://hoppscotch.io
Stars: ✭ 34,569 (+84214.63%)
Mutual labels:  api-client
Apipie
Transform api declaration to js object for frontend. Inspired by VueRouter, koa-middleware and axios.
Stars: ✭ 29 (-29.27%)
Mutual labels:  api-client
Nba api
An API Client package to access the APIs for NBA.com
Stars: ✭ 881 (+2048.78%)
Mutual labels:  api-client
Frost Client
Frost Client helps you to easily integrate your applications with Po.et's API.
Stars: ✭ 35 (-14.63%)
Mutual labels:  api-client
Curlie
The power of curl, the ease of use of httpie.
Stars: ✭ 877 (+2039.02%)
Mutual labels:  api-client
App Search Node
Elastic App Search Official Node.js Client
Stars: ✭ 29 (-29.27%)
Mutual labels:  api-client
Bitmovin Python
DEPRECATED: Python client for the Bitmovin API, see https://github.com/bitmovin/bitmovin-api-sdk-python
Stars: ✭ 39 (-4.88%)
Mutual labels:  api-client
Authn Js
JavaScript client library for Keratin AuthN
Stars: ✭ 36 (-12.2%)
Mutual labels:  api-client
Blockchain Anchor
A Node.js library for anchoring data onto the Bitcoin blockchain and confirming anchored data on Bitcoin and Ethereum.
Stars: ✭ 32 (-21.95%)
Mutual labels:  api-client

Fio

Build Status Scrutinizer Code Quality Downloads this Month Latest stable Coverage Status

Support Fio API. Read is provided via json file.

Versions

Here is changlog

Note: php 7.1 has bug with float number and json_encode, therefore all float numbers are retyping to sting.

Nette framework

Follow this extension.

Installation to project

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

$ composer require h4kuna/fio

How to use

Here is example 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 h4kuna\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

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 */
    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.

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
var_dump($list->getInfo()->idLastDownload);

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

By default is h4kuna\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.

<?php

use h4kuna\Fio\Response\Read\TransactionAbstract

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

$fioFactory = new Utils\FioFactory([/* ... */], 'MyTransaction');

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, $name);
$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();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].