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; $net=$gross-$fee;
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...
$fund_amount=2; $cc_fee= (ceil(((($fund_amount+1.5)*.065)+1.5)*100)/100); $cc=(ceil(($fund_amount+$cc_fee)*100)/100);
Any clarification or enlightenment on this matter would be greatly appreciated.