QRPayment.php
public static function accountToIBAN($account, $country = 'CZ')
    {
        $allowedCountries = ['AT', 'BE', 'BG', 'CZ', 'CY', 'DK', 'EE', 'FI', 'FR', 'DE', 'GI', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'CH', 'SI', 'SK', 'ES', 'GB'];

        $account = self::normalizeAccountNumber($account);

        $accountArray = explode('/', str_replace('-', '', $account));
        if (2 !== \count($accountArray)) {
            throw new RuntimeException(Tools::poorManTranslate('fts-shared', 'Wrong bank account (some part missing).'));
        }

        $country = strtoupper($country);
        if (!\in_array($country, $allowedCountries, true)) {
            throw new RuntimeException(Tools::poorManTranslate('fts-shared', 'Invalid country code.'));
        }

        $accountStr = str_pad($accountArray[1], 4, '0', STR_PAD_LEFT) . str_pad($accountArray[0], 16, '0', STR_PAD_LEFT) . (\ord($country[0]) - 55) . (\ord($country[1]) - 55) . '00';
        $crc = '';
        $pos = 0;

        while (\strlen($accountStr) > 0) {
            $len = 9 - \strlen($crc);
            $crc = (int)($crc . substr($accountStr, $pos, $len)) % 97;
            $accountStr = substr($accountStr, $len);
        }

        return ($country . str_pad(98 - $crc, 2, '0', STR_PAD_LEFT) . $accountArray[1] . $accountArray[0]);
    }
public static function accountToIBAN($account, $country = 'CZ')
    {
        $allowedCountries = ['AT', 'BE', 'BG', 'CZ', 'CY', 'DK', 'EE', 'FI', 'FR', 'DE', 'GI', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'CH', 'SI', 'SK', 'ES', 'GB'];

        $account = self::normalizeAccountNumber($account);

        $accountArray = explode('/', str_replace('-', '', $account));
        if (2 !== \count($accountArray)) {
            throw new RuntimeException(Tools::poorManTranslate('fts-shared', 'Wrong bank account (some part missing).'));
        }

        $country = strtoupper($country);
        if (!\in_array($country, $allowedCountries, true)) {
            throw new RuntimeException(Tools::poorManTranslate('fts-shared', 'Invalid country code.'));
        }

        $accountStr = str_pad($accountArray[1], 4, '0', STR_PAD_LEFT) . str_pad($accountArray[0], 16, '0', STR_PAD_LEFT) . (\ord($country[0]) - 55) . (\ord($country[1]) - 55) . '00';
        $crc = '';
        $pos = 0;

        while (\strlen($accountStr) > 0) {
            $len = 9 - \strlen($crc);
            $crc = (int)($crc . substr($accountStr, $pos, $len)) % 97;
            $accountStr = substr($accountStr, $len);
        }

        return ($country . str_pad(98 - $crc, 2, '0', STR_PAD_LEFT) . $accountArray[1] . $accountArray[0]);
    }
Convert bank account number to IBAN

@param string $account Normal account number in format: prefix-account/bank
@param string $country ISO standard country code
@return string IBAN
@throws RuntimeException