I have updated the module but now I get the "amount too long or not numeric" error on the ogone payment page. I installed it together with the uc_vat module so maybe it could be related to a conflict using both modules.

This is wat is going on during the checkout
For example:

The price to pay should be 57,50 €
When I check my postrequest values I see : amount: 5750.188

anyone knows what I did wrong?

Cheers

Douglas

Comments

fictionindustries’s picture

Ok I fixed this by changing line 368:

$amount = $arg1->order_total * 100; //amount *100

into

$amount = round($arg1->order_total,2) * 100; //amount *100

My guess is that the VAT module added some extra decimal places to the final amount and ogone doesn't digest these small numbers very well.
Rounding the number again to a number with 2 decimal places fixed the problem.

While I was there I found another occurrence of the
$amount = ... on line 332...

$orderid = $arg1->order_id;
$amount = $arg1->order_total * 100; //amount *100

$orderid and $amount are not used untill both lines are called again on 368. Guess they can be removed too.

What do you think Kees?

alexanderpas’s picture

how about using round($arg1->order_total * 100)

keesje’s picture

Thanks for the info.
If lines are redundant they should be removed IMHO.
#2 seems most straightforward.
Anyone willing to provide a patch?

keesje’s picture

Assigned: Unassigned » keesje
arnebrasseur’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.11 KB

I can confirm that this solves the issue, a patch is included.

keesje’s picture

Status: Needs review » Closed (duplicate)
arnebrasseur’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new912 bytes

This is still broken in CVS. Patch for CVS HEAD included.

arnebrasseur’s picture

Status: Needs review » Closed (fixed)

I must've been looking at the wrong place, it is fixed in CVS.