sunfoxcz/spayd-php

SPAYD messages for QR code payments generation.

v2.0.0 2022-10-09 02:55 UTC

This package is auto-updated.

Last update: 2024-10-19 00:00:39 UTC


README

SPAYD messages for QR code payments generation.

Original author

Code is forked from Shoptet/spayd-php repository just for Packagist package generation.

Example

use Sunfox\Spayd\Spayd;
use Sunfox\Spayd\Model\CzechAccount;
use Sunfox\Spayd\Utilities\IbanUtilities;

$spayd = new Spayd;
$spayd->add('AM', $actuarial->price);
$spayd->add('CC', $actuarial->currency);
$spayd->add('X-VS', $actuarial->variableSymbol);

if ($actuarial->supplier->iban) {
	$spayd->add('ACC', "{$actuarial->supplier->iban}+{$actuarial->supplier->swift}");
} else {
	$account = new CzechAccount("{$actuarial->supplier->accountNumber}/{$actuarial->supplier->bankCode}");
	$spayd->add('ACC', IbanUtilities::computeIbanFromBankAccount($account));
}

echo (string) $spayd;