0
votes

Getting "Gateway error: Unable to read response or response is empty" when I try to post payments to authorize.net. Authorize.net cannot see anything coming through, host provider says no issues on their end.

  • I am using the Authorize.net payment type
  • I have verified my API login and trans ID in default, website, and store view
  • I have installed cURL SSL
  • I have verified no firewalls are blocking connections.
  • I am not in testmode
  • debugging is on, and results are below.

Below is the output from the exception.log file

2013-09-26T15:26:24+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Gateway error: Unable to read response,      or response is empty' in /app/Mage.php:595
Stack trace:
#0 /app/code/core/Mage/Paygate/Model/Authorizenet.php(1596): Mage::throwException('Gateway error: ...')
#1 /app/code/core/Mage/Paygate/Model/Authorizenet.php(594): Mage_Paygate_Model_Authorizenet->_postRequest(Object(Mage_Paygate_Model_Authorizenet_Request))
#2 /app/code/core/Mage/Paygate/Model/Authorizenet.php(436): Mage_Paygate_Model_Authorizenet->_place(Object(Strattas_Authnetcim_Model_Order_Payment), '44.53', 'AUTH_CAPTURE')
#3 /app/code/core/Mage/Sales/Model/Order/Payment.php(408): Mage_Paygate_Model_Authorizenet->capture(Object(Strattas_Authnetcim_Model_Order_Payment), '44.53')
#4 /app/code/core/Mage/Sales/Model/Order/Invoice.php(385): Mage_Sales_Model_Order_Payment->capture(Object(Mage_Sales_Model_Order_Invoice))
#5 /app/code/core/Mage/Sales/Model/Order/Payment.php(569): Mage_Sales_Model_Order_Invoice->capture()
#6 /app/code/core/Mage/Sales/Model/Order/Payment.php(375): Mage_Sales_Model_Order_Payment->_invoice()
#7 /home/morrell/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(317): Mage_Sales_Model_Order_Payment->capture(NULL)
#8 /app/code/core/Mage/Sales/Model/Order.php(877): Mage_Sales_Model_Order_Payment->place()
#9 /app/code/core/Mage/Sales/Model/Order.php(1406): Mage_Sales_Model_Order->_placePayment()
#10 [internal function]: Mage_Sales_Model_Order->place()
#11 /app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#12 /app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#13 /app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#14 /app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#15 /home/morrell/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(777): Mage_Sales_Model_Service_Quote->submitAll()
#16 /app/code/core/Mage/Checkout/controllers/OnepageController.php(567): Mage_Checkout_Model_Type_Onepage->saveOrder()
#17 /app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_OnepageController->saveOrderAction()
#18 /home/morrell/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#19 /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#20 /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#21 /app/Mage.php(687): Mage_Core_Model_App->run(Array)
#22 /index.php(87): Mage::run('', 'store')
#23 {main}
2
Do you have test mode enabled? - Axel
And you're sure your gateway URLs are correct? Production: https://secure.authorize.net/gateway/transact.dll Sandbox: https://test.authorize.net/gateway/transact.dll - Phil Birnie
Go into your Authorizenet.php, and in the _postRequest function right above Mage::throwException($this->_wrapGatewayError($e->getMessage()));, add this line: Mage::log($debugData); . You can also find the function for $client->request() and add in some logging there. - aynber
Alternatively, you can see the data posted by using Developer Tools in your browser. Hit F12, go to the Net tab and expand the authorize.net gateway url. Look for Post and see what data is missing. - Axel

2 Answers

0
votes

i think you enabled Test Mode in System->Configuration->PaymentMethods

0
votes

Turns out there was an issue with my nameservers at my host. I figured this out using information here: http://www.magentocommerce.com/boards/viewthread/50611/ (the referenced thread can be viewed in the internet archive, here https://web.archive.org/web/20150315055800/http://www.magentocommerce.com/boards/viewthread/50611 )

After that I received an error message associated with a blocked IP. I added my new ip at accounts.authorize.net in Tools (top menu) > Fraud Suite (left menu) > Authorized AIM ip addresses (body, second to last item).