cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain transaction details after empty response from authorize.net server?

Hello, we use Magento (shopping cart), magento uses standard module for Authorize.cim. (I think this AIM method)

We have next problem:

 

In some situations we can't retrieve transaction details ("approval_code", "acc_number",  "transaction_id|) to create our invoice object:

  1. - we received empty response due to problems with our server
  2. - we received: Authorize.net fault. - "gateway error: an error occured during processing. Please try again." Response Reason Code: 261.

Example in magento payment log files for empty respose (some values replaced with fictitious data) :

 

(
[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] => PRIOR_AUTH_CAPTURE
[x_method] => CC
[x_invoice_num] => 0000002
[x_amount] => 29.00
[x_currency_code] => USD
[x_trans_id] => 1234567890
[x_first_name] => Test
[x_last_name] => Test
[x_company] => SomeCompanyName
[x_address] => 123 Street
[x_city] => Some City
[x_state] => Some state
[x_zip] => 123456
[x_country] => US
[x_phone] => 1234567891
[x_fax] =>
[x_cust_id] => 12345
[x_customer_ip] =>
[x_customer_tax_id] =>
[x_email] => email@email.com
[x_email_customer] => 0
[x_merchant_email] =>
[x_po_num] =>
[x_tax] => 0.0000
[x_freight] => 0.0000
)

[result] => Array
(
[response_code] => -1
[response_reason_code] => 0
[response_reason_text] => Unable to read response, or response is empty
)

)

 

Then we doing next attemtp (the same request for this order).

 

It return:

 

[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] => PRIOR_AUTH_CAPTURE
[x_method] => CC
[x_invoice_num] => 0000002
[x_amount] => 29.00
[x_currency_code] => USD
[x_trans_id] => 1234567890
[x_first_name] => Test
[x_last_name] => Test
[x_company] => SomeCompanyName
[x_address] => 123 Street
[x_city] => Some City
[x_state] => Some state
[x_zip] => 123456
[x_country] => US
[x_phone] => 1234567891
[x_fax] =>
[x_cust_id] => 12345
[x_customer_ip] =>
[x_customer_tax_id] =>
[x_email] => email@email.com
[x_email_customer] => 0
[x_merchant_email] =>
[x_po_num] =>
[x_tax] => 0.0000
[x_freight] => 0.0000
)

[result] => Array
(
[response_code] => 1
[response_subcode] => 1
[response_reason_code] => 311
[response_reason_text] => This transaction has already been captured.
[approval_code] =>
[avs_result_code] => P
[transaction_id] => 0
[invoice_number] => 0000002
[description] =>
[amount] => 29.00
[method] => CC
[transaction_type] => prior_auth_capture
[customer_id] => 32975
[md5_hash] => N6216A7FGE273F8DB8GGHF8B640D809J
[card_code_response_code] =>
[c_av_vresponse_code] =>
[split_tender_id] =>
[acc_number] =>
[card_type] => Visa
[requested_amount] =>
[balance_on_card] =>
)

 

And we can see that here we haven't some important fields without which we can not create an invoice object:

acc_number, transaction_id, approval_code. What I should to do to receive this information. May be there are some additional request for this purpose?

 

amitchell
Contributor
19 REPLIES 19

yeah it look like acc_number is just the masked cc#.

<cardNumber>XXXX0027</cardNumber>

Yes, I found. Now I believe I can build solution for creating invoice after empty response (due to my server problem) using transaction details API. Thank you very much.

 

And the last questions:

 

How I can simulate for example this authroize.net error: 261

 

Response Reason Code: 261

Response Reason Text: An error occured during processing. Please try again.

 

One day I received this error from authorize.net but money was successfully captured. So I think I will also use TD API for this situation. But how I can simulate this error. In this manual http://developer.authorize.net/tools/errorgenerationguide/

I can't find this error. 

 

Thanks.

with cc# 4222222222222

and x_test_request=true

and the amount would be any response code the you want to test

is this case, x_amount = 261.00

 

is in

http://developer.authorize.net/guides/AIM/wwhelp/wwhimpl/js/html/wwhelp.htm#href=5_TestTrans.html

 

look like they need to add it to the error gen doc.

Ok I will try. Thank you very much. I think I will succeed. Thank you for your explanation.

So I succefully built solution, thank you for your instructions. Now after ever "capture" transaction I sending request to Transaction Details API and save transaction details to handle any errors in future. How do you think is this a good workflow?

 

And I test 261 error code with card 4222222222222 and now errors returns. 

 

Examlpe of request and response from my log file.

 

 [request] => Array
        (
            [x_version] => 3.1
            [x_delim_data] => True
            [x_relay_response] => False
            [x_test_request] => TRUE
            [x_login] => ****
            [x_tran_key] => ****
            [x_type] => PRIOR_AUTH_CAPTURE
            [x_method] => CC
            [x_invoice_num] => 1234567
            [x_amount] => 261.00
            [x_currency_code] => USD
            [x_trans_id] => 123456789
            [x_first_name] => Test
            [x_last_name] => Test
            [x_company] => Company
            [x_address] => some address
            [x_city] => some city
            [x_state] => some state
            [x_zip] => 123456
            [x_country] => US
            [x_phone] => 1234567
            [x_fax] => 
            [x_cust_id] => 1234567
            [x_customer_ip] => 
            [x_customer_tax_id] => 
            [x_email] => vemail@email.com
            [x_email_customer] => 0
            [x_merchant_email] => 
            [x_po_num] => 
            [x_tax] => 0.0000
            [x_freight] => 0.0000
        )

    [result] => Array
        (
            [response_code] => 1
            [response_subcode] => 1
            [response_reason_code] => 1
            [response_reason_text] => (TESTMODE) This transaction has been approved.
            [approval_code] => 000000
            [avs_result_code] => P
            [transaction_id] => 0
            [invoice_number] => 1234567
            [description] => 
            [amount] => 261.00
            [method] => CC
            [transaction_type] => prior_auth_capture
            [customer_id] => 161280
            [md5_hash] => EGHB581BBA91F7FDF334B8E7D4346
            [card_code_response_code] => 
            [c_av_vresponse_code] => 
            [split_tender_id] => 
            [acc_number] => 
            [card_type] => Visa
            [requested_amount] => 
            [balance_on_card] => 
        )

    [__pid] => 29026

 

hm...there is now card number. But in transaction details response we can see that I use cc code: 4222222222222:

        <payment>
            <creditCard>
                <cardNumber>XXXX2222</cardNumber>
                <expirationDate>XXXX</expirationDate>
                <cardType>Visa</cardType>
            </creditCard>
        </payment>

 

The 261 test only work for a auth_only or auth_capture transaction.

oh.. understood. so we there is no way to reproduce test error 261 - for  PRIOR_AUTH_CAPTURE. and what you think about my workflow,  is this a good solution to make request to TD API all the time after capture?

Yes, it fine, you can call the TD API all the time. Or you can just do it when the response code not 1 and 2.

Thank you very much! I like this developer center. :smileyhappy: