From b0f7187487ee5dc2996eaa60cd0575c12557eb43 Mon Sep 17 00:00:00 2001 From: Michele Morgan Date: Wed, 9 Aug 2017 11:36:20 -0400 Subject: [PATCH] LP 1708728 - Fix Stripe penny errors introduced by perl int() function Fixes the issue where payment amounts sent to Stripe can be one cent less than the actual Evergreen payment due to use of the perl int() function. To test ------- A Stripe account is required to view transactions on the Stripe side. To enable test payments, Stripe testing API keys need to be entered in the Evergreen ou settings: credit.processor.stripe.pubkey credit.processor.stripe.secretkey - Add a bill to a patron record with the following amounts: $8.20 - Login to the opac as the patron and pay the bill. - View the transaction on the Stripe side and see that it is one cent less than the paid bill in Evergreen. - Apply the patch. - Repeat the steps above. - On the Stripe side, see that the Stripe amount and Evergreen amount now match. Signed-off-by: Michele Morgan Signed-off-by: Dan Pearl Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm index c434b155dc..17c496bdd9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm @@ -101,7 +101,7 @@ sub process_stripe_or_bop_payment { if ($cc_args->{processor} eq 'Stripe') { # Stripe my $stripe = Business::Stripe->new(-api_key => $psettings->{secretkey}); $stripe->charges_create( - amount => int($total_paid * 100.0), # Stripe takes amount in pennies + amount => ($total_paid * 100), # Stripe takes amount in pennies card => $cc_args->{stripe_token}, description => $cc_args->{note} ); -- 2.43.2