2

When creating an order at the backend, we get The requested Payment Method is not available!". Our exception is thrown at /app/code/core/Mage/Payment/Model/Info.php in function getMethodInstance.

The payment method is working at regular online orders, but not via the backend. We have this problem after updating to Magento 1.9.1.1 .

I believe that $instance is set, but I am not able to find setInfoInstance method to debug this further. Where can I find it?

The requested payment method is in the list of the active payment methods. Is it possible, that an other non used payment method is responsible for this trouble Then: How can I find out, which payment method causes the issue?

Also m2epro import has the same problems.

1
  • did you update any modules?
    – paj
    Aug 31, 2015 at 16:01

2 Answers 2

5

The following was working:

app/code/core/Mage/Payment/Model/Info.php

public function getMethodInstance()
{
    if (!$this->hasMethodInstance()) {
        if ($this->getMethod()) {
            $instance = Mage::helper('payment')->getMethodInstance($this->getMethod());
            if ($instance) {

                $instance->setInfoInstance($this);

                $this->setMethodInstance($instance);

                return $instance;
            }
        } else {

            $instance = Mage::helper('payment')->getMethodInstance('banktransfer');
            if ($instance) {

                $instance->setInfoInstance($this);

                $this->setMethodInstance($instance);

                return $instance;
            }
        }
        Mage::throwException(Mage::helper('payment')->__('The requested Payment Method is not available!!'));
    }

    return $this->_getData('method_instance');
}

2

Not all payment methods allow ordering from the backend. However, since you say it was working prior to an update, it's unlikely that is the problem.

But, just in case. If you have a peek at

app/code/core/Mage/Payment/Modal/Method/Purchaseorder.php

you should see something like:

protected $_canUseInternal = true;
protected $_canUseCheckout = false;

You could copy this to your local code pool and modify the booleans to allow ordering from the backend (if this is your issue).

1
  • Seems to be correct, when I debug the code: Jun 23, 2015 at 8:43

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