private function hashPosData($parameters)
    {
        $hashedPosData         = array('posData' => $parameters['posData']);
        $hashedPosData['hash'] = $this->generateHash(serialize($parameters['posData']));

        $parameters['posData'] = json_encode($hashedPosData);

        if (strlen($parameters['posData']) > self::POS_DATA_MAX_LENGTH) {
            throw new PosDataLengthException(
                'posData cannot exceed '. self::POS_DATA_MAX_LENGTH . ' characters (including hash)'
            );
        }

        return $parameters;
    }