For the most part, dealing with PayPal is a pain. But it seems to be ubiquitous and a lot of people expect to be able to use it to pay their invoices.

I encountered a situation recently, in which a very fine Joomla! module on a client's website could not handle accurately calculating the PayPal fees so they could be charged to the customer. In effect this is the same as reversing the charges on a long-distance call in days of yore.

Basically, once the fees are calculated using your percentage + flat fee, the amount passed to PayPal is then used as the basis for their calculations and you will always came up short. I reported it to the extension maker and they promised to put it on their to-do list for a future release. I felt that if I could hand them the formula for making this calculation, then I could expect a much quicker fix, and that has in fact happened.

Finding the solution proved to be much harder than I expected, but I did find it and I'm going to hand it to you in the form of an Excel spreadsheet. I'm not going to describe it, I'm going to give you the working solution, showing both the erroneous and correct calculations. Download it with the links below.

As you should expect, this spreadsheet is offered without warranty or promise or expectation of suitability for any purpose. You are entirely responsible for determining if the calculations are accurate and only proceed after thorough and careful testing. Any errors or miscalculations introduced by any means are an expected hazard when using any spreadsheet. I will not be liable for any errors contained in the spreadsheet, or which result from using the spreadsheet or any formulas or techniques included in the spreadsheet. You must make sure that the fees that PayPal assigns to you are accurate for your situation.


Excel spreadsheet demonstrating PayPal fee calculations

The same Excel spreadsheet, zipped.