Skip to content
Snippets Groups Projects
Commit 56b9c3b1 authored by Frank Morgner's avatar Frank Morgner
Browse files

refs #12489

* add ILS Libero method payAnyFee.jsp to LiberoDingTrait.php
* balances all fees of user in one action
parent a8364396
No related merge requests found
...@@ -111,7 +111,7 @@ trait LiberoDingTrait ...@@ -111,7 +111,7 @@ trait LiberoDingTrait
* @return boolean Returns true if a connection exists * @return boolean Returns true if a connection exists
* @throws \Exception Throws ILSException * @throws \Exception Throws ILSException
*/ */
public function checkLiberoDingConnection () public function checkLiberoDingConnection()
{ {
$http_header['User-Agent'] $http_header['User-Agent']
= 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
...@@ -149,6 +149,46 @@ trait LiberoDingTrait ...@@ -149,6 +149,46 @@ trait LiberoDingTrait
return !($details['liberoPing']["soTimeout"] || $details['liberoPing']["connectionTimeout"]); return !($details['liberoPing']["soTimeout"] || $details['liberoPing']["connectionTimeout"]);
} }
/**
* Balance (pay all) fines of user at account
*
* @param array $patron Patron object
* @param int $amount Paid fees in eurocent
*
* @return boolean True if passed, false if ILS request fails
* @access public
* @throws ILSException
*/
public function balanceFinesOfUser($patron, $amount)
{
$params = $this->_getLiberoDingRequestParams();
$params['memberCode'] = $patron['cat_username'];
$params['password'] = $patron['cat_password'];
$params['amount'] = $amount;
try {
$result = $this->httpService->get(
$this->getWebScraperUrl() .'payAnyFee.jsp',
$params,
null,
$this->_getLiberoDingRequestHeaders()
);
} catch (\Exception $e) {
throw new ILSException($e->getMessage());
}
if (!$result->isSuccess()) {
// log error for debugging
$this->debug(
'HTTP status ' . $result->getStatusCode() .
' received'
);
return false;
}
return $this->_getLiberoDingResultBool($result);
}
/** /**
* Get Libero system messages for a given patron * Get Libero system messages for a given patron
* *
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment