I'm working on magento 1.9 CE and using paypal standard. I need data of fees charged for sales(done through paypal) and have searched long to find out if they are stored in database. I know that the following link provides the numbers https://www.paypal.com/in/webapps/mpp/paypal-fees.

I would like to know if they are stored in database so that I can automate. Thanks in advance.

1 Answer 1


After a really long research, found out that it is the paypal model file app/code/core/Mage/Paypal/Model/Ipn.php in magento root directory where we need to do the following :

Method/function is _registerPaymentCapture.Here, use the following code :

$paypal_fee = $this->getRequestData('mc_fee');

under the code

$payment = $this->_order->getPayment();

Additionally where to store :

This should be stored in table sales_flat_invoice. Add a column to store.

Code for the same :

in the same method, there is code if ($invoice && !$this->_order->getEmailSent()) after this block, use a mySql query to update the table :


// table is sales_flat_invoice // where increment_id = $invoice->getIncrementId();

mySql query goes here...


  • This might not be the best way but so far no issues as it is simple query based. Commented Oct 1, 2015 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.