This question already has an answer here:
I am getting issue with paypal standard on my Magento 220.127.116.11 ,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
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]
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
**Here order status is "Processing" checked via Mage::log** $payment = $this->_order->getPayment() ->setPreparedMessage($this->_createIpnComment($this->_info->explainReasonCode($reason))) ->setTransactionId($this->getRequestData('txn_id')) ->setParentTransactionId($this->getRequestData('parent_txn_id')) ->setIsTransactionClosed($isRefundFinal) ->registerRefundNotification(-1 * $this->getRequestData('mc_gross')); $this->_order->save(); **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 :
It will be really appreciable if some one can guide me which function in above code changing order state from "Processing" to "Complete"