Bug 11622 [QA Followup] - Use Koha's active currency for PayPal

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2015-09-22 08:11:40 -04:00
parent c9840ad918
commit 393d7c66d2
1 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,7 @@ use URI;
use C4::Auth;
use C4::Output;
use C4::Context;
use C4::Budgets qw(GetCurrency);
use Koha::Database;
my $cgi = new CGI;
@ -57,6 +58,8 @@ my $amount_to_pay =
->get_column('amountoutstanding')->sum();
$amount_to_pay = sprintf( "%.2f", $amount_to_pay );
my $active_currency = GetCurrency();
my $error = 0;
if ( $payment_method eq 'paypal' ) {
my $ua = LWP::UserAgent->new;
@ -91,6 +94,7 @@ if ( $payment_method eq 'paypal' ) {
'BRANDNAME' => C4::Context->preference('LibraryName'),
'CANCELURL' => $cancel_url->as_string(),
'RETURNURL' => $return_url->as_string(),
'PAYMENTREQUEST_0_CURRENCYCODE' => $active_currency->{currency},
'PAYMENTREQUEST_0_AMT' => $amount_to_pay,
'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale',
'PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD' => 'InstantPaymentOnly',