Hello!

Im using Joomla 2.5.8 and VM2.0.22a

Im setting up the payment methods, and ive realized that if i set a fee for some payment method, the fee is not calculated correctly.

The problem is on both plugins Standard, and Paypal.

I will start explaining with

**Standard** as its easier:

I have a "Cash on delivery" payment method, using Standard plugin. The shipping company charges me 3% of the amount plus TAX.

Im using "percentage of total amount" = 3, and general TAX rules, here in Spain, TAX is 21%.

That means that 3% of the TOTAL AMOUNT should be calculated, but it calculates 3% of products + shipping.

If i have an order of $100 (and free shipping to make it easy), then the calculated fee for this payment method is: $3.63. This is because 3% of $100 is $3, plus 21% TAX, makes $3.63.

But in fact, the fee should be

**$3.77**, plus $100 product makes $103.77 order total.

3% of $103.77 is $3.11. $3.11 plus 21% tax makes $3.77 <-- this is how shipping companies charges for "cash on delivery service".

So, if i charge $103.77, and the shipping company keeps $3.77, i have my $100 of the order...

Thats why i think the plug in is not working properly.

With

**Paypal** occurs the same, but more complex:

Paypal charges me $0.35 fixed fee, plus 3.4% of total amount.

So I configure the plugin with 0.35 transaction fee, and 3.4 for percentage of total amount. With 21% tax

Same example: $100 product, free shipping.

Paypal fee charged by VM is $4.54 ($100 * 3.4% = $3.4 | $3.4 + $0.35 = $3.75 | $3.75 * 21% = $4.54)

The correct fee should be

**$4.73**, plus $100 product makes $104.73 order total.

3.4% of $104.73 is $3.56. $3.56 plus 0.35 fixed fee is $3.91. And $3.91 plus 21% tax makes $4.73 <-- this is how paypal charges the fees. (although 21% TAX is not charged by paypal, im obliged to do it by estate treasury)

Thats why i think the plug in is not working properly.

Maybe TAX is making it more difficult to explain and the calculations are a little bit more difficult, but the problem is still the same: the fee is calculated over the product + shipping total, and not over the amount to pay.

Here you have a Paypal calculator to check

http://www.rememberingrolbe.com/paypal.htmCheck the image attached to quickly see how the plug in is calculating wrong.

If you consider this a bug as i do, ive made all calculations and formulas to get the correct values. If you need this just ask.

Regards!