2

When I am about to issue a credit/refund, I go to the Invoice > Credit Memo and try to > Refund Online, then I receive a fatal error 500.

Looking in error_log this is the record:

  PHP Fatal error:  Call to a member function refund() on null in 
 /app/code/core/Mage/Sales/Model/Order/Payment.php on line 693

Here is the code in question from that file: (starting from line 680-703)

    if ($gateway->canRefund() && $creditmemo->getDoTransaction()) {
        $this->setCreditmemo($creditmemo);
        $invoice = $creditmemo->getInvoice();
        if ($invoice) {
            $isOnline = true;
            $captureTxn = $this->_lookupTransaction($invoice->getTransactionId());
            if ($captureTxn) {
                $this->setParentTransactionId($captureTxn->getTxnId());
            }
            $this->setShouldCloseParentTransaction(true); // TODO: implement multiple refunds per capture
            try {
                $gateway->setStore($this->getOrder()->getStoreId())
                    ->processBeforeRefund($invoice, $this)
                    ->refund($this, $baseAmountToRefund)  //LINE 693 joell
                    ->processCreditmemo($creditmemo, $this)
                ;
            } catch (Mage_Core_Exception $e) {
                if (!$captureTxn) {
                    $e->setMessage(' ' . Mage::helper('sales')->__('If the invoice was created offline, try creating an offline creditmemo.'), true);
                }
                throw $e;
            }
        }
    }

Appreciate any input

0

After further testing and digging, we found the issue is only with Stripe payment method. We used the free netgo_stripe module which caused the error.

Authorize net works smooth with no issues.

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.