1

I'm trying to do the following:

$order->setTotalPaid($amount);
$order->save();

But I keep getting the following error:

Call to a member function getMethodInstance() on boolean in /mnt/webdrive/foo.foo-web.net/app/code/core/Mage/Payment/Model/Observer.php on line 46

The payment is returning as a boolean! Not a null, and when I go into the orders page in the CMS, I see that a payment method had been set in the payment information! Payment Information: My Wallet Payments

What's weird is, even when I try setting the payment again with

$order->setPaymentMethod('foopayment');
$order->save();

It's giving the exact same error!

What is causing this issue?

1
  • check log file. is there any exception like "The requested Payment Method is not available" ? Commented Mar 3, 2016 at 7:14

1 Answer 1

1

if the Payment has a deleted flag, it will not be returned by the getPayment method and if there are only payments with the deleted flag, the method will return false:

https://github.com/bragento/magento-core/blob/1.9/app/code/core/Mage/Sales/Model/Order.php#L912

1
  • I put a log in the loop. It's not even entering the loop to check if it'd eleted. Why is that happening?
    – Pat
    Commented Mar 3, 2016 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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