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
4 ACCEPTED SOLUTIONS

Accepted Solutions

Use http://developer.authorize.net/api/transaction_details/ with the transaction ID to get the transactiondetail

View solution in original post

RaynorC1emen7
Expert

You need to enabled the transaction detail API on the merchant account.

Login in to the account, and change it in Account - Settings.

View solution in original post

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

<cardNumber>XXXX0027</cardNumber>

View solution in original post

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.

View solution in original post

19 REPLIES 19

Use http://developer.authorize.net/api/transaction_details/ with the transaction ID to get the transactiondetail

RaynorC1emen7
Expert

I will try this solution. But in authrorize.net support told me that this api ("transaction details") not works with AIM method.

Not sure about not work with AIM. They might mean it is a different API then AIM.

transaction detail api it work with any transactions from authorize.net

Thank you very much for a very quick answers.  

I found realization for TransactionDetails request in Magento and also I tried to make request throw SDK (http://developer.authorize.net/api/transaction_details/) and I have the same response in both cases:

 

<?xml version="1.0" encoding="utf-8"?>
<getTransactionDetailsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>
<resultCode>Error</resultCode>
<message>
<code>E00011</code>
<text>Access denied. You do not have permissions to call the Transaction Details API.</text>
</message>
</messages>
</getTransactionDetailsResponse>

 

I checked my login and trans_key in request and it was correct. What I should to do to have permissions for TD API?

 

Here my request:

 

<?xml version="1.0" encoding="utf-8"?>
<getTransactionDetailsRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>xxxxxxxx</name>
<transactionKey>xxxxxxxxxxxxxxxxxx</transactionKey>
</merchantAuthentication>
<transId>xxxxxxxx</transId>
</getTransactionDetailsRequest>

I must emphasize that I use the sandbox in these tests.

You need to enabled the transaction detail API on the merchant account.

Login in to the account, and change it in Account - Settings.

You respond so quickly! Thanks!

 

 

So I enabled this setting in my sandbox account.

 

Here my reponse: 

 

 

<getTransactionDetailsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <messages>
        <resultCode>Ok</resultCode>
        <message>
            <code>I00001</code>
            <text>Successful.</text>
        </message>
    </messages>
    <transaction>
        <transId>xxxxxxxxxx</transId>
        <submitTimeUTC>2014-07-16T10:39:59.897Z</submitTimeUTC>
        <submitTimeLocal>2014-07-16T03:39:59.897</submitTimeLocal>
        <transactionType>authOnlyTransaction</transactionType>
        <transactionStatus>capturedPendingSettlement</transactionStatus>
        <responseCode>1</responseCode>
        <responseReasonCode>1</responseReasonCode>
        <responseReasonDescription>Approval</responseReasonDescription>
        <authCode>0C8D35</authCode>
        <AVSResponse>Y</AVSResponse>
        <order>
            <invoiceNumber>xxxxxxx</invoiceNumber>
        </order>
        <authAmount>25.00</authAmount>
        <settleAmount>25.00</settleAmount>
        <taxExempt>false</taxExempt>
        <payment>
            <creditCard>
                <cardNumber>XXXX0027</cardNumber>
                <expirationDate>XXXX</expirationDate>
                <cardType>Visa</cardType>
            </creditCard>
        </payment>
        <customer>
            <email>someemail@mail.com</email>
        </customer>
        <billTo>
            <firstName>firstname</firstName>
            <lastName>lastname</lastName>
            <company>test</company>
            <address>Test adress 400</address>
            <city>Some city</city>
            <state>Some State</state>
            <zip>12345</zip>
            <country>US</country>
            <phoneNumber>1234567</phoneNumber>
            <faxNumber>test_admin</faxNumber>
        </billTo>
        <recurringBilling>false</recurringBilling>
        <customerIP>127.0.0.1</customerIP>
        <product>Card Not Present</product>
        <marketType>eCommerce</marketType>
    </transaction>
</getTransactionDetailsResponse>

 So my question is: "Where I can find "approval_code", "acc_number",  "transaction_id" " in this reponse?

approval_code

<authCode>0C8D35</authCode>

 

account number? that not a authorize.net field

 

transaction_id, that the transaction id that you pass in.

<transId>xxxxxxxxxx</transId>

Thanks. I verified authCode and transaction_id and you are absolutely right.

 

And about acc_number, here is my logged response from authorize.net for  [x_type] => PRIOR_AUTH_CAPTURE

 

 

  [result] => Array
        (
            [response_code] => 1
            [response_subcode] => 1
            [response_reason_code] => 1
            [response_reason_text] => This transaction has been approved.
            [approval_code] => xxxxxx
            [avs_result_code] => P
            [transaction_id] => xxxxxxxxxxx
            [invoice_number] => xxxxxx
            [description] => 
            [amount] => 29.00
            [method] => CC
            [transaction_type] => prior_auth_capture
            [customer_id] => 
            [md5_hash] => 3C68B4BCFB82610F132218FGFGAFEE5
            [card_code_response_code] => 
            [c_av_vresponse_code] => 
            [split_tender_id] => 
            [acc_number] => XXXX0027
            [card_type] => Visa
            [requested_amount] => 
            [balance_on_card] => 
        )

    [__pid] => 15892

 As I understood this is number of card. VISTA TEST CARD: 4007000000027. Or am I wrong?