I have implemented a third party api and I am getting bellow error:
Fatal error: Call to a member function getMethod() on a non-object in /var/www/html/app/code/local/Openpay/Banks/Model/Observer.php on line 14
at line 14 I have below code:
if(Mage::getConfig()->getModuleConfig('Openpay_Banks')->is('active', 'true')){
$order_ids_list = $order_ids->getOrderIds();
$order_id = $order_ids_list[0];
$order = Mage::getModel('sales/order')->load($order_id);
$code = Mage::getModel('Openpay_Banks_Model_Method_Banks')->getCode();
if($order->getPayment()->getMethod() == $code){
$args = array(
'order' => $order->getIncrementId(),
'id' => $order->getPayment()->getOpenpayPaymentId(),
);
$this->_redirect('print', 'payments', $code, $args);
}
what I can do to fix this error?