Lines 20-25
use strict;
Link Here
|
20 |
# You should have received a copy of the GNU General Public License |
20 |
# You should have received a copy of the GNU General Public License |
21 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
21 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
22 |
|
22 |
|
|
|
23 |
use Try::Tiny; |
24 |
|
23 |
use Koha::Account; |
25 |
use Koha::Account; |
24 |
use Koha::Account::Lines; |
26 |
use Koha::Account::Lines; |
25 |
|
27 |
|
Lines 76-85
sub pay {
Link Here
|
76 |
}; |
78 |
}; |
77 |
} |
79 |
} |
78 |
} |
80 |
} |
79 |
my $pay_response = $account->pay($pay_options); |
81 |
|
|
|
82 |
my $ok = 1; |
83 |
my $pay_response; |
84 |
my $error; |
85 |
try { |
86 |
$pay_response = $account->pay($pay_options); |
87 |
} |
88 |
catch { |
89 |
if ( ref($_) =~ /^Koha::Exceptions/ ) { |
90 |
$ok = 0; |
91 |
$error = $_->description; |
92 |
} |
93 |
else { |
94 |
$_->rethrow; |
95 |
} |
96 |
}; |
97 |
|
80 |
return { |
98 |
return { |
81 |
ok => 1, |
99 |
ok => $ok, |
82 |
pay_response => $pay_response |
100 |
pay_response => $pay_response, |
|
|
101 |
error => $error, |
83 |
}; |
102 |
}; |
84 |
} |
103 |
} |
85 |
|
104 |
|