Cleaning up error checking

First checking for a valid order, then checking for a valid order id
This commit is contained in:
James Hawkins 2015-07-14 09:18:19 -05:00
parent 84e7977238
commit 1d12be67e9
1 changed files with 6 additions and 1 deletions

View File

@ -77,8 +77,13 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
$order = \Mage::getModel('sales/order')->load($ipn->posData->quoteId, 'quote_id');
}
if (false === isset($order) || true === empty($order)) {
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Invalid Bitpay IPN received.');
\Mage::throwException('Invalid Bitpay IPN received.');
}
$orderId = $order->getId();
if (false === isset($order) || (true === empty($orderId))) {
if (false === isset($orderId) || true === empty($orderId)) {
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Invalid Bitpay IPN received.');
\Mage::throwException('Invalid Bitpay IPN received.');
}