media24si / upn-generator
UPN form generator
Installs: 1 032
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 2
Forks: 7
Open Issues: 0
Requires
- php: ^8.1
- ext-gd: *
- endroid/qr-code: ^5.0
Requires (Dev)
- pestphp/pest: ^2.34
README
Installation
composer require media24si/upn-generator
Usage
First generate UPN:
$upn = (new \Media24si\UpnGenerator\UpnGenerator()) ->setPayerName('Janez Novak') ->setPayerAddress('Dunajska ulica 1') ->setPayerPost('1000 Ljubljana') ->setReceiverName('RentaCar d.o.o.') ->setReceiverAddress('Pohorska ulica 22') ->setReceiverPost('2000 Maribor') ->setReceiverIban('SI56020170014356205') ->setAmount(300.24) ->setCode('RENT') ->setReference('SI121234567890120') ->setPurpose('Plačilo najemnine za marec') ->setDueDate(new DateTime('+1 month'));
Then you have 3 options:
Output to browser: $upn->render();
Get PNG as a string: $upn->png();
Get GD Image resource: $upn->gdResource();
Above example will output:
License
The MIT License (MIT). Please see License File for more information.