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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-3 / +3 lines)
Lines 720-734 OPAC: Link Here
720
                  no: "Production"
720
                  no: "Production"
721
            - "mode."
721
            - "mode."
722
        -
722
        -
723
            - "The email address to recieve PayPal payments is "
723
            - "The email address to receive PayPal payments is "
724
            - pref: PayPalUser
724
            - pref: PayPalUser
725
              class: long
725
              class: long
726
        -
726
        -
727
            - "The password for the PayPal account to recieve payments is "
727
            - "The password for the PayPal account to receive payments is "
728
            - pref: PayPalPwd
728
            - pref: PayPalPwd
729
              class: long
729
              class: long
730
        -
730
        -
731
            - "The signature for the PayPal account to recieve payments is "
731
            - "The signature for the PayPal account to receive payments is "
732
            - pref: PayPalSignature
732
            - pref: PayPalSignature
733
              class: long
733
              class: long
734
        -
734
        -
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account-pay-return.tt (-52 lines)
Lines 1-52 Link Here
1
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your payment
2
[% INCLUDE 'doc-head-close.inc' %]
3
[% BLOCK cssinclude %][% END %]
4
</head>
5
6
<body id="opac-account-pay-return" class="scrollto">
7
[% INCLUDE 'masthead.inc' %]
8
9
<div class="main">
10
    <ul class="breadcrumb">
11
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
12
        <li><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]</a> <span class="divider">&rsaquo;</span></li>
13
        <li><a href="#">Your payment</a></li>
14
    </ul>
15
16
    <div class="container-fluid">
17
        <div class="row-fluid">
18
            <div class="span2">
19
                <div id="navigation">
20
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
21
                </div>
22
            </div>
23
            <div class="span10">
24
                <div id="useraccount" class="maincontent">
25
                    [% IF error %]
26
                        <div id="error" class="dialog alert">
27
                            <p><strong>Error:</strong> there was an problem processing your payment</p>
28
29
                            [% IF error == "PAYPAL_UNABLE_TO_CONNECT" %]
30
                                <p>Unable to connect to PayPal.</p>
31
                                <p>Please try again later.</p>
32
                            [% ELSIF error == "PAYPAL_ERROR_PROCESSING" %]
33
                                <p>Unable to verify payment.</p>
34
                                <p>Please contact the library to verify your payment.</p>
35
                            [% END %]
36
                        </div>
37
                    [% ELSIF amount %]
38
                        <div class="dialog message">
39
                            <p><strong>Payment applied:</strong> your payment of [% amount %] has been applied to your account</p>
40
                        </div>
41
                    [% END %]
42
43
                    <a href="/cgi-bin/koha/opac-account.pl">Return to fine details</a>
44
                </div> <!-- / #useraccount -->
45
            </div> <!-- / .span10 -->
46
        </div> <!-- / .row-fluid -->
47
    </div> <!-- / .container-fluid -->
48
</div> <!-- / .main -->
49
50
[% INCLUDE 'opac-bottom.inc' %]
51
52
[% BLOCK jsinclude %][% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt (+18 lines)
Lines 42-47 Link Here
42
                        </div>
42
                        </div>
43
                    [% END %]
43
                    [% END %]
44
44
45
                    [% IF payment_error %]
46
                        <div id="error" class="dialog alert">
47
                            <p><strong>Error:</strong> there was an problem processing your payment</p>
48
49
                            [% IF payment_error == "PAYPAL_UNABLE_TO_CONNECT" %]
50
                                <p>Unable to connect to PayPal.</p>
51
                                <p>Please contact a librarian to verify your payment.</p>
52
                            [% ELSIF payment_error == "PAYPAL_ERROR_PROCESSING" %]
53
                                <p>Unable to verify payment.</p>
54
                                <p>Please contact a librarian to verify your payment.</p>
55
                            [% END %]
56
                        </div>
57
                    [% ELSIF payment %]
58
                        <div class="alert alert-info">
59
                            <p><strong>Payment applied:</strong> your payment of [% payment %] has been applied to your account</p>
60
                        </div>
61
                    [% END %]
62
45
                    <h3>Fines and charges</h3>
63
                    <h3>Fines and charges</h3>
46
64
47
                    [% IF ( ACCOUNT_LINES ) %]
65
                    [% IF ( ACCOUNT_LINES ) %]
(-)a/opac/opac-account-pay-paypal-return.pl (-4 / +4 lines)
Lines 79-90 my $nvp_params = { Link Here
79
79
80
my $response = $ua->request( POST $url, $nvp_params );
80
my $response = $ua->request( POST $url, $nvp_params );
81
81
82
my $error;
82
if ( $response->is_success ) {
83
if ( $response->is_success ) {
83
    my $params = url_params_mixed( $response->decoded_content );
84
    my $params = url_params_mixed( $response->decoded_content );
84
85
85
    if ( $params->{ACK} eq "Success" ) {
86
    if ( $params->{ACK} eq "Success" ) {
86
        $amount = $params->{PAYMENTINFO_0_AMT};
87
        $amount = $params->{PAYMENTINFO_0_AMT};
87
        $template->param( amount => $amount );
88
88
89
        my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline');
89
        my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline');
90
        foreach my $accountlines_id ( @accountlines ) {
90
        foreach my $accountlines_id ( @accountlines ) {
Lines 93-104 if ( $response->is_success ) { Link Here
93
        }
93
        }
94
    }
94
    }
95
    else {
95
    else {
96
        $template->param( error => "PAYPAL_ERROR_PROCESSING" );
96
       $error = "PAYPAL_ERROR_PROCESSING";
97
    }
97
    }
98
98
99
}
99
}
100
else {
100
else {
101
    $template->param( error => "PAYPAL_UNABLE_TO_CONNECT" );
101
    $error => "PAYPAL_UNABLE_TO_CONNECT";
102
}
102
}
103
103
104
$template->param(
104
$template->param(
Lines 106-109 $template->param( Link Here
106
    accountview => 1
106
    accountview => 1
107
);
107
);
108
108
109
output_html_with_http_headers( $cgi, $cookie, $template->output );
109
print $cgi->redirect("/cgi-bin/koha/opac-account.pl?payment=$amount&payment-error=$error");
(-)a/opac/opac-account.pl (-1 / +2 lines)
Lines 73-78 $template->param( Link Here
73
    accountview   => 1,
73
    accountview   => 1,
74
    message       => $query->param('message') || q{},
74
    message       => $query->param('message') || q{},
75
    message_value => $query->param('message_value') || q{},
75
    message_value => $query->param('message_value') || q{},
76
    payment       => $query->param('payment'),
77
    payment_error => $query->param('payment-error'),
76
);
78
);
77
79
78
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
80
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
79
- 

Return to bug 11622