View | Details | Raw Unified | Return to bug 16129
Collapse All | Expand All

(-)a/C4/Installer/PerlDependencies.pm (-5 lines)
Lines 777-787 our $PERL_DEPS = { Link Here
777
        'required' => '1',
777
        'required' => '1',
778
        'min_ver'  => '1.10',
778
        'min_ver'  => '1.10',
779
    },
779
    },
780
    'URL::Encode' => {
781
        'usage'    => 'PayPal',
782
        'required' => '0',
783
        'min_ver'  => '0.03',
784
    },
785
    'WWW::YouTube::Download' => {
780
    'WWW::YouTube::Download' => {
786
        'usage'    => 'HTML5Media streaming from YouTube',
781
        'usage'    => 'HTML5Media streaming from YouTube',
787
        'required' => '0',
782
        'required' => '0',
(-)a/opac/opac-account-pay-paypal-return.pl (-4 / +7 lines)
Lines 24-30 use utf8; Link Here
24
use CGI;
24
use CGI;
25
use HTTP::Request::Common;
25
use HTTP::Request::Common;
26
use LWP::UserAgent;
26
use LWP::UserAgent;
27
use URL::Encode qw(url_params_mixed);
27
use URI;
28
28
29
use C4::Auth;
29
use C4::Auth;
30
use C4::Output;
30
use C4::Output;
Lines 85-94 my $response = $ua->request( POST $url, $nvp_params ); Link Here
85
85
86
my $error = q{};
86
my $error = q{};
87
if ( $response->is_success ) {
87
if ( $response->is_success ) {
88
    my $params = url_params_mixed( $response->decoded_content );
89
88
90
    if ( $params->{ACK} eq "Success" ) {
89
    my $urlencoded = $response->content;
91
        $amount = $params->{PAYMENTINFO_0_AMT};
90
    my %params = URI->new( "?$urlencoded" )->query_form;
91
92
93
    if ( $params{ACK} eq "Success" ) {
94
        $amount = $params{PAYMENTINFO_0_AMT};
92
95
93
        my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline');
96
        my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline');
94
        foreach my $accountlines_id ( @accountlines ) {
97
        foreach my $accountlines_id ( @accountlines ) {
(-)a/opac/opac-account-pay.pl (-8 / +6 lines)
Lines 24-30 use Modern::Perl; Link Here
24
use CGI;
24
use CGI;
25
use HTTP::Request::Common;
25
use HTTP::Request::Common;
26
use LWP::UserAgent;
26
use LWP::UserAgent;
27
use URL::Encode qw(url_encode url_params_mixed);
28
use URI;
27
use URI;
29
28
30
use C4::Auth;
29
use C4::Auth;
Lines 64-71 my $error = 0; Link Here
64
if ( $payment_method eq 'paypal' ) {
63
if ( $payment_method eq 'paypal' ) {
65
    my $ua = LWP::UserAgent->new;
64
    my $ua = LWP::UserAgent->new;
66
65
67
    my $amount = url_encode($amount_to_pay);
68
69
    my $url =
66
    my $url =
70
      C4::Context->preference('PayPalSandboxMode')
67
      C4::Context->preference('PayPalSandboxMode')
71
      ? 'https://api-3t.sandbox.paypal.com/nvp'
68
      ? 'https://api-3t.sandbox.paypal.com/nvp'
Lines 74-80 if ( $payment_method eq 'paypal' ) { Link Here
74
    my $opac_base_url = C4::Context->preference('OPACBaseURL');
71
    my $opac_base_url = C4::Context->preference('OPACBaseURL');
75
72
76
    my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" );
73
    my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" );
77
    $return_url->query_form( { amount => $amount, accountlines => \@accountlines } );
74
    $return_url->query_form( { amount => $amount_to_pay, accountlines => \@accountlines } );
78
75
79
    my $cancel_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account.pl" );
76
    my $cancel_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account.pl" );
80
77
Lines 104-113 if ( $payment_method eq 'paypal' ) { Link Here
104
    my $response = $ua->request( POST $url, $nvp_params );
101
    my $response = $ua->request( POST $url, $nvp_params );
105
102
106
    if ( $response->is_success ) {
103
    if ( $response->is_success ) {
107
        my $params = url_params_mixed( $response->decoded_content );
108
104
109
        if ( $params->{ACK} eq "Success" ) {
105
        my $urlencoded = $response->content;
110
            my $token = $params->{TOKEN};
106
        my %params = URI->new( "?$urlencoded" )->query_form;
107
108
        if ( $params{ACK} eq "Success" ) {
109
            my $token = $params{TOKEN};
111
110
112
            my $redirect_url =
111
            my $redirect_url =
113
              C4::Context->preference('PayPalSandboxMode')
112
              C4::Context->preference('PayPalSandboxMode')
114
- 

Return to bug 16129