Added extra error handling and debugging

This commit is contained in:
Rich Morgan 2014-12-17 14:41:42 -05:00
parent 2bf5911860
commit f950bf05a1
1 changed files with 8 additions and 8 deletions

View File

@ -14,19 +14,19 @@ class Bitpay_Core_IndexController extends Mage_Core_Controller_Front_Action
*/
public function indexAction()
{
$params = $this->getRequest()->getParams();
$paid = false;
if (isset($params['paid'])) {
$params = $this->getRequest()->getParams();
if (true === isset($params['paid'])) {
Mage::helper('bitpay')->registerAutoloader();
Mage::helper('bitpay')->debugData(
$params
);
Mage::helper('bitpay')->debugData($params);
} else {
Mage::helper('bitpay')->debugData('[ERROR] Could not get params from request.');
}
$this->loadLayout();
$this->getResponse()->setHeader('Content-type', 'application/json');
$this->getResponse()->setBody(
json_encode(array('paid' => $paid))
);
$this->getResponse()->setBody(json_encode(array('paid' => $paid)));
}
}