cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

MD5 AuthorizeNetSIM.GenerateHash does not match $response->MD%_Hash

$api_login_id = AUTHORIZENET_API_LOGIN_ID;                                         <-- Authorize.net supplied login
$md5_setting = AUTHORIZENET_MD5_SETTING;                                        <-- Value I set in SandBox   Account>MD5-Hash


$response = new AuthorizeNetSIM($api_login_id, $md5_setting);                          <-- Create the response

 


$log->LogDebug("RESPONSE.PHP MD5_Hash=".$response->MD5_Hash);                 <-- Response MD5_Hash
$log->LogDebug("RESPONSE.PHP generateHash=". $response->generateHash());  <--Generated MD5_Hash

 

================log======================================================================
RESPONSE.PHP MD5_Hash=9E6FC24E4880D966623FB51901AF4587                            <-- Response MD5_Hash
RESPONSE.PHP generateHash=0DE5637226CB8FDFE396E27983F83A9D                     <--Generated MD5_Hash

 

What am I missing?   

lsnelsen1
Member
1 ACCEPTED SOLUTION

Accepted Solutions

That was it!!!!    

 

I changes

AuthorizeNewSIM.php

function generateHash()

               $amount = ($this->amount ? $this->amount : "0.00");                   //   Added this line

                return strtoupper(md5($this->md5_setting . $this->api_login_id . $this->transaction_id . $amount));

}

 

Maybe I deleted the line early in the process.   However it works.

I could never have found this without you.

Thanks.

View solution in original post

5 REPLIES 5

$api_login_id = AUTHORIZENET_API_LOGIN_ID;      <-- Authorize.net supplied login
$md5_setting = AUTHORIZENET_MD5_SETTING;     <-- Value in SandBox   Account>MD5-Hash

                                                                                                       Verified.  and No Spaces.


$response = new AuthorizeNetSIM($api_login_id, $md5_setting);        <-- Create the response

                  


$log("MD5_Hash=".$response->MD5_Hash);                 <-- Response MD5_Hash
$log(" generateHash=". $response->generateHash());  <--Generated MD5_Hash

 

================log===================================================
MD5_Hash=9E6FC24E4880D966623FB51901AF4587              <-- Response MD5_Hash
generateHash=0DE5637226CB8FDFE396E27983F83A9D       <--Generated MD5_Hash

 

What am I missing?   

lsnelsen1
Member

The only thing I remember is that the MD5 setting on your account can be too large. And it will get truncate when authorize.net is generating the response->MD5_Hash

Thanks mine is 12 characters.

 

The MD5 that is sent in the original post is fine.  No errors.

 

I just can not get the generatehash function to provide the same value returned by AuthenicateSIM.

 

Any ideas how I can debug or test? 

 

I have copy N pasted my ID and MD5 setting from SandBox Account.     What else can I do.

The ResponseCode 99 Tool   is not appropriate.    I think it is for the sending to Authenticate Hash.

Thanks for your response  :-)

public function generateHash()
{
        $amount = ($this->amount ? $this->amount : "0.00");
        return strtoupper(md5($this->md5_setting . $this->api_login_id . $this->transaction_id . $amount));
}

 That the source, see if the transaction id and amount look ok.

 

That was it!!!!    

 

I changes

AuthorizeNewSIM.php

function generateHash()

               $amount = ($this->amount ? $this->amount : "0.00");                   //   Added this line

                return strtoupper(md5($this->md5_setting . $this->api_login_id . $this->transaction_id . $amount));

}

 

Maybe I deleted the line early in the process.   However it works.

I could never have found this without you.

Thanks.