I've set up authorize.net direct post in test mode on my staging server.
Trying to make a purchase I get an error. In the exception log I get :
[2018-08-23 15:07:36] report.CRITICAL: The transaction was declined because the response hash validation failed. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The transaction was declined because the response hash validation failed. at /var/www/html/magento2/vendor/magento/module-authorizenet/Model/Directpost.php:539)"} [] [2018-08-23 15:07:36] report.CRITICAL: The transaction was declined because the response hash validation failed. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The transaction was declined because the response hash validation failed. at /var/www/html/magento2/vendor/magento/module-authorizenet/Model/Directpost.php:539)"} []
But in my payment.log I receive (trimmed for personal information)
[2018-08-23 15:07:35] report.DEBUG: array ( 'request' => array ( 'x_version' => '3.1', 'x_delim_data' => 'FALSE', 'x_relay_response' => 'TRUE', 'x_test_request' => 'TRUE', 'x_login' => '****', 'x_method' => 'CC', 'x_relay_url' => 'https://MY SITE URL/authorizenet/directpost_payment/response', 'x_type' => 'AUTH_ONLY', 'x_fp_sequence' => '30', 'x_invoice_num' => '000000024', 'x_amount' => 110.14, 'x_currency_code' => 'USD', 'x_tax' => '5.46', 'x_freight' => '9.73', 'x_fax' => '', 'x_cust_id' => '', 'x_email_customer' => '1', 'x_merchant_email' => '', 'x_po_num' => '', 'x_fp_timestamp' => 1535036855, 'x_fp_hash' => 'd01addffc614bfc76a9595c352f4838b', ), ) [] [] [2018-08-23 15:07:36] report.DEBUG: array ( 'response' => array ( 'x_response_code' => '1', 'x_response_reason_code' => '1', 'x_response_reason_text' => '(TESTMODE) This transaction has been approved.', 'x_avs_code' => 'P', 'x_auth_code' => '000000', 'x_trans_id' => '0', 'x_method' => 'CC', 'x_card_type' => 'MasterCard', 'x_account_number' => 'XXXX0015', 'x_company' => '', 'x_fax' => '', 'x_invoice_num' => '000000024', 'x_description' => '', 'x_type' => 'auth_only', 'x_cust_id' => '', 'x_amount' => '110.14', 'x_tax' => '5.46', 'x_duty' => '0.00', 'x_freight' => '9.73', 'x_tax_exempt' => 'FALSE', 'x_po_num' => '', 'x_MD5_Hash' => 'D4F06F5EDDAB6F3C7939D041831F9232', 'x_SHA2_Hash' => '', 'x_cvv2_resp_code' => '', 'x_cavv_response' => '', 'x_test_request' => 'true', 'controller_action_name' => 'directpost_payment', 'is_secure' => '1', ), ) [] []
Does anyone know why this is occurring?
Additional info - I updated the MD5 hash on both Magento and authorize.net. I've updated the
configuration to what is in the following image :
After doing this I'm now getting the following error. I get this error regardless of my test mode setting being yes or no (saw to try that on another forum). Any help would be appreciated :
[2018-08-23 17:01:57] report.CRITICAL: Please enter a transaction ID to authorize this payment. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Please enter a transaction ID to authorize this payment. at /var/www/html/magento2/vendor/magento/module-authorizenet/Model/Directpost.php:654)"} [] [2018-08-23 17:01:57] report.CRITICAL: Please enter a transaction ID to authorize this payment. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Please enter a transaction ID to authorize this payment. at /var/www/html/magento2/vendor/magento/module-authorizenet/Model/Directpost.php:654)"} []
im getting exactly the same issue, were u able to solve it??
Hash should only be a maximum of 10 characters!
Updated the hash on both Auth.net and Magento to be only 10 characters, Authorize.net supports up to 20 characters for the MD5 hash but you have to set up to 10 characters to have it fixed.