SPAYD messages for QR code payments generation.
Code is forked from Shoptet/spayd-php repository just for Packagist package generation.
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;