cancel
Showing results for 
Search instead for 
Did you mean: 

MD5 Hash validation in Relay_response with php SDK

hello,

 

I'm new to AutNet and working on SIm method with PHP sdk.

when I use the TEST Account I get everything right! and I get the Relay_Response as well, no problem all Fine!

 

But, When I was trying to impelemt the LIVE section I had all the matters fine except "Error. Check your MD5 Setting". When I drilled down I found that this is a message which is there in my Relay_Response.php page. By the by, I'm using the Sample PHP Files to integrate the LIVE section.

 

Here is the relayresponse.php code -

===========================================

require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK
    $redirect_url = "https://mysite/Receipt.php"; // Where the user will end up.
    $api_login_id = 'my_login_id';
    $md5_setting = "my_md5_pass"; // Your MD5 Setting
    $response = new AuthorizeNetSIM($api_login_id, $md5_setting);
    if ($response->isAuthorizeNet())
    {
        if ($response->approved)
        {
            // Do your processing here.
            $redirect_url .= '?response_code=1&transaction_id=' .$response->transaction_id;
        }
        else
        {
            $redirect_url .= '?response_code='.$response->response_code . '&response_reason_text=' . $response->response_reason_text;
        }
        // Send the Javascript back to AuthorizeNet, which will redirect user back to your site.
        echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_url);
    }
    else
    {
    echo "Error. Check your MD5 Setting.";
    }

===========================================

 

please help me what do do...???? I'm going crazy looking for a solution!!!

 

mynul9280
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Got it! there was an extra space at the begining of the MD5 value!!! what a mess!!!!

Thanks to everyone.

View solution in original post

4 REPLIES 4

like the error said, check the MD5 setting on the merchant account. And make sure both  $api_login_id and $md5_setting is correct.

RaynorC1emen7
Expert

I have checked the $api_login_id and $md5_setting.

 

The use of $api_login_id is there in almost all the pages but the $md5_setting is being used in only the RelayResponse.php page. Does it have any other use also? Do I have to add it on any other page also?

 

Do I have to work on the anet_php_sdk/lib, AuthorizeNetSIM.php file? Or just leave it as it is. I have downloaded it from the AuthNet site.

 

I would really appriciate if I can get some Sample code from anyone who use PHP SDK.

The only other thing that I remember is that the there is a Max Length on the MD5. maybe your is too long? Other then that you could change it so it doesn't check it.

Got it! there was an extra space at the begining of the MD5 value!!! what a mess!!!!

Thanks to everyone.