reyesoft / crypto-qr
This library helps to generate QR codes for Crypto Address
Installs: 27 865
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 5
Forks: 3
Open Issues: 1
Requires
- php: ^8.1
- ext-gd: *
- endroid/qr-code: 5.0.9
Requires (Dev)
- codedungeon/phpunit-result-printer: 0.30.0
- khanamiryan/qrcode-detector-decoder: ^2.0
- phpunit/phpunit: ^9.1.5
- reyesoft/ci: 2.0.1
- dev-master
- 2.0.0
- 0.1.1
- 0.1.0
- 0.0.1
- dev-changed/changed-version-endroid
- dev-changed/upgrade-qr-code-library
- dev-changed/change-ci-version
- dev-dependabot/composer/symfony/process-5.4.46
- dev-changed/adapt-qr-for-pix
- dev-fix/qr-without-protocol
- dev-feature/ethereum_address
- dev-github-workflows
- dev-upgrade/composer
- dev-ci-phpstan-coverage-add
- dev-circleci-config-update
- dev-circleci-config
This package is auto-updated.
Last update: 2024-12-05 14:08:58 UTC
README
By Reyesoft
This library helps you generate QR codes for Crypto Address. Makes use of endroid/qr-code. Further extended with Twig extensions, generation routes, a factory and a
Installation
Use Composer to install the library.
$ composer require reyesoft/crypto-qr
Basic usage
use Reyesoft\CryptoQr\BitcoinQr; $qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs'); header('Content-Type: '.$qr->getQrCode()->getContentType()); echo $qr->getQrCode()->writeString();
Advanced usage
use Reyesoft\CryptoQr\BitcoinQr; // Create a basic QR code $qr = new BitcoinQr('3PrCdjyjcDHDSC8tvVgx1u96tMK9juncHs'); $qr->getQrCode()->setSize(300); $qr->setAmount(0.01); $qr->setLabel('Caritas'); $qr->setMessage('Donation for project Maria'); // Directly output the QR code header('Content-Type: '.$qr->getQrCode()->getContentType()); echo $qr->getQrCode()->writeString(); // Save it to a file $qr->getQrCode()->writeFile(__DIR__.'/qrcode.png');
getQrCode()
return a instance of Endroid\QrCode\QrCode
, then you have more options for your QR on
endroid/qr-code.
Testing
composer test
sh autofix.sh
PHP 7.3
docker run -it --rm --name php73 -e PHP_EXTENSIONS="gd" -v "$PWD":/usr/src/app thecodingmachine/php:7.3-v4-cli bash