I am using Magento ver. On checkout step I am getting following in popup:

Unable to set payment method

When I checked the exception.log I found more details like following :

exception 'Exception' with message 'Notice: Undefined index: cc_owner in app/code/core/Mage/Checkout/Model/Type/Onepage.php(604) : eval()'d code on line 17' in app/code/core/Mage/Core/functions.php:245

How can I fix this issue?

  • i did not this line where to add and what lines to remove. please help on this issue facing on live site. Aug 12 '16 at 12:05

Following was the issue:

Some another developer had written some code line like

eval((base64_decode(str_rot13(strrev() ) ))));

after following line:

if ($quote->isVirtual()) {
    $quote->getBillingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);
} else {
    $quote->getShippingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);

in \app\code\core\Mage\Checkout\Model\Type\Onepage.php file.

When I removed this line everything worked correctly.

This url helped me debugging this:

PHP may encounter parse errors. These parse errors occur due to incorrect input of the syntax. This type of syntax error can occur while using the eval( ) function as well. This error occurs most often due to the presence of PHP around the PHP strings which has to be evaluated.

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.