Download the PHP package sasa-b/php-bihupp-qrcode without Composer
On this page you can find all versions of the php package sasa-b/php-bihupp-qrcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sasa-b/php-bihupp-qrcode
More information about sasa-b/php-bihupp-qrcode
Files in sasa-b/php-bihupp-qrcode
Package php-bihupp-qrcode
Short Description Library implementing the BIHUPP QR Code standard for representing bank payment instructions as QR Codes
License MIT
Informations about the package php-bihupp-qrcode
php-bihupp-qrcode
PHP biblioteka koja implementira BIHUPP10 standard QR koda za instrukcije bankovnog plaćanja u Bosni i Hercegovini.
BIHUPP (Bosansko-hercegovački unutrašnji platni promet) definiše strukturirani tekstualni sadržaj koji se može enkodirati u obliku QR koda, koji banke skeniraju kako bi automatski popunile naloge za plaćanje. Ovaj format je ustanovljen od strane Udruženja Banaka Bosne i Hercegovine.
Dodavanje QR koda u definisanom formatu na računima omogućava krajnjim korisnicima plaćanje pomoću skeniranja QR koda kroz njihovo mobilno bankarstvo.
Za Kotlin biblioteku idite na kotlin-bihupp-qrcode.
Da biste verifikovali validnost QR koda ili da ga generišete ručno, koristite s-co.tech/bihupp-qrcode-verifikator
PHP library implementing the BIHUPP QR Code standard for bank payment instructions in Bosnia and Herzegovina.
BIHUPP (Bosansko-Hercegovački Unutrašnji Platni Promet) defines a structured text payload that can be encoded as a QR code that banks scan to pre-fill payment forms. This format was established by the Association of Banks of Bosnia and Herzegovina.
Adding a QR code in the defined format to invoices enables end-users to make payments by scanning the QR code through their mobile banking app.
For Kotlin library go to kotlin-bihupp-qrcode.
To verify validity of the QR Code or to generate one manually, use s-co.tech/bihupp-qrcode-verifikator
Table of contents
- Requirements
- Installation
- Quick start
- Usage
- Standard bank transfer
- Omitting the sender
- Multiple recipient accounts
- Including a sender phone number
- Public revenue payment
- Reading the payload string
- QR code output
- SVG (default)
- PNG / JPEG — GD extension
- PNG / JPEG — Imagick extension
- Base64 data-URI link
- Custom renderer
- Reading a QR code
- Field reference
PaymentInstructionconstructor- Field constraints
- Allowed character set
- Amount handling
- Payment priority
- Exception handling
- Contribute
- License
Requirements
- PHP 8.3+
chillerlan/php-qrcode^6.0khanamiryan/qrcode-detector-decoder^2.0 (required for QR code reading)
Installation
Quick start
Usage
Standard bank transfer
Omitting the sender
When sender is omitted, the bank pre-fills payer details from the logged-in user's session.
Multiple recipient accounts
Up to 20 recipient accounts can be specified.
Including a sender phone number
Public revenue payment (tax, fees, etc.)
Public revenue payments require additional fields grouped in a PublicRevenueInstruction object.
Reading the payload string
PaymentInstruction implements Stringable. Cast it to string to inspect or store the raw BIHUPP payload, or get an array of lines with lines():
QR code output
SVG (default)
PNG / JPEG — GD extension
Requires the gd extension. Throws MissingImageExtension if it is not loaded.
PNG / JPEG — Imagick extension
Requires the imagick extension. Throws MissingImageExtension if it is not loaded.
Base64 data-URI link
Base64Link wraps any ImageRenderStrategy and returns a base64 data URI. Defaults to SVG when no strategy is passed.
Custom renderer
Implement Renderer and RenderStrategy to integrate any QR library or add custom options (logo overlay, colours, size, etc.):
Reading a QR code
Use Reader::read() to scan a BIHUPP QR code image and reconstruct a PaymentInstruction from it. Pass either a file path or a binary blob as the source.
By default GD is used to decode the image. Pass ImageExtension::Imagick as the second constructor argument to use Imagick instead:
Field reference
PaymentInstruction constructor
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
sender |
Sender |
No | — | Pass null to let the bank auto-fill |
recipient |
Recipient |
Yes | — | |
purpose |
PaymentPurpose |
Yes | — | Max 110 chars |
reference |
PaymentReference\|null |
No | — | Pass null to omit |
amount |
Amount |
Yes | — | Integer in pennies (pfeninga) |
currency |
Currency |
Yes | BAM |
Hardcoded to BAM by standard |
paymentPriority |
PaymentPriority |
No | N (regular) |
|
publicRevenue |
PublicRevenue\|null |
No | null |
Required only for tax/fee payments |
version |
Version |
Yes | BIHUPP10 |
Field constraints
Sender / Recipient
| Field | Class | Max length | Format |
|---|---|---|---|
| Name | Name |
50 | Alphanumeric + allowed chars |
| Address line 1 | AddressLine1 |
50 | Street + number |
| Address line 2 | AddressLine2 |
25 | Postcode + city |
| Phone | PhoneNumber |
15 | E.164 (+ prefix required) |
| Sender account | Account |
16 | |
| Recipient account(s) | RecipientAccount |
339 | 1–20 accounts, comma-separated |
Payment detail
| Field | Class | Max length | Format |
|---|---|---|---|
| Purpose | PaymentPurpose |
110 | |
| Reference | Detail\PaymentReference |
30 | |
| Amount | Amount |
15 | Integer pennies (pfeninzi), zero-padded |
Public revenue fields
| Field | Class | Length | Format |
|---|---|---|---|
| Sender tax ID | SenderTaxId |
13 | Exactly 13 digits (JIB/JMBG) |
| Payment type | PaymentType |
1 | Single digit (0–9) |
| Revenue type | RevenueType |
6 | Exactly 6 digits |
| Tax period date | TaxPeriodDate |
8 | DDMMYYYY |
| Municipal code | MunicipalCode |
3 | Exactly 3 digits |
| Budget org code | BudgetOrgCode |
7 | Exactly 7 digits |
| Payment reference | PublicRevenue\PaymentReference |
10 | Exactly 10 digits |
Allowed character set
All text fields accept: alphanumeric characters, Serbian/Croatian/Bosnian diacritics (č ć đ š ž and their uppercase forms), and the symbols , : . ? ( ) + ' / - and space.
Fields with stricter formats (tax IDs, codes, phone numbers) enforce their own format in addition to the above.
Amount handling
Amount stores the value as an integer number of pennies (pfeniga) and zero-pads it to 15 digits in the payload. Use the factory helpers for other input types:
Payment priority
Exception handling
All validation runs at construction time. Exception types extend BihuppQRCodeException.:
| Exception | Thrown when |
|---|---|
InvalidLengthException |
Value exceeds the field's maximum character length |
InvalidCharacterException |
Value contains characters outside the allowed set |
InvalidValueException |
Value violates a field-specific format rule (digits-only, + prefix, etc.) |
MissingImageExtension |
A GD or Imagick render strategy is used but the required PHP extension is not loaded |
UnknownScanException |
Reader::read() could not decode the image and the underlying library returned no specific error |
Catch a specific type, or use BihuppQRCodeException to handle any library exception in one clause:
Contribute
Run code quality check before raising PRs.
License
MIT — see LICENSE.
All versions of php-bihupp-qrcode with dependencies
chillerlan/php-qrcode Version ^6.0.0
khanamiryan/qrcode-detector-decoder Version ^2.0