stanley89 / spayd-php
PHP implementation of SmartPaymentDescriptor Generator.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/stanley89/spayd-php
Requires
- ext-iconv: >= 7.0
- endroid/qr-code: >= 2.5
- moneyphp/money: ^3.1
Requires (Dev)
- nette/tester: ^2.0
This package is not auto-updated.
Last update: 2025-10-01 07:30:18 UTC
README
SmartPaymentDescriptor is a lightweight format for exchanging a payment information. A vCard for payment instead of contacts, if you will..
This PHP library simplifies adding the support for generating/validating the SmartPaymentDescriptor (both file and QR code generation) to any PHP application.
Original Java implementation: https://github.com/spayd/spayd-java
Installation
Use Composer to install the library.
$ composer require stanley89/spayd-php
Basic usage
use Spayd\String\SpaydPaymentAttributes; use Spayd\String\SpaydExtendedPaymentAttributeMap; use Spayd\String\SpaydPayment; use Spayd\Model\Account\CzechBankAccount; use Spayd\Utilities\SpaydQRUtils; $parameters = new SpaydPaymentAttributes(); $parameters->setBankAccount(new CzechBankAccount("19", "123", "0800")); $parameters->setAmount("1"); $parameters->setCurrency("CZK"); $parameters->setDate(new \DateTime("2018-12-06")); $parameters->setRecipientName("Jan Novák"); $parameters->setMessage("Příliš žluťoučký kůň úpěl ďábelské ódy."); $extendedParameters = new SpaydExtendedPaymentAttributeMap(["VS" => 123, "SS" => 456, "KS" => 558]); $transliterateParams = true; $result = SpaydPayment::paymentStringFromAccount($parameters, $extendedParameters, $transliterateParams); $qrCode = SpaydQRUtils::getQRCode(null, $result, true); $qrCode->writeFile(__DIR__.'/qrcode.png');
License
The sources are available under Apache 2.0 License