I've configured Authorize.net Direct Post as a payment method in Magento 2.1. This is a fairly restrictive account that requires a lot of fields and requests are failing because some data is not being sent to authorize.net.
In particular, it looks like x_country
and x_ship_to_country
are never sent. How can I configure the payments module to collect and send this information? I know it's captured in the checkout module.
This is 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/";
And here's the debug log for one transaction, note that x_country
and x_ship_to_country
are blank:
[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',
),
)