What does this error message mean? Incorrect price: 944000 vs 945000.
robertDouglass - August 16, 2009 - 15:34
| Project: | Ubercart ClickandBuy Payment Method |
| Version: | 6.x-1.1 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Typ uc_clickandbuy
Datum Sonntag, August 16, 2009 - 17:29
Benutzer Anonymous
Ort http://xxxxxxx.com/cart/clickandbuy/transaction?Email=xxx@rxxx.net&Phone...
Referrer
Nachricht ClickandBuy transaction 83032816 failed:
Incorrect price: 944000 vs 945000.
Schweregrad Warnung
Hostname 111.22.333.44
Operationen

#1
--
#2
No, I double checked. This happened on the 1.1 version.
#3
I had this issue too changing the folowing code arraound line 227 in uc_clickandbuy.module:
if (intval($_SERVER["HTTP_X_PRICE"]) != intval($order->order_total * 100000)) {$errors[] = t('Incorrect price: @price1 vs @price2.', array('@price1' => $_SERVER["HTTP_X_PRICE"], '@price2' => ($order->order_total * 100000)));
}
to:
if (intval($_SERVER["HTTP_X_PRICE"]) != intval(floor($order->order_total*100) * 1000)) {$errors[] = t('Incorrect price: @price1 vs @price2.', array('@price1' => $_SERVER["HTTP_X_PRICE"], '@price2' => intval(floor($order->order_total*100) * 1000)));
}
has fixed the issue for me... the problem seems to be with multiplying the Float value of order total.
Hope that helps sombody out there...
#4
Fix committed to CVS, thanks.
#5
This whole construct (both the "old" version and the fix result in rounding errors in quite a few cases though.
e.g. Price including tax: 16.90 at a taxrate of 7% will return a respective price value of 16.89.
also see #631826: Wrong rounding after checkout when price gets sent to CnB
#6
Let's keep this rounding problem in the other issue, the original issue mentioned here is still fixed.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.