Finalizes and prepares fields for sending

@param string $hashName Name of the field containing HMAC HASH code

@return boolean
431554
protected function prepareFields($hashName = '')
    {
        if (!is_string($hashName)) {
            $this->errorMessage[] = 'PREPARE: Hash name is not string!';
            return false;
        }
        $this->setHashData();
        $this->setFormData();
        if ($this->hashData) {
            $this->formData[$hashName] = $this->createHashString($this->hashData);
        }
        $this->checkRequired();
        if (count($this->missing) == 0) {
            return true;
        }
        $this->debugMessage[] = 'PREPARE: Missing required fields';
        $this->errorMessage[] = 'PREPARE: Missing required fields';
        return false;
    }
514670
public function prepareFieldName($fieldName)
    {
        list($fieldName) = $this->prepareQueryElement($fieldName, null, null, false);

        return $fieldName;
    }
144819
protected static function fieldExists($sFieldName, $sTableName)
    {
        $oDbMetaDataHandler = oxNew(DbMetaDataHandler::class );

        return $oDbMetaDataHandler->fieldExists($sFieldName, $sTableName);
    }
203322
private function generateInitialHash()
    {
        $mergedString = $this->isLive . $this->transaction['orderId'] . $this->transaction['invoiceNumber'] .
            $this->transaction['amount'] . $this->customer['telephoneNumber'] . $this->customer['email'] .
            $this->vendorId . $this->currency . $this->payloads['payload1'] . $this->payloads['payload2'] .
            $this->payloads['payload3'] . $this->payloads['payload4'] . $this->callback .
            $this->customer['sendEmail'] . $this->callbackMode;

        return hash_hmac('sha1', $mergedString, $this->hashKey);
    }
929228
public function hasHeader(string $headerName): bool
	{

		if (array_key_exists($headerName, $this->getHeaders())) {
			return true;
		}
		return false;
	}
485608
public function hasHeader($key)
    {
        foreach ($this->responseHeaders as $k => $v) {
            if (\strtoupper($key) === \strtoupper($k)) {
                return true;
            }
        }

        return false;
    }
342149
public function hDel($hashKey, $key = null)
    {
        if ($key) {
            return $this->redis->hDel($hashKey, $key);
        }

        return $this->redis->hDel($hashKey);
    }
220121
protected function createHashString($hashData = array())
    {
        if (count($hashData) == 0) {
            $this->errorMessage[] = 'HASH_DATA: hashData is empty, so we can not generate hash string ';
            return false;
        }

        $hashString = '';
        $cunter = 1;
        foreach ($hashData as $field) {
            if (is_array($field)) {
                $this->errorMessage[] = 'HASH_ARRAY: No multi-dimension array allowed!';
                return false;
            }
            $hashString .= strlen(StripSlashes($field)).$field;
            if ($this->commMethod != 'alu') {
                $this->debugMessage[] = 'HASH_VALUE_' . $cunter .'('.strlen($field).'): '. $field;
            }
            $cunter++;
        }

        $this->hashString = $hashString;
        if ($this->commMethod != 'alu') {
            $this->debugMessage[] = 'HASH string: ' . $this->hashString;
        }
        $this->hashCode = $this->hmac($this->secretKey, $this->hashString);
        return $this->hashCode;
    }
1065108
public function hasHeader(string $key = null) : bool
	{
		if ($key === null) {
			return false;
		}

		$array = $this->getHeaders();
		return isset($array[$key]) || array_key_exists($key, $array);
	}
967676
private function ValidateHashKey()
        {
            $Name = 'HashKey'; // 參數名稱
            $Value = $this->HashKey; // 參數內容
            $AllowEmpty = false; // 是否允許空值

            if (empty($Value)) {
                // 是否允許空值
                $this->IsAllowEmpty($Name, $AllowEmpty);
            }
        }
162398
public function hsetnx($hash, $key, $value)
    {
        return (int) $this->client->hsetnx($hash, $key, $value);
    }
476172
protected function _hashKey( $key )
    {
        if ( null !== $this->_keyHashCallback && is_callable( $this->_keyHashCallback ) )
        {
            $_arguments = func_get_args();

            return call_user_func_array( $this->_keyHashCallback, $_arguments );
        }

        return $key;
    }
65935
public function generateHmac($string)
    {
        if (!is_string($string)) {
            throw new InvalidArgumentForHashGenerationException('A hash can only be generated for a string, but "' . gettype($string) . '" was given.', 1255069587);
        }

        return hash_hmac('sha1', $string, $this->getEncryptionKey());
    }
548542
public function loadMerchantPrivateKey($filename) {
		$cert = @file_get_contents($filename);
		if($cert === FALSE) {
			return FALSE;
		}
		return $this->useMerchantPrivateKey($cert);
	}
1294379
public function isSingleValuedEmbed(string $fieldName) : bool
    {
        return isset($this->fieldMappings[$fieldName]['association']) &&
            $this->fieldMappings[$fieldName]['association'] === self::EMBED_ONE;
    }
1201688
public function buildHash(): string
    {
        $hash = Crypt::hash(serialize($this), true);
        $this->lastBuildedHash = $hash;
        return $hash;
    }
547644
public function isValidHash() : Bool
    {
        $hash   = $_POST['HASHPARAMS'];
        $hashEx = explode(':', $hash);
        $real   = NULL;

        foreach( $hashEx as $part )
        {
            if( ! empty($_POST[$part]) )
            {
                $real .= $_POST[$part];
            }
        }

        return $real === $_POST['HASHPARAMSVAL'] && $_POST['HASH'] === base64_encode(pack('H*',sha1($real . $_POST['storeKey'])));
    }