public function createHash($data)
    {
        $fingerprint = implode(
            '^',
            array(
                $this->getApiLoginId(),
                $data['x_fp_sequence'],
                $data['x_fp_timestamp'],
                $data['x_amount']
            )
        ) . '^';

        // If x_currency_code is specified, then it must follow the final trailing carat.

        if ($this->getCurrency()) {
            $fingerprint .= $this->getCurrency();
        }

        // The md5 hash against the transactionKey is being removed 2019 and
        // replaced with an SHA-512 hash against the signatureKey.

        if ($signatureKey = $this->getSignatureKey()) {
            return hash_hmac('sha512', $fingerprint, hex2bin($signatureKey));
        } else {
            return hash_hmac('md5', $fingerprint, $this->getTransactionKey());
        }
    }