Cleaning up error checking
First checking for a valid order, then checking for a valid order id
This commit is contained in:
parent
84e7977238
commit
1d12be67e9
|
@ -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.');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue