From ecd787c68734d6595b2e4e92e99b5b785d80c372 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 21 Sep 2016 16:04:05 -0400 Subject: [PATCH] JBAS-1544 Payflow xact balance comparison repair Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 24a8294a89..b756974298 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -2038,8 +2038,14 @@ sub payflow_create_payment { 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 ". -- 2.11.0