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 4

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.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

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.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

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');
    }

}