{"id":33974731,"url":"https://github.com/pavolbiely/tatrabanka-api","last_synced_at":"2025-12-13T01:50:36.924Z","repository":{"id":57036602,"uuid":"118637527","full_name":"pavolbiely/tatrabanka-api","owner":"pavolbiely","description":"PHP REST API Client for Tatra Banka's Open Banking TB.","archived":false,"fork":false,"pushed_at":"2018-01-27T13:28:15.000Z","size":23,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T01:39:42.138Z","etag":null,"topics":["api-client","oauth2","openbanking","rest-api","rest-client","tatrabanka"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavolbiely.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-23T16:31:33.000Z","updated_at":"2023-03-06T14:25:26.000Z","dependencies_parsed_at":"2022-08-23T20:51:02.055Z","dependency_job_id":null,"html_url":"https://github.com/pavolbiely/tatrabanka-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pavolbiely/tatrabanka-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavolbiely%2Ftatrabanka-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavolbiely%2Ftatrabanka-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavolbiely%2Ftatrabanka-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavolbiely%2Ftatrabanka-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavolbiely","download_url":"https://codeload.github.com/pavolbiely/tatrabanka-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavolbiely%2Ftatrabanka-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27697987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","oauth2","openbanking","rest-api","rest-client","tatrabanka"],"created_at":"2025-12-13T01:50:36.385Z","updated_at":"2025-12-13T01:50:36.918Z","avatar_url":"https://github.com/pavolbiely.png","language":"PHP","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BHZKXCWAK2NNS"],"categories":[],"sub_categories":[],"readme":"# Tatra Banka - Open banking TB\n[![Build Status](https://travis-ci.org/pavolbiely/tatrabanka-api.svg?branch=master)](https://travis-ci.org/pavolbiely/tatrabanka-api)\n[![Coverage Status](https://coveralls.io/repos/github/pavolbiely/tatrabanka-api/badge.svg?branch=master)](https://coveralls.io/github/pavolbiely/tatrabanka-api?branch=master)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=BHZKXCWAK2NNS)\n\nPHP REST API Client for [Tatra Banka](https://www.tatrabanka.sk/)'s [Open Banking TB](https://www.tatrabanka.sk/sk/personal/ucet-platby/elektronicke-bankovnictvo/openbankingtb.html).\n\nSign up at [developer.tatrabanka.sk](https://developer.tatrabanka.sk) to get access to the API.\n\n## Installation\n\nUse composer to install this package.\n\n## Example of usage\n\n### Accounts API\n\nAsk for the OAuth2 authorization\n```php\nuse TatraBankaApi\\Accounts;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n\n$tb = new Accounts($clientId, $clientSecret, $redirectUri);\n$tb-\u003euseSandbox(true);\nheader('Location: ' . $tb-\u003egetAuthorizationUrl());\n```\n\nExchange the OAuth2 authorization code for an access token\n```php\nuse TatraBankaApi\\Accounts;\nuse TatraBankaApi\\TatraBankaApiException;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n\ntry {\n    $tb = new Accounts($clientId, $clientSecret, $redirectUri);\n    $tb-\u003euseSandbox(true);\n    $tb-\u003erequestAccessToken($_GET['code']); // using authorization_code grand type\n} catch (TatraBankaApiException $e) {\n    // ...\n}\n```\n\nGeneral usage\n```php\nuse TatraBankaApi\\Accounts;\nuse TatraBankaApi\\TatraBankaApiException;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n\ntry {\n    $tb = new Accounts($clientId, $clientSecret, $redirectUri);\n    $tb-\u003euseSandbox(true);\n\n    if ($tb-\u003eisAuthorized()) {\n        // The operation provides the relevant data about bank customer's accounts in form of a list.\n        print_r($tb-\u003egetAccounts());\n\n        // The operation provides the relevant data from a bank customer's account identified by IBAN.\n        print_r($tb-\u003epostAccountInfo('SK0511000000002600000054'));\n\n        // The list of financial transactions perfomed on a customer's bank account withing a date period.\n        print_r($tb-\u003epostTransactions('SK0511000000002600000054', Accounts::STATUS_ALL, new \\DateTime('-1 month'),  new \\DateTime('now'), 1, 10));\n    }\n} catch (TatraBankaApiException $e) {\n    // ...\n}\n```\n\n## Payments API\nGet the OAuth2 access token and prepare the payment instructions\n```php\nuse TatraBankaApi\\Payments;\nuse TatraBankaApi\\PaymentAmount;\nuse TatraBankaApi\\PaymentParticipant;\nuse TatraBankaApi\\TatraBankaApiException;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n\ntry {\n    $tb = new Payments($clientId, $clientSecret, $redirectUri);\n    $tb-\u003euseSandbox(true);\n    $tb-\u003erequestAccessToken(); // using client_credentials grand type\n    $debtor = new PaymentParticipant('John Doe', 'SK0511000000002600000054');\n    $creditor = new PaymentParticipant('John Doe', 'DE89370400440532013000');\n    $amount = new PaymentAmount(100.15);\n    $response = $tb-\u003epostPaymentSba(md5(uniqid('', true)), $debtor, $creditor, $amount, new \\DateTime('tomorrow'), new \\DateTime('now'), '/VS123/SS456/KS0308', 'Test');\n    $authUrl = $tb-\u003egetAuthorizationUrl(['orderId' =\u003e $response-\u003eorderId]);\n    header('Location: ' . $authUrl);\n    exit;\n} catch (TatraBankaApiException $e) {\n    // ...\n}\n```\n\nExchange the OAuth2 authorization code for an access token and submit the payment\n```php\nuse TatraBankaApi\\Payments;\nuse TatraBankaApi\\TatraBankaApiException;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n\ntry {\n    $tb = new Payments($clientId, $clientSecret, $redirectUri);\n    $tb-\u003euseSandbox(true);\n    $tb-\u003erequestAccessToken($_GET['code']); // using authorization_code grand type\n    print_r($tb-\u003epostPaymentSubmission());\n\n} catch (TatraBankaApiException $e) {\n    // ...\n}\n```\n\nGet payment status\n```php\nuse TatraBankaApi\\Payments;\nuse TatraBankaApi\\TatraBankaApiException;\n\n$clientId = '';\n$clientSecret = '';\n$redirectUri = '';\n$orderId = ''; // order ID is generated by the postPaymentSba method\n\ntry {\n    $tb = new Payments($clientId, $clientSecret, $redirectUri);\n    $tb-\u003euseSandbox(true);\n    $tb-\u003erequestAccessToken(); // using client_credentials grand type\n    print_r($tb-\u003egetPaymentStatus(['orderId' =\u003e $orderId]));\n\n} catch (TatraBankaApiException $e) {\n    // ...\n}\n```\n\n## How to run tests?\nTests are build with [Nette Tester](https://tester.nette.org/). You can run it like this:\n```bash\nphp -f tester ./ -c php.ini-mac --coverage coverage.html --coverage-src ../src\n```\n\n## Minimum requirements\n- PHP 7.1+\n- php-curl\n\n## License\nMIT License (c) Pavol Biely\n\nRead the provided LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavolbiely%2Ftatrabanka-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavolbiely%2Ftatrabanka-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavolbiely%2Ftatrabanka-api/lists"}