Download the PHP package feldsam-inc/paybysquare-php without Composer
On this page you can find all versions of the php package feldsam-inc/paybysquare-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download feldsam-inc/paybysquare-php
More information about feldsam-inc/paybysquare-php
Files in feldsam-inc/paybysquare-php
Package paybysquare-php
Short Description PHP library for generating PAY by square payment QR codes
License MIT
Informations about the package paybysquare-php
PayBySquare PHP
A PHP library for generating PAY by square payment QR codes for Slovak payment systems.
PHP Compatibility
Requirements
- PHP 7.4 or higher
- XZ binary installed on the server (automatically detected in common locations or configurable)
- Composer
Installation
Usage
Basic Usage
Advanced Usage
Multiple Bank Accounts
You can add multiple bank accounts to a single payment:
Beneficiary Information
You can include beneficiary information in the payment:
QR Code Customization
You can customize the generated QR code with various options:
Payment Symbols
Slovak payment systems use specific symbols for payment identification:
Payment Reference
Alternatively, you can use a payment reference instead of symbols:
Note: Payment reference and symbols (VS, KS, SS) are mutually exclusive. Setting a reference will clear any previously set symbols, and setting any symbol will clear the reference.
Bank Compatibility: Some banking applications (like mBank SK) may not display the reference field when scanning the QR code - it might be ignored or hidden in the app interface. If you want to ensure your reference information is visible to the end user, consider using the paymentNote field instead:
HTML and Data URI Output
You can get the QR code as an HTML img tag or as a data URI:
Multiple Output Formats
You can save the QR code in different formats (PNG, SVG):
Color Customization
You can customize the QR code colors:
Custom XZ Binary Path
By default, the library will search for the XZ binary in common locations (/usr/bin/xz, /usr/local/bin/xz, /opt/homebrew/bin/xz, /opt/local/bin/xz, /bin/xz). If your XZ binary is installed in a different location, you can specify the path when creating a PayBySquare instance:
Raw Data String
If you want to use your own QR code generation library, you can get the raw PAY by square data string:
Exception Handling
The library throws custom exceptions when errors occur during the encoding process. The main exception type is EncodingException, which is thrown when the encoding process fails, typically due to issues with the XZ binary.
Common error scenarios:
- XZ binary not installed or not found in any of the common locations
- XZ binary not found at the specified custom path
- Insufficient permissions to execute the XZ binary
- Invalid payment data that cannot be encoded
PAY by square Format
This library implements the PAY by square format as defined in the XSD schema. The format includes:
- Payment amount and currency
- Payment due date
- Variable, constant, and specific symbols
- Payment reference
- Payment note
- Bank account information (IBAN, BIC/SWIFT)
- Beneficiary information
License
MIT License