Skip to content

Commit

Permalink
Merge pull request #5 from sergeynezbritskiy/develop
Browse files Browse the repository at this point in the history
Release version 2.0
  • Loading branch information
sergeynezbritskiy authored Dec 8, 2018
2 parents 18fb648 + 8dc0820 commit 3b35530
Show file tree
Hide file tree
Showing 78 changed files with 2,449 additions and 1,579 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ os:
language: php

before_script:
- composer install --no-dev
- composer install

script: phpunit
jobs:
include:
- script: ./vendor/bin/phpcs --standard="./vendor/squizlabs/php_codesniffer/src/Standards/PSR12/ruleset.xml" ./src ./tests
- script: ./vendor/bin/phpmd ./src text ./phpmd.xml
- script: ./vendor/bin/phpunit

php:
- 7.0
- 7.1
- 7.2
- master
- 7.0
- 7.1
- 7.2
- 7.3
- master

matrix:
fast_finish: true
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@ Library for connecting your PHP application with PrivatBank API
## Installation
The easiest way to install module is using Composer
```
composer require sergeynezbritskiy/privatbank-api:"^1.0.0"
composer require sergeynezbritskiy/privatbank-api:"^2.0.0"
```

## Notes
For the full list of supported requests see phpdoc for \SergeyNezbritskiy\PrivatBank\Client class.

For the full list of required/supported params to some request, see description to this request.

All requests classes can be found within \SergeyNezbritskiy\PrivatBank\Request namespace.

For more details please visit [https://api.privatbank.ua/]
## Simple usage
Using library is as easy as possible
```php
//create client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\Client();
//create request instance
$request = $client->infrastructure();
//create public client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\PublicClient();
//run the request
$result = $request->infrastructure(\SergeyNezbritskiy\PrivatBank\Request\InfrastructureRequest::TYPE_ATM, 'Днепропетровск');

//create authorized client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\AuthorizedClient();
//create merchant
$merchant = new Merchant('<your_merchant_id>', '<your_merchant_secret>');
$client->setMerchant($merchant);
//run the request
$response = $request->execute([
'type' => \SergeyNezbritskiy\PrivatBank\Request\InfrastructureRequest::TYPE_ATM,
'city' => 'Днепропетровск',
])->toArray();
$result = $client->balance('4111111111111111');
```
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
],
"require": {
"guzzlehttp/guzzle": "~6.0",
"sergeynezbritskiy/xml-io": "^5.0.0"
"sergeynezbritskiy/xml-io": "^5.0.0",
"ext-dom": "*",
"ext-libxml": "*"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
"phpunit/phpunit": "^6.5",
"squizlabs/php_codesniffer": "^3.3",
"phpmd/phpmd": "^2.6"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 3b35530

Please sign in to comment.