CSOB Business Connector - for download/upload files automation
The development is under AsisTeam s.r.o.. Feel free to use. Your contributions are very welcome. Feel free to publish pull requests.
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
composer require asisteam/csob-bc
Check code quality and run tests
composer phpstan-install composer ci
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.
// 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()); 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()); 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]);