public function calculateHash()
    {
        // this is the documentation way
        $raw = file_get_contents('php://input');
        $fields = substr($raw, 0, strpos($raw, '&key='));
        $secret = $this->request->getSecret();
        $supposed_hash = md5($fields . $secret);

        // this is how they actually get it
        $kvs = '';
        foreach ($this->data as $k => $v) {
            if ($k !== 'key' && $k !== 'username') {
                $kvs .= ($kvs ? '&' : '') . "$k=$v";
            }
        }
        $hash = md5($kvs);

        /* Testing facility
        dlog([
            'key'    => $this->getHash(),
            'fields' => $fields,
            'kvs'    => $kvs,
            'secret' => $secret,
            'hash'   => $hash,
            'h2'     => md5($fields),
            'h3'     => md5($fields . $secret),
            'kh3'    => md5($kvs),
            'kh4'    => md5($kvs . $secret),
        ]); */

        /// tmp fix
        return $this->getHash();
        //return $hash;
    }
public function calculateHash()
    {
        // this is the documentation way
        $raw = file_get_contents('php://input');
        $fields = substr($raw, 0, strpos($raw, '&key='));
        $secret = $this->request->getSecret();
        $supposed_hash = md5($fields . $secret);

        // this is how they actually get it
        $kvs = '';
        foreach ($this->data as $k => $v) {
            if ($k !== 'key' && $k !== 'username') {
                $kvs .= ($kvs ? '&' : '') . "$k=$v";
            }
        }
        $hash = md5($kvs);

        /* Testing facility
        dlog([
            'key'    => $this->getHash(),
            'fields' => $fields,
            'kvs'    => $kvs,
            'secret' => $secret,
            'hash'   => $hash,
            'h2'     => md5($fields),
            'h3'     => md5($fields . $secret),
            'kh3'    => md5($kvs),
            'kh4'    => md5($kvs . $secret),
        ]); */

        /// tmp fix
        return $this->getHash();
        //return $hash;
    }
public function calculateHash ( ) { // this is the documentation way $ raw = file_get_contents ( 'php://input' ) ; $ fields = substr ( $ raw , 0 , strpos ( $ raw , '&key=' ) ) ; $ secret = $ this -> request -> getSecret ( ) ; $ supposed_hash = md5 ( $ fields . $ secret ) ; // this is how they actually get it $ kvs = '' ; foreach ( $ this -> data as $ k => $ v ) { if ( $ k !== 'key' && $ k !== 'username' ) { $ kvs .= ( $ kvs ? '&' : '' ) . "$k=$v" ; } } $ hash = md5 ( $ kvs ) ; /* Testing facility
        dlog([
            'key'    => $this->getHash(),
            'fields' => $fields,
            'kvs'    => $kvs,
            'secret' => $secret,
            'hash'   => $hash,
            'h2'     => md5($fields),
            'h3'     => md5($fields . $secret),
            'kh3'    => md5($kvs),
            'kh4'    => md5($kvs . $secret),
        ]); */ /// tmp fix return $ this -> getHash ( ) ; //return $hash; }
Calculate hash to validate incoming IPN notifications.

@return string
Calculate hash to validate incoming IPN notifications .