# Calculate PayPal's fees

I have a problem of ethics and mathematics.

I have a website with subscription fees. My customers can pay them with PayPal.

PayPal takes $3,4\%$ of my price plus a fixed fee of $0,25c$.

If my customer pays $10$, PayPal takes $10 \times 0,034 + 0,25 = 0,59$ from me, and I earn $10 - 0,59 = 9,41$

So I want to add PayPal's fees to the amount I charge because I want $10$ in my account and not $9,xxx$ or $10,yyy$

I ask to my customer to pay $10 + 0,59 = 10,59$, but this time PayPal fees are $10,59 \times 0,034 + 0,25 = 0,61$ and I earn $10,59 - 0,61 = 9,98$.

So... I decided to increase the percentage:

$10 \times 0,035 + 0,25 = 0,60$ And PayPal calculates $10,60 \times 0,034 + 0,25 = 0,61$.

So... Up the percentage to $3,6%$ ... $10 \times 0,036 + 0,25 = 10.61$ And PayPal charges $10,61 \times 0,034 + 0,25 = 0,61$ And finally $10,61 - 0,61 = 10$ YES!!!!

Question: Is there a way to calculate the amount to be applied before PayPal fees?

-

In principle you have to solve for $x$ in the following equation.
$$(1-0.034)x - 0.25 = 10$$
$x \approx 10.61077$ and it gives you the amount needed to obtain \$$10 after fees. So if you want x in your account, the formula for what to charge via PayPal is:$$(x+0.25)/(1-0.034)
Plugging in $10$ for $x$ gives $10.61077$. Of course you will actually charge $10.61$, which yields $10.61 - (10.61 \times 0.034 + 0.25) = 9.99926$ which rounds to $10$.