Lines 93-103
if ( $response->is_success ) {
Link Here
|
93 |
if ( $params{ACK} eq "Success" ) { |
93 |
if ( $params{ACK} eq "Success" ) { |
94 |
$amount = $params{PAYMENTINFO_0_AMT}; |
94 |
$amount = $params{PAYMENTINFO_0_AMT}; |
95 |
|
95 |
|
96 |
my $accountlines_rs = Koha::Database->new()->schema()->resultset('Accountline'); |
96 |
my $account = Koha::Account->new( { patron_id => $borrowernumber } ); |
97 |
foreach my $accountlines_id ( @accountlines ) { |
97 |
my @lines = Koha::Account::Lines->search( |
98 |
my $accountline = $accountlines_rs->find( $accountlines_id ); |
98 |
{ |
99 |
makepayment( $accountlines_id, $borrowernumber, undef, $accountline->amountoutstanding, undef, undef, 'PayPal' ); |
99 |
accountlines_id => { -in => \@accountlines } |
100 |
} |
100 |
} |
|
|
101 |
); |
102 |
|
103 |
$account->pay( |
104 |
{ |
105 |
amount => $amount, |
106 |
lines => \@lines, |
107 |
note => 'PayPal' |
108 |
} |
109 |
); |
101 |
} |
110 |
} |
102 |
else { |
111 |
else { |
103 |
$error = "PAYPAL_ERROR_PROCESSING"; |
112 |
$error = "PAYPAL_ERROR_PROCESSING"; |
104 |
- |
|
|