& how to debug it

As you may already know, is very useful and popular payment method with Magento. That is why we decided to write an article on this topic, where we share our own knowledges and experience on how to deal with this system. is a Payment Gateway service which acts as a middleware between merchant’s account bank and customer credit card issuer bank. In this case, check please the following scheme to see its working way:

Generally speaking, a payment process with consists of such steps as:

1. The customer submits his credit card for payment.
2. Transaction is passed to the processor.
3. Processor submits the transaction to the credit card network, and the transaction is routed to the bank that issued the credit card.
4. The issuing bank approves or declines the transaction based on the customer’s available funds and passes the transaction results back to the credit card network. Then, the transaction results relayed to the merchant bank’s processor.
5. When the transaction results are saved, then replies to the website.
6. The last step is when the merchant delivers goods or services to the buyer.

Now we know how this payment method works. However, if we will face with some issues we should also know the right way on how to debug it. The second part of this article will describe useful tips for this challenge. In this case, at first, let’s create a sandbox account.

Just fill “API Login ID” and “Transaction Key” with provided data.

Then, go to System > Configuration > Payment methods >
Note that ‘Simon’ is a default secret question answer for sandbox transaction key reset.
The next step is to change Gateway URL to

Furthermore, for the production purposes the value of CGI_URL_TD constant in app/code/core/Mage/Paygate/Model/Authorizenet.php should be changed from ‘‘ to ‘‘.

As a result, the debug option will dump transaction data to the log file.

Also, there will be a need to create a test order. By default, simply passes all orders. In this case, you need to set filters in Fraud Detection Suite.

We can admit that the most significant filters are:

– CCV/CCV2 – Card Code Verification.
– AVS – Address Verification Service.
– Daily Velocity Filter.
In addition, for $9.99 offers AFDS – Advanced Fraud Detection Suite.

Continuing our theme, after submitting an order if the action for triggered filter is Authorize and Review – it will be held for review.

They must then be either approved or voided within 30 days of the submit date. If no action is being taken in the 30-day period, the transactions will expire.


And the orders in the review/suspected fraud status have Get Payment Update button.

It is useful that by pressing Get Payment Update in Magento you can receive an order status.

Also, it is necessary to turn on Transaction Details API in sandbox account. Then, if you approve order – its status will be changed.

In var/log/payment_authorizenet.log will appear the following data:

2013-12-26T12:22:42+00:00 DEBUG (7): Array
   [request] => Array
           [x_version] => 3.1
           [x_delim_data] => True
           [x_relay_response] => False
           [x_test_request] => FALSE
           [x_login] => ****
           [x_tran_key] => ****
           [x_type] => AUTH_ONLY
           [x_method] => CC
           [x_invoice_num] => 100000005
           [x_amount] => 94.99
           [x_currency_code] => USD
           [x_allow_partial_auth] => False
           [x_first_name] => ersdtuyio
           [x_last_name] => weasrdtyu
           [x_company] =>
           [x_address] => resdtfuy
           [x_city] => esrtdyf
           [x_state] => Alaska
           [x_zip] => 45678
           [x_country] => US
           [x_phone] => 3456789
           [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] => ersdtuyio
           [x_ship_to_last_name] => weasrdtyu
           [x_ship_to_company] =>
           [x_ship_to_address] => resdtfuy
           [x_ship_to_city] => esrtdyf
           [x_ship_to_state] => Alaska
           [x_ship_to_zip] => 45678
           [x_ship_to_country] => US
           [x_po_num] =>
           [x_tax] => 0
           [x_freight] => 5
           [x_card_num] => ****
           [x_exp_date] => ****
           [x_card_code] => ****
   [result] => Array
           [response_code] => 4
           [response_subcode] => 1
           [response_reason_code] => 253
           [response_reason_text] => Your order has been received. Thank you for your business!
           [approval_code] => 2HJXUQ
           [avs_result_code] => Y
           [transaction_id] => 2203923253
           [invoice_number] => 100000005
           [description] =>
           [amount] => 94.99
           [method] => CC
           [transaction_type] =>
           [customer_id] =>
           [md5_hash] => 5AE4A08E0A05BDE5311DDE0A2493BA10
           [card_code_response_code] =>
           [c_av_vresponse_code] => 2
           [split_tender_id] =>
           [acc_number] => XXXX1111
           [card_type] => Visa
           [requested_amount] =>
           [balance_on_card] =>
   [__pid] => 709

and for payment update:

2013-12-26T12:30:35+00:00 DEBUG (7): Array
[request] => <? xml version =”1.0″ encoding =”utf - 8″?>
    <getTransactionDetailsRequest xmlns=”AnetApi/xml/v1/schema/AnetApiSchema.xsd”>
    [result] => <U+FEFF><? xml version = ”1.0″ encoding = ”utf-8″ ?>
<getTransactionDetailsResponse xmlns:xsi=””
                <name>Enhanced AVS Handling Filter</name>
                <name>Hourly Velocity Filter</name>
                <name>Transaction IP Velocity Filter</name>
[__pid] => 753

You are welcome to leave your feedback if anyone has any different experience or solution of this topic.