I'm going to go on the basis I have the right idea for what you want, the calculation is as follows:

You want the fee (referred to as $outcome, what you get) to equal a certain amount, lets take your example for $2, so...

(($gross x 0.065) + 1.5) must equal $2 ... and you want to know what $gross is? so you would do the following:

(2 - 1.5) / 0.065 = 7.6923... - That's what you have to charge your customer, in order for you to receive $2 in fees.

Now, for that to work on any calculation with pluggable values in PHP:

```
$outcome = 2;
$charge = 1.5;
$processing_fee = 0.065;
$gross = ($outcome - $charge) / $processing_fee;
// Gross is now 7.6923...
```

Sorry, but that is not what I was trying to explain...

In my example, the gross should end up at $3.74 for them to take away their 6.5% and then their $1.50 and leave the $2.00 net

What I need is to figure out what the Gross should be so they can take their 6.5% and their $1.50, and leave me with the net that I want in my account. (in example the net is $2.00)

OK, I have come up with the solution, although it was a long drawn out process to come up with the factor to use to represent the 6.5% they would deduct...

Here is a little snippet to show the solution.

And it actually works no matter what the funding amount is.

(Well almost) Tested from $2 to 35,000 with accuracy, but when you hit $40K it gains a penny... but since the funding amount will never approach that figure, I think I'll deal with it.

```
$fund_amount=2;
$trans_fee=1.5;
$factor=.06526; // represents 6.5% fee deducted after payment
$fee=(($fund_amount+$trans_fee)*$factor)+((($fund_amount+$trans_fee)*$factor)*$factor);
$total_charge=$fund_amount+$fee+$trans_fee;
print "<br />To fund $".number_format($fund_amount,2);
print "<br />The fee is $".number_format(($fee+$trans_fee),2);
print "<br />For a total Charge of $".number_format($total_charge,2);
print"<br /><br />So when the processor receives the payment of $".number_format($total_charge,2);
print"<br />They determine the fee to be gross X .065 plus $1.50, which is ".number_format((($total_charge * .065) + 1.5),2);
print"<br />Leaving a Net of $".number_format(($total_charge-(($total_charge * .065) + 1.5)),2);
```