1

I am having issue with place order with magento 2.1.3 version. When i place order with authorized.net direct post have facing error Which from transact.dll response:

<html>
<head>
    <script>
                window.location="http://test.com/authorizenet/directpost_payment/redirect/x_invoice_num/000000142/success/0/error_msg/The transaction was declined because the response hash validation failed./controller_action_name/directpost_payment/";
            </script>
</head>
<body></body>
</html>

Also you can see directpost_payment response.

<html>
<head>
    <script>
                var require = window.top.require;
        require(
            [
                'jquery',
                'Magento_Ui/js/model/messageList',
                'mage/translate'
            ],
            function($, globalMessageList, $t) {
                var parent = window.top;
                $(parent).trigger('clearTimeout');
                globalMessageList.addErrorMessage({
                    message: $t('An error occurred on the server. Please try to place the order again.')
                });
            }
        );
            </script>
</head>
<body></body>
</html>

But when i check in admin order was placed successfully. But getting this error. can you please help me resolve the issue.

  • You can look into Magento debug.log to find a response from Authorize.net payment gateway. – joni jones Feb 10 '17 at 12:44
  • Hello, I have check in log file and i got something. you can see below error. main.DEBUG: cache_invalidate: {"method":"POST","url":"test.com/authorizenet/directpost_payment/place/…":{"tags":["catalog_product_186","FPC"],"mode":"matchingTag"},"is_exception":false} [] can you help to solve the issue. – Kartik Asodariya Feb 13 '17 at 5:10
  • You need to enable debug option for Authorize.net payment and provide transaction log details. – joni jones Feb 13 '17 at 7:24
  • I apply same this but facing same issue can you please help me solve this error – Kartik Asodariya Feb 13 '17 at 7:48
  • Can you provide transaction details from debug log? Without them, unfortunately, I can't help you. – joni jones Feb 13 '17 at 9:07
0

Now you can see transaction log which got from place order with authorized.net payment process

you can see transaction log

[2017-02-13 09:50:58] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://test.com/authorizenet/directpost_payment/place/","invalidateInfo":{"tags":["catalog_product_186","FPC"],"mode":"matchingTag"},"is_exception":false} []
[2017-02-13 09:50:58] main.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' => 'http://test.com/authorizenet/directpost_payment/response',
'x_type' => 'AUTH_ONLY',
'x_fp_sequence' => '46',
'x_invoice_num' => '000000043',
'x_amount' => 1070,
'x_currency_code' => 'USD',
'x_tax' => '0.00',
'x_freight' => '50.00',
'x_first_name' => 'ueyri',
'x_last_name' => 'ueryd',
'x_company' => 'yehdomfo',
'x_address' => '12 afriars Rd. suite #101',
'x_city' => 'san diego',
'x_state' => 'California',
'x_zip' => '92108',
'x_country' => '',
'x_phone' => '7894567894',
'x_fax' => '',
'x_cust_id' => '',
'x_customer_ip' => '27.109.11.50',
'x_customer_tax_id' => '',
'x_email' => 'perso@gmail.com',
'x_email_customer' => '0',
'x_merchant_email' => '',
'x_ship_to_first_name' => 'ueyri',
'x_ship_to_last_name' => 'ueryd',
'x_ship_to_company' => 'yehdomfo',
'x_ship_to_address' => '12 afriars Rd. suite #101',
'x_ship_to_city' => 'san diego',
'x_ship_to_state' => 'California',
'x_ship_to_zip' => '92108',
'x_ship_to_country' => '',
'x_po_num' => '',
'x_fp_timestamp' => 1486979458,
'x_fp_hash' => 'ce0e2ffa92cea2431317d2bab59d3f56',
),
) {"is_exception":false} []
[2017-02-13 09:51:00] main.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' => 'Visa',
'x_account_number' => 'XXXX1111',
'x_first_name' => 'ueyri',
'x_last_name' => 'ueryd',
'x_company' => 'yehdomfo',
'x_address' => '12 afriars Rd. suite #101',
'x_city' => 'san diego',
'x_state' => 'California',
'x_zip' => '92108',
'x_country' => '',
'x_phone' => '7894567894',
'x_fax' => '',
'x_email' => 'perso@gmail.com',
'x_invoice_num' => '000000043',
'x_description' => '',
'x_type' => 'auth_only',
'x_cust_id' => '',
'x_ship_to_first_name' => 'ueyri',
'x_ship_to_last_name' => 'ueryd',
'x_ship_to_company' => 'yehdomfo',
'x_ship_to_address' => '12 afriars Rd. suite #101',
'x_ship_to_city' => 'san diego',
'x_ship_to_state' => 'California',
'x_ship_to_zip' => '92108',
'x_ship_to_country' => '',
'x_amount' => '1070.00',
'x_tax' => '0.00',
'x_duty' => '0.00',
'x_freight' => '50.00',
'x_tax_exempt' => 'FALSE',
'x_po_num' => '',
'x_MD5_Hash' => '6CA68F12F818D6441D0F44E74E0C906F',
'x_SHA2_Hash' => 'A7085921046F765BF6A39DCEAACBE1356D84DDD18B2A31F5FB9E764AB3B89233F95275922C536E87DBBB9DA515821F01AD6517FB45B8ED370EE0DFE617EE9B6F',
'x_cvv2_resp_code' => '',
'x_cavv_response' => '',
'x_test_request' => 'true',
'controller_action_name' => 'directpost_payment',
'is_secure' => '',
),
 ) {"is_exception":false} []

so please help to how to resolve this issue.

  • If you use sandbox account - the TEST mode should be disabled ('x_test_request' => 'FALSE',), it uses only for production accounts. For Authorize.net testing you need to use an instance with public domain, Authorize.net doesn't work on the local environment. – joni jones Feb 13 '17 at 12:36
  • I am using live account and also put all detail in admin. Now set TEST mode yes and set secure.authorize.net/gateway/transact.dll URL. and site in development server not on localhost. – Kartik Asodariya Feb 13 '17 at 13:42
  • Your log should also contain details from Authorize.net transaction API https://api.authorize.net/xml/v1/request.api - can you post it (request and body should be in xml format)? – joni jones Feb 13 '17 at 15:09
  • Now i am using another magento 2.0.2. I want to test authorized.net and set API login id and transaction id, test mode "YES", gateway URL is test.authorize.net/gateway/transact.dll , transactional detail URL is null and set test mode on authorized.net. now result is transaction has been approved and order has placed successfully in admin but not redirecting on success or failure page. what can i do. – Kartik Asodariya Feb 16 '17 at 6:44

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.