From 07668697cf13b4687eab878b13446b4771ec9c4e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 22 Sep 2011 10:27:11 -0400 Subject: [PATCH] TPac: credit card payment bug fixes / cleanup * Repaired bug with paying multiple transactions * Replaced JS-based back/cancel navigation with a's * Added some debug logging Signed-off-by: Bill Erickson --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 6 ++++-- Open-ILS/src/templates/opac/myopac/main_pay.tt2 | 12 ++++++++++-- Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 | 13 ++++++------- 3 files changed, 20 insertions(+), 11 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 fbcc8e7749..726db95e4d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -942,8 +942,10 @@ sub load_myopac_pay { my $self = shift; my $r; - $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact'), $self->cgi->param('xact_misc')]) and - return $r; + my @payment_xacts = ($self->cgi->param('xact'), $self->cgi->param('xact_misc')); + $logger->info("tpac paying fines for xacts @payment_xacts"); + + $r = $self->prepare_fines(undef, undef, \@payment_xacts) and return $r; # balance_owed is computed specifically from the fines we're trying # to pay in this case. diff --git a/Open-ILS/src/templates/opac/myopac/main_pay.tt2 b/Open-ILS/src/templates/opac/myopac/main_pay.tt2 index 86ee7e8934..7c3468210f 100644 --- a/Open-ILS/src/templates/opac/myopac/main_pay.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main_pay.tt2 @@ -13,8 +13,16 @@ [% ctx.payment_response.payload.error_message %]

- [% l('Go back') %] + [% + url_args = {xact => [], xact_misc => []}; + FOR k IN ['xact', 'xact_misc']; + FOR val IN CGI.param(k); + url_args.$k.push(val); + END; + END; + retry_url = mkurl(ctx.opac_root _ '/myopac/main_payment_form', url_args, 1); + %] + [% l('Go back') %] [% l('to try again or to cancel this payment attempt.') %]

[% ELSE %] diff --git a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 index c54f4e02e3..cb4d4a177b 100644 --- a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 @@ -18,12 +18,12 @@

[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]

[% FOR k IN CGI.Vars; - NEXT UNLESS k %] - - [% END %] + NEXT UNLESS k; + FOR val IN CGI.param(k) %] + + [% END; END %] - + [% l('Cancel') %] [% ELSE %] @@ -173,8 +173,7 @@ - + [% l('Cancel') %] [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %] -- 2.11.0