As defined in app/code/core/Mage/Authorizenet/Model/Directpost.php, this exception is thrown if any portion of the below evaluates as false:
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.')
);
}
So, it's one of three things:
The method isValidHash
returns false because there is an issue with either the generated hash (e.g. your API Login/Key are wrong, generate a new one and re-enter) or the amount of the transaction somehow differs between Authorize and your system.
The latter is less likely, but because generateHash
in Mage_Authorizenet_Model_Directpost_Response
uses the transaction amount as part of the hash, it's a potential factor here.
As you said, this is not an Authorize.net-specific issue. I believe your error is occurring from Mage_Checkout_OnepageController::saveOrderAction()
, where a generic Exception
is thrown. You can inspect the method for the error message.
This could be due to many things, so it will require you to debug it. Check at each step within this method what kind of values are being passed around. My guess is for a common cause is that, if all of your settings are correct, you have customization that checks the payment data and throwing an exception.
You can take a look at from Mage_Sales_Model_Quote_Payment::importData()
, or whatever class is overriding this class and method, if any, for example, to debug the issue.
Update:
Upon examining your exception log, you'll see an entry of saveOrderAction()
as I mentioned, and now I'm certain that's what's causing your order error. There's also a constraint violation error in there, but I'm going to assume you just copied and pasted your logs. On line 213 in the link, it says
2014-11-12T03:24:44+00:00 ERR (3): exception 'Mage_Core_Exception' with message 'Gateway error: (TESTMODE) The merchant login ID or password is invalid or the account is inactive.' in /home2/david/public_html/store/app/Mage.php:595
There you go; your Authorize.net credential is the problem. Two things I would check first.
Check that "test mode" is off if you're on a sandbox Authorize.net account.
Use https://test.authorize.net/gateway/transact.dll instead of whatever Magento proides if you're using a sandbox account.
More info: https://support.authorize.net/authkb/index?page=content&id=A415&pmv=print&impressions=false
Note:
Others have mentioned different errors as well. You should look into those. They will make great debugging practice!
Best Answer
I finally found a solution after struggling for a good long time.
Solution (At least for me)
Login to your merchant account on authorize.net
Click 'Account' Tab along top
Under 'Security Settings' Section
Under 'General Security Settings'
Click 'Transaction Details API' link
Follow instructions to Enable it, it is disabled by default.
Go Back to Magento Admin
Get payment update should now work.