In a previous issue you had fixed the error #8 by rounding the order total with this code : $total = round($order->order_total*100, 2);
But this is not correct. If a VAT calculation results in something like 45.333333 (more than 4 decimals), the multiplication by 100 hides 2 decimals and the rounding 2 others. In my example, 2 decimals are still there and the error occurs.
The right code is : $total = number_format($order->order_total, 2) * 100;
First, you round the total by 2 decimals and then multiplicate by 100 which ends in no decimals.
Codes are line 46 and 196 in the uc_paybox.pages.inc file I have which version is : // $Id: uc_paybox.pages.inc,v 1.1.2.2 2009/12/01 15:44:37 mogtofu33 Exp $
Sorry, I don't know about the patch system and I don't have time to study it.
You'll fix it by yourself.
Thanks for your module, very useful.
Regards
Philippe
Comments
Comment #1
mogtofu33 commentedThanks a lot for this fix, will be added soon on all my payments modules.
Regards.
Mog.
Comment #2
mogtofu33 commented