Magento – Understanding cancellation and refund process (i.e. how to handle cancelled but paid orders)

magento-1.9paymentrefund

So I got banned from #magento on freenode for asking details about this to understand the underlying process flow. 😀

I get the problem that:

  1. a product is ordered
  2. an invoice is send
  3. a payment is triggered by a payment provider via wire transfer
  4. a notice comes that the product can't be delivered
  5. I check if the invoice was paid
  6. if it wasn't I cancel the order
  7. now money from the customer arrives

Now I'm stuck as I can click to refund the order but the total amount is zero as I cancelled the order already.
This can happen all the time, and seems to be the case if you google for it, because i.e. the wire transfer just takes some time, the customer mixes up the payments and tells you he hasn't paid yet or something alike. You can't wait to cancel for weeks just to be sure the customer doesn't pay, can you?

What workflow does magento have here? You can't cancel the cancellation, you can't refund the order, you can't tell it that it was "overpaid" so to speak. It seems you can't do anything here.
The only thing I came up with was to mingle through the database and revert the cancellation so I could refund again.
I found a lot of code snippets online to do so, which in my opinion hints at something.

I really like to understand the thinking / process here.

Best Answer

Magento cancel order of invoiced items are as follow Any invoiced orders in Magento cannot be "canceled", but they can be "closed". It sounds like you need to issue a "credit memo", which is refund in Magento.

enter image description here

Brief Regarding Credit Memo

After an order has been paid and invoiced, all of the order, or a portion of it, can be refunded by issuing a credit memo. A credit memo differs from a refund because the amount of the credit is restored to the customer's account where it can be applied to future purchases, rather than returned to the customer as cash. In some cases, a refund can be given at the same time that the credit memo is issued, just as a payment can be made at the time of invoicing.

Related Topic