@@ -, +, @@ - Apply the patch - Notice there are no deps for URL::Encode - Follow the steps from the original patch - Sign-off :-D --- C4/Installer/PerlDependencies.pm | 5 ----- opac/opac-account-pay-paypal-return.pl | 11 +++++++---- opac/opac-account-pay.pl | 13 ++++++------- 3 files changed, 13 insertions(+), 16 deletions(-) --- a/C4/Installer/PerlDependencies.pm +++ a/C4/Installer/PerlDependencies.pm @@ -777,11 +777,6 @@ our $PERL_DEPS = { 'required' => '1', 'min_ver' => '1.10', }, - 'URL::Encode' => { - 'usage' => 'PayPal', - 'required' => '0', - 'min_ver' => '0.03', - }, 'WWW::YouTube::Download' => { 'usage' => 'HTML5Media streaming from YouTube', 'required' => '0', --- a/opac/opac-account-pay-paypal-return.pl +++ a/opac/opac-account-pay-paypal-return.pl @@ -24,7 +24,7 @@ use utf8; use CGI; use HTTP::Request::Common; use LWP::UserAgent; -use URL::Encode qw(url_params_mixed); +use URI; use C4::Auth; use C4::Output; @@ -85,10 +85,13 @@ my $response = $ua->request( POST $url, $nvp_params ); my $error = q{}; if ( $response->is_success ) { - my $params = url_params_mixed( $response->decoded_content ); - if ( $params->{ACK} eq "Success" ) { - $amount = $params->{PAYMENTINFO_0_AMT}; + my $urlencoded = $response->content; + my %params = URI->new( "?$urlencoded" )->query_form; + + + if ( $params{ACK} eq "Success" ) { + $amount = $params{PAYMENTINFO_0_AMT}; my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline'); foreach my $accountlines_id ( @accountlines ) { --- a/opac/opac-account-pay.pl +++ a/opac/opac-account-pay.pl @@ -24,7 +24,6 @@ use Modern::Perl; use CGI; use HTTP::Request::Common; use LWP::UserAgent; -use URL::Encode qw(url_encode url_params_mixed); use URI; use C4::Auth; @@ -64,8 +63,6 @@ my $error = 0; if ( $payment_method eq 'paypal' ) { my $ua = LWP::UserAgent->new; - my $amount = url_encode($amount_to_pay); - my $url = C4::Context->preference('PayPalSandboxMode') ? 'https://api-3t.sandbox.paypal.com/nvp' @@ -74,7 +71,7 @@ if ( $payment_method eq 'paypal' ) { my $opac_base_url = C4::Context->preference('OPACBaseURL'); my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" ); - $return_url->query_form( { amount => $amount, accountlines => \@accountlines } ); + $return_url->query_form( { amount => $amount_to_pay, accountlines => \@accountlines } ); my $cancel_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account.pl" ); @@ -104,10 +101,12 @@ if ( $payment_method eq 'paypal' ) { my $response = $ua->request( POST $url, $nvp_params ); if ( $response->is_success ) { - my $params = url_params_mixed( $response->decoded_content ); - if ( $params->{ACK} eq "Success" ) { - my $token = $params->{TOKEN}; + my $urlencoded = $response->content; + my %params = URI->new( "?$urlencoded" )->query_form; + + if ( $params{ACK} eq "Success" ) { + my $token = $params{TOKEN}; my $redirect_url = C4::Context->preference('PayPalSandboxMode') --