sprain / swiss-qr-bill
A PHP library to create Swiss QR bills
Fund package maintenance!
sprain
Installs: 1 106 679
Dependents: 3
Suggesters: 0
Security: 0
Stars: 284
Watchers: 18
Forks: 84
Open Issues: 8
Language:HTML
Requires
- php: ~8.1.0|~8.2.0|~8.3.0|~8.4.0
- ext-bcmath: *
- ext-dom: *
- endroid/qr-code: ^4.4.4|^5.0|^6.0
- kmukku/php-iso11649: ^1.5
- symfony/intl: ^4.4|^5.0|^6.0|^7.0
- symfony/polyfill-intl-icu: ^1.23
- symfony/polyfill-mbstring: ^1.30
- symfony/validator: ^4.4|^5.0|^6.0|^7.0
Requires (Dev)
- dg/bypass-finals: ^1.3
- dms/phpunit-arraysubset-asserts: ^0.2
- fpdf/fpdf: ^1.85
- friendsofphp/php-cs-fixer: ^3.15
- khanamiryan/qrcode-detector-decoder: ^1.0.3
- phpstan/phpstan: ^1.11-dev
- phpunit/phpunit: ^9.0
- rector/rector: ^1.2
- setasign/fpdf: ^1.8.2
- setasign/fpdi: ^2.3.5
- tecnickcom/tcpdf: ^6.3.2
Suggests
- fpdf/fpdf: Needed to create pdfs with FpdfOutput
- setasign/fpdf: Needed to create pdfs with Fpdi
- setasign/fpdi: Needed to create pdfs with Fpdi
- tecnickcom/tcpdf: Needed to create pdfs with TcPdfOutput
Conflicts
- dev-master
- v4.17.1
- v4.17
- v4.16.1
- v4.16
- v4.15
- v4.14
- v4.13
- v4.12.1
- v4.12
- v4.11.1
- v4.11
- v4.10
- v4.9
- v4.8.2
- v4.8.1
- v4.8
- v4.7
- v4.6
- v4.5
- v4.4
- v4.3
- v4.2
- v4.1.1
- v4.1
- v4.0
- v3.3
- v3.2
- v3.1.1
- v3.1
- v3.0
- v2.19
- v2.18
- v2.17.4
- v2.17.3
- v2.17.2
- v2.17
- v2.16
- v2.15.1
- v2.15
- v2.14
- v2.13
- v2.12.1
- v2.12
- v2.11
- v2.10
- v2.9
- v2.8.1
- v2.8
- v2.7.2
- v2.7.1
- v2.7
- v2.6
- v2.5
- v2.4.1
- v2.4
- v2.3
- v2.2
- v2.1
- v2.0
- v2.0-RC1
- v1.0-RC1
- v0.6
- v0.5
- v0.4
- v0.3
- v0.2.1
- v0.2
- v0.1
- dev-code-improvements
This package is auto-updated.
Last update: 2024-12-07 13:41:40 UTC
README
A PHP library to create Swiss QR Bill payment parts (QR-Rechnung).
Getting started
composer require sprain/swiss-qr-bill
Then have a look at example/example.php.
FAQs
-
Why is my IBAN not working?
A typical QR bill (example) requires a special QR IBAN. You can get yours from your bank. A classic IBAN can be used for QR bills with a SCOR reference (example) or no reference number at all (example). -
How do I recognize a QR IBAN?
In a QR IBAN, the institute id, which is defined in the 5th to 9th character, is a number in the range of 30000 to 31999. (Example: CH44 3199 9123 0008 8901 2). For how to detect it in code, see #182 (comment) -
How do I create QR bills for international IBANs?
You can't. The QR bill by specification only supports IBANs from Switzerland and Liechtenstein. -
How do I support currencies other than CHF or EUR?
You can't. The QR bill by specification only supports CHF and EUR. -
How do I change translations to use my own wording?
You can't. The translations are defined in the QR bill specification and are not meant to be changed by the user. See this document, page 31. -
How do I make my QR bills payable by Twint?
See #129 -
What PDF libraries are supported by this library?
The following libraries are currently actively supported:- fpdf/fpdf
- tecnickcom/tcpdf
- setasign/fpdi (accepted by
FpdfOutput
andTcPdfOutput
)
The output of
HtmlOutput
is known to be used to generate PDFs with PrinceXML, Docraptor, and dompdf/dompdf (with some adjustments as decribed here) -
Why are you using
final
on most classes? I want to extend them!
This library implements the official specification of the QR bill. This implementation is not supposed to be adjusted as it might result in broken QR bills. Therefore many classes are marked as final. If you find the need to extend one of those final classes, you might have found a bug in this library. In that case it will be very helpful if you provide a bug report or even a pull request here. Thank you!
Getting help
Do you need more help using this library?
- Search the existing and closed issues to see if you find your answer there.
- If you still need help, you may create an issue yourself to ask your question.
Please note that the maintainer of this library will not provide any support by email. The beauty of open source software lies in the fact that everybody can benefit from each other. Therefore questions will only be answered in public.
Versioning
Semantic versioning is used for this library.
In addition, a minor version will always be published if any visible change in the output of the qr code or the payment part takes place, even if it could be considered to be just a bugfix.
PHP version support
This library supports a PHP version as long as it accounts for at least approximately 10% of current installations.
Depdendency support
Older versions of dependencies are supported as long as they do not hinder further development or account for at least approximately 10% of current installations of the corresponding dependency.
Support the project
- Do you like this project? Consider a Github sponsorship.
- Would you like to contribute? Have a look at the open issues. Be nice to each other.
- Spread the word!
Official resources
The repository contains the official specifications the library is based on:
- Swiss Implementation Guidelines QR-bill
- Technical information about the QR-IID and QR-IBAN
- Style Guide QR-bill
- Validation Tool
For more official information see
For contributors of this libray
How to generate new test data:
- Set
$regenerateReferenceFiles = true
inTestQrBillCreatorTrait
composer update --prefer-lowest
vendor/bin/phpunit
– ignore failing tests intestQrFile
composer update
vendor/bin/phpunit
– there should be no more errors- Set
$regenerateReferenceFiles = false
inTestQrBillCreatorTrait