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
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

Passer - August 18, 2009 - 18:54
Version:6.x-1.1» 6.x-1.0

--

#2

robertDouglass - August 18, 2009 - 21:28
Version:6.x-1.0» 6.x-1.1

No, I double checked. This happened on the 1.1 version.

#3

spuky - September 22, 2009 - 17:44

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

longwave - November 12, 2009 - 19:13
Category:support request» bug report
Status:active» fixed

Fix committed to CVS, thanks.

#5

honigferd - November 25, 2009 - 09:34
Status:fixed» needs work

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

longwave - November 27, 2009 - 13:17
Status:needs work» fixed

Let's keep this rounding problem in the other issue, the original issue mentioned here is still fixed.

#7

System Message - December 11, 2009 - 13:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.