asisteam / csob-bc
CSOB Business Connector - for download/upload files automation
Installs: 10 198
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 7
Open Issues: 1
Requires
- php: >= 7.1
- ext-curl: *
- ext-dom: *
- ext-iconv: *
- ext-libxml: *
- ext-simplexml: *
- ext-soap: *
- guzzlehttp/guzzle: ^7.0
- moneyphp/money: ^4.0
- nette/di: ^2.4 || ~3.0.0
Requires (Dev)
- ext-simplexml: *
- mockery/mockery: ^1.2
- ninjify/nunjuck: ^0.2.0
- ninjify/qa: ^0.8.0
This package is auto-updated.
Last update: 2024-10-29 16:31:57 UTC
README
Credits
The development is under AsisTeam s.r.o.. Feel free to use. Your contributions are very welcome. Feel free to publish pull requests.
Overview
This PHP API wrapper allows you to work with CSOB Business Connector PDF official implementation documentation.
This library follows the official docs and allows you to:
- list and read files (AVIZO, VYPIS) from CEB
- generate and upload payment orders to CEB
Please see the Business Connector API - usage documentation
Install
composer require asisteam/csob-bc
Versions
Tests
Check code quality and run tests
composer phpstan-install
composer ci
or separately
composer qa
composer phpstan-install
composer phpstan
composer tests
Note: integration tests are skipped as they do request to real api endpoints. The validity of assertions in integration tests may change too.
Example usage
// use factory to create CEB instance // factory creates and registers file readers and generators so you don't have to do it manually $options = new Options('path/to/bccert.pem', 'certPassPhrase', 'contractId', 'appGuid'); $factory = new CEBFactory($options, '/tmp/dir/path'); $ceb = $factory->create(); // returns API response with files listed in CEB API $list = $ceb->listFiles(); Assert::count(2, $list->getFiles()); // You can read and parse files content // first one is VYPIS type $as = $ceb->downloadAndRead($list->getFiles()[0]); Assert::true($as instanceof IReport); // You can iterate entries and get details about each transaction Assert::count(11, $as->getEntries()); // second one is AVIZO type $adv = $ceb->downloadAndRead($list->getFiles()[1]); Assert::true($adv instanceof IAdvice); // You can iterate entries and get details about each transaction Assert::count(3, $adv->getTransactions()); // generate and upload payment batch file to CEB $payments = []; // create list of IPaymentOrder entities eg by: new InlandPayment(...) $file = $ceb->generatePaymentFile($payments); $ceb->upload([$file]);