Skip to content

Commit

Permalink
Merge pull request #10 from sergeynezbritskiy/fix_tests
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
sergeynezbritskiy authored Dec 1, 2019
2 parents e3e8aea + c092bbe commit 3b54ac3
Show file tree
Hide file tree
Showing 76 changed files with 794 additions and 535 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ composer.phar
/vendor/
/build/
.idea
phpunit.xml
phpunit.xml
.phpunit.result.cache
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ os:
language: php

before_script:
- composer install
- composer update

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
- script: vendor/bin/phpcs --standard=PSR12 src tests
- script: vendor/bin/phpmd src text phpmd.xml
- script: vendor/bin/phpunit

php:
- 7.0
- 7.1
- 7.2
- 7.3
#- 7.4

matrix:
fast_finish: true
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# PrivatBank API

Library for connecting your PHP application with PrivatBank API

[![Build Status](https://travis-ci.org/sergeynezbritskiy/privatbank-api.svg?branch=master)](https://travis-ci.org/sergeynezbritskiy/privatbank-api)
Expand All @@ -11,23 +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:"^2.0.0"
composer require sergeynezbritskiy/privatbank-api:"^3.0"
```

## Notes
For more details please visit [https://api.privatbank.ua/]

## Simple usage
Using library is as easy as possible
```php
//create public client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\PublicClient();
//run the request
$result = $request->infrastructure(\SergeyNezbritskiy\PrivatBank\Request\InfrastructureRequest::TYPE_ATM, 'Днепропетровск');
$result = $client->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>');
$merchant = new \SergeyNezbritskiy\PrivatBank\Merchant('<your_merchant_id>', '<your_merchant_secret>');
$client->setMerchant($merchant);
//run the request
$result = $client->balance('4111111111111111');
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
}
],
"require": {
"guzzlehttp/guzzle": "~6.0",
"sergeynezbritskiy/xml-io": "^5.0.0",
"php": "~7.1.0|~7.2.0|~7.3.0",
"ext-dom": "*",
"ext-libxml": "*"
"ext-libxml": "*",
"guzzlehttp/guzzle": "~6.0",
"sergeynezbritskiy/xml-io": "^5.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5",
"squizlabs/php_codesniffer": "^3.3",
"phpmd/phpmd": "^2.6"
"phpunit/phpunit": "@stable",
"squizlabs/php_codesniffer": "@stable",
"phpmd/phpmd": "@stable"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 3b54ac3

Please sign in to comment.