[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_4 updated. 65a6d603736a8e8e7a8b91ea3c88b192ce8460e5
Evergreen Git
git at git.evergreen-ils.org
Wed Nov 20 10:55:58 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_4 has been updated
via 65a6d603736a8e8e7a8b91ea3c88b192ce8460e5 (commit)
via 3c4aa090a4e177bc55158b4b7d368654b91fa1f6 (commit)
from ccc0a8dbcef48ddd19ff94f8a72848bed11612e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 65a6d603736a8e8e7a8b91ea3c88b192ce8460e5
Author: Bill Erickson <berick at esilibrary.com>
Date: Fri Nov 15 17:06:53 2013 -0500
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 <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
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 72296fa..37387ec 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -169,7 +169,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;
commit 3c4aa090a4e177bc55158b4b7d368654b91fa1f6
Author: Mike Rylander <mrylander at gmail.com>
Date: Fri Nov 15 16:40:36 2013 -0500
Enforce one-payment-per-xact-per-call
There is no legitimate reason for a transaction to receive more than
one payment per call to open-ils.circ open-ils.circ.money.payment,
but we have seen the staff client generate such a data structure. This
leads to seemingly duplicate payments, and is bad all around. So,
we will enforce the restriction by taking only the first payment per
xact in the list of payments.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Bill Erickson <berick at esilibrary.com>
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 eb1ac40..72296fa 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -161,8 +161,16 @@ sub make_payments {
# first collect the transactions and make sure the transaction
# user matches the requested user
my %xacts;
+
+ # We rewrite the payments array for sanity's sake, to avoid more
+ # than one payment per transaction per call, which is not legitimate
+ # but has been seen in the wild coming from the staff client. This
+ # is presumably a staff client (xulrunner) bug.
+ my @unique_xact_payments;
for my $pay (@{$payments->{payments}}) {
my $xact_id = $pay->[0];
+ next if (exists($xacts{$xact_id}));
+
my $xact = $e->retrieve_money_billable_transaction_summary($xact_id)
or return $e->die_event;
@@ -172,7 +180,9 @@ sub make_payments {
}
$xacts{$xact_id} = $xact;
+ push @unique_xact_payments, $pay;
}
+ $payments->{payments} = \@unique_xact_payments;
my @payment_objs;
-----------------------------------------------------------------------
Summary of changes:
.../perlmods/lib/OpenILS/Application/Circ/Money.pm | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list