From 678df3132fd3791a91be63324f38a3d00a1efa8f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 18 Sep 2015 05:54:30 -0700 Subject: [PATCH] Bug 11622 [QA Followup] - Display payment messages directly on opac account view Fixed spelling of "Receive" in preferences. Signed-off-by: David Kuhn Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../en/modules/admin/preferences/opac.pref | 6 +-- .../en/modules/opac-account-pay-return.tt | 52 ------------------- .../bootstrap/en/modules/opac-account.tt | 18 +++++++ opac/opac-account-pay-paypal-return.pl | 8 +-- opac/opac-account.pl | 2 + 5 files changed, 27 insertions(+), 59 deletions(-) delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index e355748d1e..b3c0a2b9e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -727,15 +727,15 @@ OPAC: no: "Production" - "mode." - - - "The email address to recieve PayPal payments is " + - "The email address to receive PayPal payments is " - pref: PayPalUser class: long - - - "The password for the PayPal account to recieve payments is " + - "The password for the PayPal account to receive payments is " - pref: PayPalPwd class: long - - - "The signature for the PayPal account to recieve payments is " + - "The signature for the PayPal account to receive payments is " - pref: PayPalSignature class: long - diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt deleted file mode 100644 index 03b9093bf9..0000000000 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt +++ /dev/null @@ -1,52 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your payment -[% INCLUDE 'doc-head-close.inc' %] -[% BLOCK cssinclude %][% END %] - - - -[% INCLUDE 'masthead.inc' %] - -
- - -
-
-
- -
-
-
- [% IF error %] -
-

Error: there was an problem processing your payment

- - [% IF error == "PAYPAL_UNABLE_TO_CONNECT" %] -

Unable to connect to PayPal.

-

Please try again later.

- [% ELSIF error == "PAYPAL_ERROR_PROCESSING" %] -

Unable to verify payment.

-

Please contact the library to verify your payment.

- [% END %] -
- [% ELSIF amount %] -
-

Payment applied: your payment of [% amount %] has been applied to your account

-
- [% END %] - - Return to fine details -
-
-
-
-
- -[% INCLUDE 'opac-bottom.inc' %] - -[% BLOCK jsinclude %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt index 7192070232..42ffc91633 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -42,6 +42,24 @@ [% END %] + [% IF payment_error %] +
+

Error: there was an problem processing your payment

+ + [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %] +

Unable to connect to PayPal.

+

Please contact a librarian to verify your payment.

+ [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %] +

Unable to verify payment.

+

Please contact a librarian to verify your payment.

+ [% END %] +
+ [% ELSIF payment %] +
+

Payment applied: your payment of [% payment %] has been applied to your account

+
+ [% END %] +

Fines and charges

[% IF ( ACCOUNT_LINES ) %] diff --git a/opac/opac-account-pay-paypal-return.pl b/opac/opac-account-pay-paypal-return.pl index 5ed3913d47..d2be6d38f9 100755 --- a/opac/opac-account-pay-paypal-return.pl +++ b/opac/opac-account-pay-paypal-return.pl @@ -79,12 +79,12 @@ my $nvp_params = { my $response = $ua->request( POST $url, $nvp_params ); +my $error; if ( $response->is_success ) { my $params = url_params_mixed( $response->decoded_content ); if ( $params->{ACK} eq "Success" ) { $amount = $params->{PAYMENTINFO_0_AMT}; - $template->param( amount => $amount ); my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline'); foreach my $accountlines_id ( @accountlines ) { @@ -93,12 +93,12 @@ if ( $response->is_success ) { } } else { - $template->param( error => "PAYPAL_ERROR_PROCESSING" ); + $error = "PAYPAL_ERROR_PROCESSING"; } } else { - $template->param( error => "PAYPAL_UNABLE_TO_CONNECT" ); + $error => "PAYPAL_UNABLE_TO_CONNECT"; } $template->param( @@ -106,4 +106,4 @@ $template->param( accountview => 1 ); -output_html_with_http_headers( $cgi, $cookie, $template->output ); +print $cgi->redirect("/cgi-bin/koha/opac-account.pl?payment=$amount&payment-error=$error"); diff --git a/opac/opac-account.pl b/opac/opac-account.pl index b40924b011..bb2589102d 100755 --- a/opac/opac-account.pl +++ b/opac/opac-account.pl @@ -69,6 +69,8 @@ $template->param( accountview => 1, message => $query->param('message') || q{}, message_value => $query->param('message_value') || q{}, + payment => $query->param('payment'), + payment_error => $query->param('payment-error'), ); output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; -- 2.39.5