Magento Forum

Stop Auto Creditmemos when doing a refund in Paypal. 
 
timpea
Member
 
Total Posts:  68
Joined:  2007-09-03
 

I posted this in the Magento Answers part of the site, but have got no response so thought I would try in here:
http://www.magentocommerce.com/answers/How-do-I-stop-paypal-auto-creating-credit-memos-when-refunding-an-order/

In Magento 1.5.1, on an order that has been paid by Paypal standard, if I refund the customer in Paypal then it auto creates a Credit memo for this.

Most of the time we refund is due to a customer returning part of the order, so I don’t want paypal to create a credit memo with no products.  I need to be able to create the credit memo in Magento and return the ‘returned’ products back into stock.

If I create a credit memo first, then do the refund in Paypal, it will create another credit memo for £0.

Cheers,
Tim

 
Magento Community Magento Community
Magento Community
Magento Community
 
timpea
Member
 
Total Posts:  68
Joined:  2007-09-03
 

This is also creates a problem with the inventory.  If I create a credit for 1 item (and restock), then refund on paypal it will restock and note the other item as refunded.

 
Magento Community Magento Community
Magento Community
Magento Community
 
freezm72
Jr. Member
 
Total Posts:  6
Joined:  2008-09-08
 

Same problem.
We create a credit memo manually the paypal create another credit memo

 
Magento Community Magento Community
Magento Community
Magento Community
 
timpea
Member
 
Total Posts:  68
Joined:  2007-09-03
 

Ok, so I had a go at fixing it myself.  Think it is working ok, I have stopped it doing Creditmemos completely from a Paypal Refund.

Attached is the Module I have created to override Sales_Model_Order_Payment, use at your own risk.

File Attachments
Paypal_StopAutoCredit.zip  (File Size: 9KB - Downloads: 262)
 
Magento Community Magento Community
Magento Community
Magento Community
 
benz001
Sr. Member
 
Avatar
Total Posts:  238
Joined:  2009-02-05
Sydney
 

@timpea
Thanks for that, if I read that module correctly aren\\\’t you potentially blocking all online refunds from any payment gateway?
In the standard Magento this is only used by the PayPal module so it makes sense, but potentially any number of other payment could be making use of this model as well.

I haven\\\’t tried it yet but an alternative route could be to override Mage_Paypal_Model_Ipn and block the refund case on line 280

// refund by merchant on PayPal side
                //case Mage_Paypal_Model_Info::PAYMENTSTATUS_REFUNDED:
                //    $this->_registerPaymentRefund();
                //    break;

The downside is that it doesn\\\’t leave any notes in the order status indicating that PayPal has refunded some or all of the order....

 
Magento Community Magento Community
Magento Community
Magento Community
 
timpea
Member
 
Total Posts:  68
Joined:  2007-09-03
 

Yea I think it will, I don’t like the way Magento works this auto credit system, so I would prefer it to be disabled for everything.  To me it only works if you are always refunding the complete order, but most of the credits we do are when a customer has returned only part of the order.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top