@@ -, +, @@ on opac account view --- .../en/modules/opac-account-pay-return.tt | 52 -------------------- .../opac-tmpl/bootstrap/en/modules/opac-account.tt | 18 +++++++ opac/opac-account-pay-paypal-return.pl | 8 +-- opac/opac-account.pl | 2 + 4 files changed, 24 insertions(+), 56 deletions(-) delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt @@ -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 %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ a/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 ) %] --- a/opac/opac-account-pay-paypal-return.pl +++ a/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"); --- a/opac/opac-account.pl +++ a/opac/opac-account.pl @@ -73,6 +73,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; --