higi90 / spayd-parser
Spayd format parser PHP libary
0.0.2
2017-03-31 14:41 UTC
Requires
- php: >=7.0.0
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- nette/tester: ^1.7
This package is not auto-updated.
Last update: 2024-04-28 00:27:08 UTC
README
Short Payment Descriptor (SPAYD, SPD) format parser PHP libary
Installation
$ composer require higi90/spayd-parser
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use Higi90\SpaydParser; $spaydString = 'SPD*1.0*ACC:CZ2806000000000168540115+FIOBCZPP*AM:450.00*CC:CZK*MSG:PLATBA ZA ZBOZI*X-VS:1234567890'; $spayd = new SpaydParser\Spayd($spaydString); echo 'ACC: ' . $spayd->getParam('ACC') . "\n"; echo 'MSG: ' . $spayd->getParam('MSG') . "\n"; $account = $spayd->getAccount(); echo 'IBAN: ' . $account->getIban() . "\n"; echo 'SWIFT: ' . $account->getSwift() . "\n"; if($account instanceof SpaydParser\AccountCzech) { echo 'Account number: ' . $account->getAccountNumber() . "\n"; echo 'Bank code: ' . $account->getBankCode() . "\n"; }