I need to collect a payment using a payment provider that charges 2.9% + .30 of the final payment amount. I need to ensure that a specific number is collected after the fees are taken out. I need the end user to pay for the credit card fees so I'm adding them back into the payment amount which messes with the final total.
Here is an example:
100 has to be collected.
If I were to add in the credit card fees 100 + 2.9% + .30 = 103.20 and try to collect that it messes up the 100 because the processor takes 2.9% + .30 from the final payment amount 103.20 which ends up being 103.20 - 2.9% + .30 = 99.90 instead of 100 so I end up short .10 in this example.
I know that I need to calculate the payment amount 103.30 in order to make it 100 instead of 99.90 but I don't know how to come up with a formula to calculate that amount.