1

I have a Magento 1.9 CE installation that was recently upgraded from 1.7. Authorize.net direct post worked in 1.7, but now it does not work. When I try to checkout, I get the standard message about "Response hash validation failed. Transaction declined."

I made a new hash key and entered it in both Magento and authorize.net. I then cleared the Magento cache. I still get this error though. I rebooted the server. I tried a different browser. Any thing I am missing?

  • One difference between 1.7 and 1.9 was the inclusion of a tax rule. I noticed over on this thread (magento.stackexchange.com/questions/4001/…) towards the end, person mentions that if submitted value is different, it can throw this error. I have been noticing with the tax rule, before a user logs in, or an address is selected, tax is calculated and shows up in the subtotal. So I deleted my tax rule, but it did not seem to have any impact. – MLindsay Jul 22 '14 at 23:39
1

This error occurs in the function Mage_Authorizenet_Model_Directpost::validateResponse. What this code does is checks for a trans_md5 and login set in the config and then validates them against the response.

public function validateResponse()
{
    $response = $this->getResponse();
    //md5 check
    if (!$this->getConfigData('trans_md5') || !$this->getConfigData('login') ||
        !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login'))
    ) {
        Mage::throwException(
            Mage::helper('authorizenet')->__('Response hash validation failed. Transaction declined.')
        );
    }
    return true;
}

What I would suggest is to step through this function and see what data causes the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.