From 4159da23f671663ffaf3d40227b2228e28f69006 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 15 Nov 2013 17:06:53 -0500 Subject: [PATCH 1/1] LP#1251774 exit and alert on multiple payments per xact If more than one payment for a transaction is received, exit the API call early and return a MULTIPLE_PAYMENTS_FOR_XACT event. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm | 5 ++++- 1 file changed, 4 insertions(+), 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 c127d7514c..a6220edaf9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm @@ -170,7 +170,10 @@ sub make_payments { my @unique_xact_payments; for my $pay (@{$payments->{payments}}) { my $xact_id = $pay->[0]; - next if (exists($xacts{$xact_id})); + if (exists($xacts{$xact_id})) { + $e->rollback; + return OpenILS::Event->new('MULTIPLE_PAYMENTS_FOR_XACT'); + } my $xact = $e->retrieve_money_billable_transaction_summary($xact_id) or return $e->die_event; -- 2.43.2