Magento2: Authorize.net Direct Post does not send x_country or x_ship_to_country

Created on 30 May 2017  路  6Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.6 CE

Steps to reproduce

  1. Setup a sandbox account with authorize.net
  2. Configure in sandbox.authorize.net under "Account > Payment Form > Form Fields" check View, Edit and Required for Country
  3. Also in sandbox.authorize.net under "Account > Virtual Terminal" check the checkbox for "Country" under "Customer Billing Information" and under "Shipping Information"
  4. Configure Authorize.net Direct Post in Magento 2 with these credentials
  5. Try to place an order using test credit card data

Expected result

  1. Transaction should succeed

Actual result

  1. Transaction fails. Here's part of the response from https://test.authorize.net/gateway/transact.dll:
    window.location="https://mywebsite.tld/authorizenet/directpost_payment/redirect/x_invoice_num/000000007/success/0/error_msg/Gateway error: Bill To Country is required./controller_action_name/directpost_payment/is_secure/1/";

Here is the output from debug.log:
[2017-05-30 18:57:54] main.DEBUG: array ( 'response' => array ( 'x_response_code' => '3', 'x_response_reason_code' => '33', 'x_response_reason_text' => 'Bill To Country is required.', 'x_avs_code' => 'P', 'x_auth_code' => '', 'x_trans_id' => '0', 'x_method' => 'CC', 'x_card_type' => 'MasterCard', 'x_account_number' => 'XXXX0015', 'x_first_name' => 'User', 'x_last_name' => 'Lname', 'x_company' => '', 'x_address' => '1234 Sesame St', 'x_city' => 'Houston', 'x_state' => 'Texas', 'x_zip' => '77013', 'x_country' => '', 'x_phone' => '1234567890', 'x_fax' => '', 'x_email' => '[email protected]', 'x_invoice_num' => '000000006', 'x_description' => '', 'x_type' => 'auth_capture', 'x_cust_id' => '', 'x_ship_to_first_name' => 'User', 'x_ship_to_last_name' => 'Lname', 'x_ship_to_company' => '', 'x_ship_to_address' => '1234 Sesame St', 'x_ship_to_city' => 'Houston', 'x_ship_to_state' => 'Texas', 'x_ship_to_zip' => '77013', 'x_ship_to_country' => '', 'x_amount' => '46.50', 'x_tax' => '0.00', 'x_duty' => '0.00', 'x_freight' => '7.50', 'x_tax_exempt' => 'FALSE', 'x_po_num' => '', 'x_MD5_Hash' => '706C267F8CA31058A740E0FC4BBCCB93', 'x_SHA2_Hash' => '', 'x_cvv2_resp_code' => '', 'x_cavv_response' => '', 'x_test_request' => 'false', 'controller_action_name' => 'directpost_payment', 'is_secure' => '1', ), )

Note that both x_ship_to_country and x_country are blank even though this information is collected during the payment step of the checkout process:

image

Payment Confirmed Format is valid Ready for Work 2.1 Reproduced on 2.1.x bug report

Most helpful comment

You can look changes in this commit https://github.com/magento/magento2/commit/18da140df446c7c4795dd09d2952c0767303a634#diff-343460dc20572bca6aec307d1c41f717.

All 6 comments

Hi, @charmeleon, this issue already fixed on the develop branch.
Unfortunately, I can't provide any estimation time when it will be available in 2.1.x. The internal ticket is MAGETWO-66526.

@joni-jones Thanks for the follow up, but I do need this functional by Monday at the latest. Is there somewhere that I could peek at the code for the PR to see what I can jerry-rig to have this functional by then?

You can look changes in this commit https://github.com/magento/magento2/commit/18da140df446c7c4795dd09d2952c0767303a634#diff-343460dc20572bca6aec307d1c41f717.

@charmeleon, thank you for your report.
We've created internal ticket(s) MAGETWO-66526 to track progress on the issue.

@magento-engcom-team Any updates on this ticket?

Fixed in 2.1.11 release.

Was this page helpful?
0 / 5 - 0 ratings