private function toSha256($fields, $secret)
    {
        $hasData = '';

        foreach ($this->getHashKeys() as $key) {
            if (isset($fields[$key])) {
                $hasData .= $fields[$key];
            }
        }
        $hasData .= $secret;
        return hash('sha256', trim($hasData));
    }