Have a piece of code I have been using forever, and actually it was written by Stymiee (his authnet code), has been running flawlessly on several websites but last night something went boom and it screwed up.
Simply put the code does nothing more than ensure the dollar amount sent to them is formatted with two places past the decimal point:
sprintf("%01.2f", $policy->get_policy_price())
I re-tested it and printed out the values to check like this:
echo 'policy price: ' . $policy->get_policy_price() . ' to authnet ' . sprintf("%01.2f", $policy->get_policy_price());
The policy price shows 1625.00 but the price after the sprintf is showing 1.00 (and that’s what was sent to authnet)
The price is put into the object as such:
$price = number_format(round($_POST['insured_acres_n'] * $row['rate_per_acre'], 2), 2);
$policy->set_policy_price($price);
In this particular circumstance the insured_acres_n amount is 13000 and the rate_per_acre amount is 0.125 so doing the math it is indeed 1625.00 (which the application and order confirmation receipt (ours) is showing yet the amount sent to them is coming out $1.
Any ideas? Is there a bug in sprintf with newer versions of PHP? BTW, running version 5.2.6
What’s odd is this site has run at least 200 orders through with no problem at all … the only difference between them and this one is this one is over $1000