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

(-)a/opac/opac-account-pay-paypal-return.pl (-3 / +3 lines)
Lines 30-37 use C4::Auth; Link Here
30
use C4::Output;
30
use C4::Output;
31
use C4::Accounts;
31
use C4::Accounts;
32
use C4::Members;
32
use C4::Members;
33
use C4::Budgets qw(GetCurrency);
34
use Koha::Database;
33
use Koha::Database;
34
use Koha::Acquisition::Currencies;
35
35
36
my $cgi = new CGI;
36
my $cgi = new CGI;
37
37
Lines 50-56 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
50
    }
50
    }
51
);
51
);
52
52
53
my $active_currency = GetCurrency();
53
my $active_currency = Koha::Acquisition::Currencies->get_active;
54
54
55
my $token    = $cgi->param('token');
55
my $token    = $cgi->param('token');
56
my $payer_id = $cgi->param('PayerID');
56
my $payer_id = $cgi->param('PayerID');
Lines 78-84 my $nvp_params = { Link Here
78
    'PAYERID'                        => $payer_id,
78
    'PAYERID'                        => $payer_id,
79
    'TOKEN'                          => $token,
79
    'TOKEN'                          => $token,
80
    'PAYMENTREQUEST_0_AMT'           => $amount,
80
    'PAYMENTREQUEST_0_AMT'           => $amount,
81
    'PAYMENTREQUEST_0_CURRENCYCODE'  => $active_currency->{currency},
81
    'PAYMENTREQUEST_0_CURRENCYCODE'  => $active_currency ? $active_currency->currency : undef,
82
};
82
};
83
83
84
my $response = $ua->request( POST $url, $nvp_params );
84
my $response = $ua->request( POST $url, $nvp_params );
(-)a/opac/opac-account-pay.pl (-4 / +3 lines)
Lines 30-37 use URI; Link Here
30
use C4::Auth;
30
use C4::Auth;
31
use C4::Output;
31
use C4::Output;
32
use C4::Context;
32
use C4::Context;
33
use C4::Budgets qw(GetCurrency);
34
use Koha::Database;
33
use Koha::Database;
34
use Koha::Acquisition::Currencies;
35
35
36
my $cgi = new CGI;
36
my $cgi = new CGI;
37
37
Lines 58-64 my $amount_to_pay = Link Here
58
  ->get_column('amountoutstanding')->sum();
58
  ->get_column('amountoutstanding')->sum();
59
$amount_to_pay = sprintf( "%.2f", $amount_to_pay );
59
$amount_to_pay = sprintf( "%.2f", $amount_to_pay );
60
60
61
my $active_currency = GetCurrency();
61
my $active_currency = Koha::Acquisition::Currencies->get_active;
62
62
63
my $error = 0;
63
my $error = 0;
64
if ( $payment_method eq 'paypal' ) {
64
if ( $payment_method eq 'paypal' ) {
Lines 94-100 if ( $payment_method eq 'paypal' ) { Link Here
94
        'BRANDNAME'                             => C4::Context->preference('LibraryName'),
94
        'BRANDNAME'                             => C4::Context->preference('LibraryName'),
95
        'CANCELURL'                             => $cancel_url->as_string(),
95
        'CANCELURL'                             => $cancel_url->as_string(),
96
        'RETURNURL'                             => $return_url->as_string(),
96
        'RETURNURL'                             => $return_url->as_string(),
97
        'PAYMENTREQUEST_0_CURRENCYCODE'         => $active_currency->{currency},
97
        'PAYMENTREQUEST_0_CURRENCYCODE'         => $active_currency ? $active_currency->currency : undef,
98
        'PAYMENTREQUEST_0_AMT'                  => $amount_to_pay,
98
        'PAYMENTREQUEST_0_AMT'                  => $amount_to_pay,
99
        'PAYMENTREQUEST_0_PAYMENTACTION'        => 'Sale',
99
        'PAYMENTREQUEST_0_PAYMENTACTION'        => 'Sale',
100
        'PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD' => 'InstantPaymentOnly',
100
        'PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD' => 'InstantPaymentOnly',
101
- 

Return to bug 15987