my $cur_total = $U->fpsum(@xact_balances); # current balance of selected.
my $paid_total = $tokens->{AMT}; # original paypal payment amount
- if ($paid_total != $cur_total) {
- my @xacts = $tokens->{xacts};
+ # Using != resulted in some numbers that (according to the logs) were
+ # the same number behaving as if they weren't. More decimal weirdness?
+ # Treat the values as strings instead.
+ $cur_total = sprintf("%.2f", $cur_total);
+ $paid_total = sprintf("%.2f", $paid_total);
+
+ if ($paid_total ne $cur_total) {
+ my @xacts = @{$tokens->{xacts}};
$logger->error("PayflowHosted requested payment amount of ".
"$paid_total does not match total balance owed ($cur_total) of ".