Typ	uc_clickandbuy
Datum	Sonntag, August 16, 2009 - 17:29
Benutzer	Anonymous
Ort	http://xxxxxxx.com/cart/clickandbuy/transaction?Email=xxx@rxxx.net&Phone=1234&cb_billing_City=xxxxx&cb_billing_FirstName=xxx&cb_billing_LastName=xxx&cb_billing_Nation=DE&cb_billing_Street=1234%20Main%20Rd.&cb_billing_ZIP=53119&cb_content_info_utf=Bestellung%2021&cb_content_name_utf=xxxxxxx.com&cb_currency=EUR&cb_shipping_City=NewYork&cb_shipping_FirstName=xxxxx&cb_shipping_LastName=xxxx&cb_shipping_Nation=DE&cb_shipping_Street=1234%20Main%20Rd.&cb_shipping_ZIP=12345&externalBDRID=funtimes21&lang=de&price=944
Referrer	
Nachricht	ClickandBuy transaction 83032816 failed:
Incorrect price: 944000 vs 945000.
Schweregrad	Warnung
Hostname	111.22.333.44
Operationen	

Comments

Passer’s picture

Version: 6.x-1.1 » 6.x-1.0

--

robertdouglass’s picture

Version: 6.x-1.0 » 6.x-1.1

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

spuky’s picture

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

longwave’s picture

Category: support » bug
Status: Active » Fixed

Fix committed to CVS, thanks.

honigferd’s picture

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

longwave’s picture

Status: Needs work » Fixed

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

Status: Fixed » Closed (fixed)

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