Patch (to be ported)
Project:
Paybox payment for Ubercart
Version:
6.x-1.2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2010 at 10:25 UTC
Updated:
3 Feb 2011 at 17:08 UTC
Okay, then i was using paybox since some weeks and it works really fine for me. Thanks.
By the way, i just encoured a problem related to price. if the shopping cart total price is superior at 1000 Euros then when the client been redirected to paybox it show only 1 Euro to pay.
I think that the price isn't well formated.
Comments
Comment #1
rookmoot commentedHm i fixed the problem like that :
// $chaine['total'] = " PBX_TOTAL=". number_format($order->order_total, 2) * 100;
$chaine['total'] = " PBX_TOTAL=".$order->order_total * 100;
I'm not sure that was the solution but maybe... It's working...
Comment #2
aroq commentedrookmoot, thnx for solution, I found that for cases with decimal totals (like 158.479) better to use:
$chaine['total'] = " PBX_TOTAL=". number_format($order->order_total, 2, '.', '') * 100;
Comment #3
mogtofu33 commentedHi,
Corrected on dev release, will be ported soon.
I think it's better to use: number_format($order->order_total, 2, variable_get('uc_currency_thou', ','), '')
Regards.
Mog.
Comment #4
xorne commentedHi all,
I had same pb, fixed like that :
$chaine['total'] = " PBX_TOTAL=". round($order->order_total, 2) * 100;
thanx anyway for this useful module
Comment #5
selinav commentedI've the error message "Autoresponse error on order 689: Incorrect price: 8800 / 8806."
I've replaced the line
$total = number_format($order->order_total, 2) * 100;by
$total = number_format($order->order_total, 2, variable_get('uc_currency_thou', ','), '') * 100;and I've even the problem.
Is it compatible with VAT number?
Please help.
Comment #6
TataYoyo commentedHi,
I applied the patch (#3) a couple of days ago and realized today there were no more decimals sent to Paybox ("37.40 €" becomes "37.00 €" - speaking about money, not separators !)
I read the code again and thought :
- I understand multiplying by 100 is necessary because paybox waits for the total value in cents (0.01 €), with nothing but numbers in the PBX_TOTAL string.
- as it needs integers, why do we try to do anything with formating ?
- did we realize we are multiplying a string by 100 ? (number_format() returns a string)
I would patch this way :
$chaine['total'] = " PBX_TOTAL=". round($order->order_total, 2) * 100;
or :
$chaine['total'] = " PBX_TOTAL=". round($order->order_total * 100, 0);
eventually :
$chaine['total'] = " PBX_TOTAL=". number_format(round($order->order_total * 100, 0), 0, '', '');
Regards.