Showing results for 
Search instead for 
Did you mean: 

Save Paypal fee Amount for transaction

0 Kudos

Save Paypal fee Amount for transaction

Feature request from licentia, posted on GitHub Oct 15, 2015

Magento should save the fee charged by Paypal for the transaction. This is very useful when trying to calculate Customer Equity & LTV. We have precise values and not approximate ones.

Check this doc: and the FEEAMT field.

FEEAMT should be added to the

protected $_getTransactionDetailsResponse



And stored in the

sales_order_payment table


Comment from asemenenko, posted on GitHub Oct 16, 2015

Hi @bvboas

Are you building reporting solely on data in Magento? The reason i ask is the fact that you can query PayPal as a master data for this information using PayPal Transaction Detail Report that provides accurate state of all transactions and fee associated with them in the desired period of time while Magento may not have all transactions (say you initiated reference transaction on PayPal side and it never appeared on Magento side obviously)

Comment from licentia, posted on GitHub Oct 16, 2015

HI @asemenenko

Yes, we are building data solely based on Magento local data (some extra data is entered by the merchant).

I'm aware that I can call that operation, but we process all invoices from previous month on the same day, and we could be talking about many thousands of invoices. And making that amount of calls, will/may seriously slow down the progress.


Comment from asemenenko, posted on GitHub Oct 19, 2015

Hi @bvboas

PayPal built-in reporting tool allows to retrieve a downloadable report for a given period (manually from or programmatically) which means there will be no performance issue for you and the data in this case will be 100% accurate since generated by PayPal based on the all transactions created there.

Comment from licentia, posted on GitHub Oct 19, 2015

Hi @asemenenko

I want to know the fee amount per transaction/invoice. The value collected will be used by a Customer Equity & LTV extension. Those values will then be used to determine product prices and customers segments.

Comment from asemenenko, posted on GitHub Oct 26, 2015

Hi @bvboas to make data accurate:

  • we need to update sales orders with settlement status of the transactions associated with it. Settlement report functionality can be used to grab those transactions and update sales order documents. Usually there is a way to get a monthly report from the gateway programmatically. CSV upload is also an option sometimes.
  • interface should be universal enough to be used for other payment solutions, say PayPal and Braintree enabled at the same time on the storefront

I created an improvement for this. We will need to think about how to implement it giving points above.

Frequent Contributor


I am not sure, you guys have tried this extension, this allows you to take payment gateway fees