cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal Error when redirecting customers to iDeal

Fatal Error when redirecting customers to iDeal

Hello,

A lot of our customers are getting an error when being redirected to iDeal. This error is: 

Fatal error: Call to a member function getMethodinstance() on a non-object in

/home/........./public_html/app/code/community/Appmerce/Internetkassa/Block/Placement.php on line 73

Mostly this error happeness when customers try to make an order with MacOS/ iOS. But it also sometimes happeness with Windows.

There are 4-5 different people which don't know how to solve this problem. Does anybody here know what could be causing this error?

 

4 REPLIES

Re: Fatal Error when redirecting customers to iDeal

@midimedianl

 

You will not receiving the selected payment object during checkout and dut to that you are receiving this error.

Found something useful, please give "Kudos" or "Accept as Solution" for Token of Appreciation.
Free Magento Extensions : https://magecomp.com/free-magento-extensions.html

Re: Fatal Error when redirecting customers to iDeal

I'm sorry, but i don't understand your answer. Where should we look for what is causing this error?

Re: Fatal Error when redirecting customers to iDeal

This is the error in your extension. You need to share the extension code to check.

Found something useful, please give "Kudos" or "Accept as Solution" for Token of Appreciation.
Free Magento Extensions : https://magecomp.com/free-magento-extensions.html

Re: Fatal Error when redirecting customers to iDeal

Line 73 =  */

Line 76 =  return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields($this->_getOrder());

class Appmerce_Internetkassa_Block_Placement extends Mage_Core_Block_Template
{
    public function __construct()
    {
    }

    /**
     * Return checkout session
     *
     * @return Mage_Checkout_Model_Session
     */
    public function getCheckout()
    {
        return Mage::getSingleton('checkout/session');
    }

    /**
     * Return payment API model
     *
     * @return Appmerce_Internetkassa_Model_Api_Hosted
     */
    protected function getApi()
    {
        return Mage::getSingleton('internetkassa/api');
    }

    /**
     * Return order instance by lastRealOrderId
     *
     * @return Mage_Sales_Model_Order
     */
    protected function _getOrder()
    {
        if ($this->getOrder()) {
			if ($this->getOrder()->getPayment()) {
				return $this->getOrder();
			} else {
				$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
				return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
			}
        } elseif ($orderIncrementId = $this->getCheckout()->getLastRealOrderId()) {
            return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
        } else {
            return null;
        }
    }

    /**
     * Return placement form fields
     *
     * @return array
     */
    public function getFormData()
    {
        return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields($this->_getOrder());
    }

    /**
     * Return gateway path from admin settings
     *
     * @return string
     */
    public function getFormAction()
    {
        return $this->_getOrder()->getPayment()->getMethodInstance()->getGatewayUrl('redirect');
    }

}