I have to solve a problem with math, need help to find formula. Have to calculate to send amount to payment gateway. Let say for example I sell product with price 68000
, the payment gateway have to charge the product with fee + tax (where the fee and tax must be borne by the user) so I can still get same money after tax + fee = 68000
, fee is 1,50%
from product and tax is 11%
from the fee, calculate the money before send to payment gateway, tryng with this formula:
Case 1
68000 = a-a*1,50%-(a*1,50%*11%)
68000 = a * (1 - 0.015 - 0.00165)
a * (1 - 0.015 - 0.00165) = 68000
a * 0.98335 = 68000
a = 68000 / 0.98335
so i get value to payment gateway is 69151, then I can still get 10000 after all charge, let prove :
69151 * 1.50% = 1037
1037 * 11% = 114
total charge = 1037 + 114 = 1151
69151 - 1151 = 68000 (exactly 68000)
Case 2, with price of product 63000
63000 = a-a*1,50%-(a*1,50%*11%)
63000 = a * (1 - 0.015 - 0.015 * 0.11)
a * (1 - 0.015 - 0.00165) = 63000
a * 0.98335 = 63000
a = 63000 / 0.98335
a = 64066
prove
64066 * 1.50% = 960
960 * 11% = 105
total charge = 960 + 105 = 1065
64066 - 1065 = 63001 (not exactly 63000)
please help, what can i fix from the formula ?
the problem is how much to add to the product price if you want to get the initial product price after transaction fees and taxes from the payment gateway