PHP code example of sunfoxcz / spayd-php
1. Go to this page and download the library: Download sunfoxcz/spayd-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sunfoxcz / spayd-php example snippets
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;