2017 © Pedro PelĂĄez
 

library php-fio-api

PHP Fio API implemention

image

perlur/php-fio-api

PHP Fio API implemention

  • Monday, January 22, 2018
  • by marek-stopka
  • Repository
  • 4 Watchers
  • 2 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 2 Open issues
  • 13 Versions
  • 44 % Grown

The README.md

Fio API PHP implemention Build Status Build Status Windows

Latest Stable Version Total Downloads License Coverage Status, (*1)

Fio bank REST API implementation in PHP. It allows you to download and iterate through account balance changes., (*2)

There is a Symfony Bundle for using this library in a Symfony app., (*3)

Usage

  1. Install the latest version with composer require mhujer/fio-api-php
  2. Create a token in the ebanking (NastavenĂ­ / API)
  3. Use it according to the example bellow and check the docblocks

Downloading

<?php
require_once 'vendor/autoload.php';

$downloader = new FioApi\Downloader('TOKEN@todo');
$transactionList = $downloader->downloadSince(new \DateTime('-1 week'));

foreach ($transactionList->getTransactions() as $transaction) {
    var_dump($transaction); //object with getters
}

Uploading

Domestic payment (in Czechia)

<?php
require_once 'vendor/autoload.php';

$token = get_your_fio_token();
$uploader = new FioApi\Uploader($token);
// currency, iban, bic is not needed
$account = new FioApi\Account('XXXXXXXXXX', 'ZZZZ', NULL, NULL, NULL);
$tx = Transaction::create((object) [
    'accountNumber' => 'YYYYYYYYYY',
    'bankCode' => 'WWWW',
    'date' => new \DateTime('2016-07-20'),
    'amount' => 6.66,
    'currency' => 'CZK',
    'userMessage' => 'money wasting',
    'comment' => 'fioapi.test'
]);

$builder = new FioApi\DomesticPaymentBuilder();
$request = $builder->build($account, [$tx]);
$response = $uploader->sendRequest($request);

echo $response->getStatus();

European payments

<?php
require_once __DIR__ . '/../vendor/autoload.php';

$token = get_your_fio_token();
$uploader = new FioApi\Uploader($token);
$account = new FioApi\Account('XXXXXXXXXX', 'YYYY', null, null, null);
$tx = FioApi\Transaction::create((object) [
    'accountNumber' => 'XXXXXXXXXXXXXXXX',
    'bankCode'      => 'WWWWWWWWWW',
    'date'          => new DateTime('2016-05-30'),
    'amount'        => 66.5,
    'currency'      => 'EUR',
    'userMessage'   => 'Donation for poor ones',
    'comment'       => 'fioapi.test',
    'benefName'     => 'Something Finland Oy',
    'benefCountry'  => 'FI',
]);

$builder = new FioApi\EuroPaymentBuilder();
$request = $builder->build($account, [$tx]);
$response = $uploader->sendRequest($request);

echo $response->getStatus();
echo "\n";

International payments (outside EU)

<?php
require_once __DIR__ . '/../vendor/autoload.php';

$token = get_your_fio_token();
$uploader = new FioApi\Uploader($token);
$account = new FioApi\Account('XXXXXXXXXX', 'YYYY', null, null, null);
$tx = FioApi\Transaction::create((object) [
    'accountNumber' => 'XXXXXXXXXXXXXXXX',
    'bankCode'      => 'WWWWWWWWWW',
    'date'          => new DateTime('2016-05-30'),
    'amount'        => 2,
    'currency'      => 'USD',
    'userMessage'   => 'Donation for homelesses at 6th Street',
    'comment'       => 'fioapi.test',
    'benefName'     => 'John Doe',
    'benefStreet'   => '6th Street',
    'benefCity'     => 'San Francisco, CA',
    'benefCountry'  => 'US',
]);

$builder = new FioApi\InternationalPaymentBuilder();
$request = $builder->build($account, [$tx]);
$response = $uploader->sendRequest($request);

echo $response->getStatus();
echo "\n";

Requirements

Fio API PHP works with PHP 5.5, PHP 5.6 or PHP 7., (*4)

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub, (*5)

Author

Martin Hujer - mhujer@gmail.com - https://www.martinhujer.cz, (*6)

Changelog

2.2.0 (2016-03-13)

2.1.0 (2016-03-12)

  • #1: updated default GeoTrust certificate (@soukiii)
  • #1: added specification field in transaction (@soukiii)

2.0.0 (2015-06-14)

  • upgraded to Guzzle 6
  • support for PHP 5.4 dropped (as Guzzle 6 requires PHP 5.5+)

1.0.3 (2015-06-14)

  • updated root certificate (Root 3) as the Fio changed it on 2014-05-26

1.0.0 (2015-04-05)

  • initial release

The Versions

22/01 2018

dev-master

9999999-dev https://github.com/perlur/php-fio-api

PHP Fio API implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

09/08 2017

dev-pr/16

dev-pr/16 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

17/06 2017

dev-update_travis

dev-update_travis https://github.com/perlur/php-fio-api

PHP Fio API implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

27/05 2016

dev-issue-2-upload-international-payments

dev-issue-2-upload-international-payments https://github.com/perlur/php-fio-api

PHP Fio API implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

04/05 2016

dev-add_codecov_test_coverage_testing

dev-add_codecov_test_coverage_testing https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

02/05 2016

dev-update-readme

dev-update-readme https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

13/03 2016

2.2.0

2.2.0.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

12/03 2016

2.1.0

2.1.0.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

14/06 2015

2.0.0

2.0.0.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

14/06 2015

1.0.3

1.0.3.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

09/06 2015

1.0.2

1.0.2.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

06/06 2015

1.0.1

1.0.1.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio

05/04 2015

1.0.0

1.0.0.0 https://github.com/mhujer/fio-api-php

Fio API PHP implemention

  Sources   Download

MIT

The Requires

 

The Development Requires

api banking fio