Skip to content
/ mbank Public
forked from bgaluszka/mbank

Library for accessing czech mBank's transaction service

License

Notifications You must be signed in to change notification settings

lukyrys/mbank

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library for accessing mBank CZ transaction service

Suitable for checking for new transactions. Implemented methods:

  • login
  • list accounts
  • list recent operations
  • logout

Requirements

  • PHP 5.3 or higher
  • cURL extension

Installation

Install library from composer:

{
    "require": {
        "lukyrys/mbank": "dev-master"
    }
}

Example usage

Recent operations for all accounts

<?php
// load the autoload.php from composer
require 'vendor/autoload.php';

$mbank = new \bgaluszka\Mbank\Mbank();
$mbank->login('id', 'password');

foreach (array('individual', 'business') as $profile) {
    $mbank->profile($profile);

    foreach ($mbank->accounts() as $account) {
        echo "{$account['name']} {$account['value']} {$account['currency']}\n";

        foreach ($mbank->operations($account['iban']) as $operation) {
            echo "{$operation['title']} {$operation['value']} {$operation['currency']}\n";
        }
    }
}

$mbank->logout();

Search account

<?php
// load the autoload.php from composer
require 'vendor/autoload.php';

$mbank = new \bgaluszka\Mbank\Mbank();
$mbank->login('id', 'password');

$operations = $mbank->operations('00 1111 2222 3333 4444 5555 6666', array(
    'SearchText' => 'Tytuł przelewu',
    'AmountFrom' => -10000.01,
    'AmountTo' => 10000.01,
    'periodFrom' => '01.01.2014',
    'periodTo' => '31.12.2014',
    // 1 page contains about 25 operations, set it to 2 to get 50, 3 to 75 and so on
    'pagesCount' => 2,
));

foreach ($operations as $operation) {
    echo "{$operation['title']} {$operation['value']} {$operation['currency']}\n";
}

$mbank->logout();

About

Library for accessing czech mBank's transaction service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%