Magento – Magento Credit memo before invoice captured

apiinvoicepayment

The client I am working with has a requirement that they are able to give credit memos before either full or partial capture of an invoice (i.e. money is authorized but not paid).

The idea being that no stock is being managed by magento, and magento has no way of knowing if something is in stock at a given time. The stock is managed by a 3rd party system. Generally they will receive new stock within days, but it may not necessarily match the items ordered. They want to be able to refund a part of any order.

Is there any way of doing this? Are there any extensions that offer this functionality?

The other way to look at it is, we need to be able to amend an order after its been authorized. In order to adjust the amount of money that is taken from the customer, specifically omitting any unavailable items. This must appear to be a refund from the customer's perspective as per our client's requirements.

All of this will be managed using a 3rd party integration that leverages the Magento API.

Best Answer

Luke, I've never seen an extension out there that does exactly what you need.

It's (probably) possible to implement this functionality with custom Magento code by rewriting the various quote, sales, quote item, sales item, credit memo, and credit memo, and payment module event handlers, and/or a class method rewrite or two. However, it's a rather large task and not easily answered in a single Stack Exchange question, and would require you to understand how all the above objects interact before tackling it.

This sort of programming can be more time consuming that you'd expect. Also, because it involves actual money, this needs more rigorous testing that can usually be applied in a client services environment. Also also, it gets extra tedious because each payment module type (authorizenet, paypal, stripe, etc.) seems to handle orders, credit memos, and invoices slightly differently, which means you'll often end up with subtle, hard to track down bugs. I have 4+ years Magento experience and I'd be wary of tackling this sort of problem — especially if the client needed a fixed bid.

If you're open to alternate solutions — right now it sounds like your client is handling this manually in the admin console and wants to be able to stop doing that. Instead of trying to come up with (clever and awesome) solutions using Magento's existing objects, I'd focus on automating what your client is currently doing manually. That'll likely be easier than messing around with custom account programming.

Related Topic