0

When I click on "proceed to checkout" button getting error time to implement custom payment method.

config.xml

enter image description here enter image description here

app\code\local\Excellence\Pay\Model\Pay.php

class Excellence_Pay_Model_Pay extends Mage_Payment_Model_Method_Abstract
{

    protected $_code = 'pay';
    protected $_formBlockType = 'pay/form_pay';
    protected $_infoBlockType = 'pay/info_pay';
    public function assignData($data)
    {
        if (!($data instanceof Varien_Object)) {
            $data = new Varien_Object($data);
        }
        $info = $this->getInfoInstance();
        $info->setCheckNo($data->getCheckNo())
        ->setCheckDate($data->getCheckDate());
        return $this;
    }

    public function validate()
    {
        parent::validate();

        $info = $this->getInfoInstance();

        $no = $info->getCheckNo();
        $date = $info->getCheckDate();
        if(empty($no) || empty($date)){
            $errorCode = 'invalid_data';
            $errorMsg = $this->_getHelper()->__('Check No and Date are required fields');
        }

        if($errorMsg){
            Mage::throwException($errorMsg);
        }
        return $this;
    }
}

The Error is:-

enter image description here

2
  • 1
    Could you post your plugin's XML files? I think you are extending something wrong, or overwriting something wrong. Dec 27 '17 at 8:41
  • I add the config.xml @AngelsDustz
    – sdeveloper
    Dec 27 '17 at 9:59
0

Alright, the issue is in the config.xml like I suspected.

More specifically you call for a model called pay/pay which doesn't exist for it is searching in Mage/{first_key}/Model/{secondary_key}.

I took a quick look but I couldn't find which model you have to extend, but the issue is at default -> payment -> pay -> model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.