33 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
67 return self::$instance;
90 $strForValidate = $amount . $orderid . $transactionid . $password;
91 if (md5($strForValidate) == $md5Key) {
108 return md5($cur . $amount . $orderid . $password);
120 $result->epay = $this->pSettings->get(
'epay');
136 else $data = array();
170 $this->server_host = $a_server_host;
180 $this->server_path = $a_server_path;
190 $this->merchant_number = (int) $a_merchant_number;
200 $this->auth_token = $a_auth_token;
211 $this->auth_email = $a_auth_email;
216 return $this->auth_email;
221 if ((!$a_instant_capture == 1) || (!$a_instant_capture==
'1')) $a_instant_capture=0;
else $a_instant_capture=1;
222 $this->instant_capture = $a_instant_capture;
255 if (isset($a[
'server_host'])) $this->
setServerHost($a[
'server_host']);
256 if (isset($a[
'server_path'])) $this->
setServerPath($a[
'server_path']);
257 if (isset($a[
'merchant_number'])) $this->
setMerchantNumber($a[
'merchant_number']);
258 if (isset($a[
'auth_token'])) $this->
setAuthToken($a[
'auth_token']);
259 if (isset($a[
'auth_email'])) $this->
setAuthEmail($a[
'auth_email']);
260 if (isset($a[
'instant_capture'])) $this->
setInstantCapture($a[
'instant_capture']);
270 if ( ($a[
'server_host'] ==
'') || ($a[
'server_path'] ==
'') )
$r =
false;
271 if ( (
int) $a[
'merchant_number'] <= 0 )
$r =
false;
272 if ( ((
int) $a[
'instant_capture'] != 0 ) && ((
int) $a[
'instant_capture'] != 1))
$r =
false;
285 $this->pSettings->set(
'epay', NULL,
'epay');
286 $this->settings = array();
306 $values = $this->
getAll();
307 $this->pSettings->set(
'epay', serialize($values),
'epay');
setInstantCapture($a_instant_capture)
setAll($a)
Set all ePay settings using an array.
setServerHost($a_server_host)
valid()
Check if the current settings looks valid.
validateEPayData($amount, $orderid, $transactionid, $md5Key)
This function validates data received from ePay, and verifies the md5key is valid.
setMerchantNumber($a_merchant_number)
fetchSettingsId()
Fetches and sets the primary key of the payment settings.
static getInstance()
Static method to get the singleton instance.
getSettings()
Called from constructor to fetch settings from database.
setServerPath($a_server_path)
getAll()
Returns array of all epay settings.
clearAll()
Clears the payment settings for the epay payment method.
save()
Inserts or updates (if payment settings already exist) the epay settings data.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
setAuthToken($a_auth_token)
setSettingsId($a_settings_id=0)
generatekeyForEpay($cur, $amount, $orderid)
This function generates a valid MD5 key on the data about to be transmitted to ePay.
__construct()
Constructor.
setAuthEmail($a_auth_email)