This question already has an answer here:

I am getting issue with paypal standard on my Magento ,Below is the scenario:

  • I am working with sandbox account
  • After payment , paypal IPN changes my order state to "Processing" from "Pending Payment".
  • Now I go to my paypal account and issue a partial refund like if order total is 20$ , I refund 2$.
  • Now in response Paypal IPN do two things on magento

    1. Change order state to complete [This is the issue it shouldn't change the state to complete because I had done a partial refund from order amount]

    2. Create credit memo of 2$ and send email to customer.

The code I found is :

File : app/code/core/Mage/Paypal/Model/Ipn.php

function : _registerPaymentRefund

Code :

**Here order status is "Processing" checked via Mage::log**

    $payment = $this->_order->getPayment()
                ->registerRefundNotification(-1 * $this->getRequestData('mc_gross'));


**Here order status is "Complete" checked via Mage::log**

Below are the screen for more clear view first one is for magento and another one is for paypal :

Screen at magento

screen at paypal

It will be really appreciable if some one can guide me which function in above code changing order state from "Processing" to "Complete"

marked as duplicate by ProxiBlue, Marius, user487772 Aug 15 '13 at 4:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I got some sort of solution here magento.stackexchange.com/questions/3405/… , but they are disabling automatic credit memo creation and sending admin notification to create credit memo manually.I want credit memo remain automated,please help guys ? – Ravinder Aug 14 '13 at 4:36
  • Hi, If you read the referred question, you will see the persons involved are well experienced in magento, and they came up with the most viable solution. Their reasoning is sound, and I am sure they tried everything to make this automated. You are asking the same thing, thus marking the question as duplicate of that. sorry. – ProxiBlue Aug 14 '13 at 15:25
  • Hi.sorry I can't agree.I am trying for fix,not to convert the things for manual processing.any help will be really appreciated to debug this magento core issue. – Ravinder Aug 14 '13 at 16:49

Browse other questions tagged or ask your own question.