cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize.net direct post response hash validation failed, incorrect characters in response data

Authorize.net direct post response hash validation failed, incorrect characters in response data

Authorize.net direct post response hash validation failed because response data contain incorrect characters for none latin

example of request and response data in log:

'request' => 
  array (
    'x_version' => '3.1',
    'x_delim_data' => 'FALSE',
    'x_relay_response' => 'TRUE',
    'x_test_request' => 'FALSE',
    'x_login' => '****',
    'x_method' => 'CC',
    'x_relay_url' => 'https://***/authorizenet/directpost_payment/response',
    'x_type' => 'AUTH_ONLY',
    'x_fp_sequence' => '***',
    'x_invoice_num' => '***',
    'x_amount' => ***,
    'x_currency_code' => 'CAD',
    'x_tax' => '***',
    'x_freight' => '0.00',
    'x_first_name' => '***',
    'x_last_name' => '***',
    'x_company' => '',
    'x_address' => '*** Bois-de-Chêne',
    'x_city' => 'Québec',
    'x_state' => 'Quebec',
    'x_zip' => 'G1W 3B1',
    'x_country' => '',
    'x_phone' => '***',
    'x_fax' => '',
    'x_cust_id' => '',
    'x_customer_ip' => '***',
    'x_customer_tax_id' => '',
    'x_email' => '***',
    'x_email_customer' => '0',
    'x_merchant_email' => '',
    'x_ship_to_first_name' => '***',
    'x_ship_to_last_name' => '***',
    'x_ship_to_company' => '',
    'x_ship_to_address' => '*** Bois-de-Chêne',
    'x_ship_to_city' => 'Québec',
    'x_ship_to_state' => 'Quebec',
    'x_ship_to_zip' => '***',
    'x_ship_to_country' => '',
    'x_po_num' => '',
    'x_fp_timestamp' => ***,
    'x_fp_hash' => '***',
  ),
) {"is_exception":false} []


  'response' => 
  array (
    'x_response_code' => '1',
    'x_response_reason_code' => '1',
    'x_response_reason_text' => 'This transaction has been approved.',
    'x_avs_code' => 'Y',
    'x_auth_code' => '***',
    'x_trans_id' => '***',
    'x_method' => 'CC',
    'x_card_type' => '***',
    'x_account_number' => '***',
    'x_first_name' => '***',
    'x_last_name' => '***',
    'x_company' => '',
    'x_address' => '*** Bois-de-Ch�ne',
    'x_city' => 'Qu�bec',
    'x_state' => 'Quebec',
    'x_zip' => '***',
    'x_country' => '',
    'x_phone' => '***',
    'x_fax' => '',
    'x_email' => '***',
    'x_invoice_num' => '***',
    'x_description' => '',
    'x_type' => 'auth_only',
    'x_cust_id' => '',
    'x_ship_to_first_name' => '***',
    'x_ship_to_last_name' => '***',
    'x_ship_to_company' => '',
    'x_ship_to_address' => '***Bois-de-Ch�ne',
    'x_ship_to_city' => 'Qu�bec',
    'x_ship_to_state' => 'Quebec',
    'x_ship_to_zip' => '***',
    'x_ship_to_country' => '',
    'x_amount' => '***4',
    'x_tax' => '***',
    'x_duty' => '0.00',
    'x_freight' => '0.00',
    'x_tax_exempt' => 'FALSE',
    'x_po_num' => '',
    'x_MD5_Hash' => '',
    'x_SHA2_Hash' => '***',
    'x_cvv2_resp_code' => 'M',
    'x_cavv_response' => '',
    'x_test_request' => 'false',
    'controller_action_name' => 'directpost_payment',
    'is_secure' => '1',
  ),

For some reason API response contain incorrect data

'x_address' => '*** Bois-de-Ch�ne',

'x_city' => 'Qu�bec',

 

Look like issue on authorize side.

Magento 2.1.7 with patch https://support.magento.com/hc/en-us/articles/360024368392-Update-Authorize-Net-Direct-Post-from-MD5...

for versions 2.0.X and 2.1.X

1 REPLY 1

Re: Authorize.net direct post response hash validation failed, incorrect characters in response data

Hello @alex_zakatov 

Yes some characters are not accepted by authorize.net and hence it throws the error while placing an order.

You will need to clear that out programmatically before processing the order.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now