I am facing an issue while creating an Credit memo for a order. I am getting error as "Argument 'Invoice number' not set!".

This order has been placed through PayPal.

Please help to fix this issue.

  • Please provide some code, so we can help. Do you have error logs? – Tim Hallman Jun 1 '15 at 12:13
  • See this screenshot: puu.sh/i86Ee/4de87b57a1.png. I don't see this in exeception log. – Vick Jun 1 '15 at 12:53

I solved this issue by adding the below code on salesOrderCreditMemoCreate function in Observer.php of klarnacheckout module.

$order = $observer->getEvent()->getCreditmemo()->getOrder();

            $payment = $order->getPayment();

            $method = $payment->getMethod();
               $supportedMethods = array(
            if (!in_array($method, $supportedMethods)) {
                return $this;

Add this code just after this line:

$items = $observer->getEvent()->getCreditmemo()->getAllItems();
| improve this answer | |

I had this exact same error message. The only place i could find a reference to the message was in <magento root>/lib/Klarna/Exception.php in the class Klarna_ArgumentNotSetException. This exception is thrown when the creditInvoice function in <magento root>/lib/Klarna/Klarna.php is called with an empty $invNo.

The source of the problem in my case was the module Vikingweb/Klarnacheckout which runs the salesOrderCreditMemoCreate function on the sales_order_creditmemo_save_after event. In my version of the module this function does not seem to check if the correct payment method was used so it was run for every payment method – which resulted in the $klarnaInvoiceId to be empty and the exception to be thrown. I solved the problem by disabling the module, as it was not in use anymore.

| improve this answer | |

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.