rounding and paypal
I had a strange issue crop up today in a cart using paypal pro.
In testing, I had a product for $65, and used a coupon code for 99% off, which should give me a total of 0.65. This worked perfect in the cart page, and confirm page (ie subtotal, discounts etc all looked right).
However, when I submitted payment to paypal, it failed due to invalid itemTotal.
I looked in the xml sent to paypal, and it showed the itemTotal value as 0.6500000000001
Very strange!
Anyway, I did a temporary fix in PP-DirectPayment_PHP.php by changing the itemtotal in line 84 to read round($varvalueArray["itemtotal"],2)
instead of just $varvalueArray["itemtotal"]
However, I was wondering if there was a better fix for this.
Thanks,
Tom