magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

Authorize.net Direct Post does not send x_country or x_ship_to_country #9802

Closed charmeleon-zz closed 6 years ago

charmeleon-zz commented 7 years ago

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:

  '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' => 'dummy@data.com',
    '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

joni-jones commented 7 years ago

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.

charmeleon-zz commented 7 years ago

@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?

joni-jones commented 7 years ago

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

magento-engcom-team commented 6 years ago

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

Ctucker9233 commented 6 years ago

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

joni-jones commented 6 years ago

Fixed in 2.1.11 release.