I know this is more of a math question, but since I'm trying to evaluate it in a script, maybe I can squeeze it in here. I know there is an easy way to do this, but for the life of me, I can't seem to get it clear.
If a payment processor is charging a per transaction fee of $1.50 plus a 6.5% processing fee, that come off of the total payment..
And I want to end up with a Net of $2 in my account, how do I determine what the Gross charge would be to send them?
BTW, they are charging the 6.5% on the transaction fee as well as on the actual payment itself.
what they are doing on their end when they receive it is they take the Gross payment and multiply it by the 6.5% rate, then add the $1.50 trans fee to determine the fee, and back that out of the gross payment to determine the net that goes into the account.
$fee=($gross x .065) + 1.5;
So, the basic question is... How do I determine what the Gross needs to be to end up with the net where I want it. In this case it is $2, but I need to be able to calculate it with a single calculation no matter what the net is.
This is what I thought would work, but apparently I was wrong...
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.
$factor=.06526; // represents 6.5% fee deducted after payment
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);