News:

Looking for documentation? Take a look on our wiki

Main Menu

ps_authorize $order_total and decimals

Started by joomber, March 10, 2010, 11:59:37 AM

Previous topic - Next topic

joomber

Strange behaviour with authorize.net modified for www.securepay.com. I can set it to charge the proper amount for $X.xx where .xx is not zero's. OR I can set it to charge the proper amount for $X.xx where .xx is all zero's. I cannot get it to behave correctly when $X.xx has a trailing zero. The ps_authorize.php has to be modified one way to handle double zero's, a different way to handle no trailing zero's and there is no way to get a .10 .20 .30 etc. value to charge the customer correctly. I have viewed all the posts and tried all the settings except this one from drew23:

"The following code worked for me. Basically find out if it has a decimal or not, then make sure it is in the correct format."
Code:

if(strpos($order_total,".") !== false){
//Is decimal
    $order_total_dec = number_format($order_total, 2, '.', '');
}else{
//Is NOT Decimal
$order_total_dec = $order_total . ".00";
}

I can't for the life of me understand where to place that snippet of code and I have little faith that it will solve the problem with securepay. To date I have spent over 1000$ with errant transactions including one 695$ purchase that should have been $6.95. I will eventually get the money back but testing mode fails to function at all and my bank is out of funds for further testing. Please help if you can.
Thanks in advance
Joomber

brandon2004

Did you ever get any help with this?  I am having the exact same issue.  I have already lost hundreds of dollars because my customers are being charged 6.88 instead of 68.80, etc.

Thanks!