ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilEPaySettings Class Reference
+ Collaboration diagram for ilEPaySettings:

Public Member Functions

 validateEPayData ($amount, $orderid, $transactionid, $md5Key)
 This function validates data received from ePay, and verifies the md5key is valid.
 generatekeyForEpay ($cur, $amount, $orderid)
 This function generates a valid MD5 key on the data about to be transmitted to ePay.
 setSettingsId ($a_settings_id=0)
 getSettingsId ()
 setServerHost ($a_server_host)
 setServerPath ($a_server_path)
 setMerchantNumber ($a_merchant_number)
 setAuthToken ($a_auth_token)
 setAuthEmail ($a_auth_email)
 setInstantCapture ($a_instant_capture)
 getAll ()
 Returns array of all epay settings.
 setAll ($a)
 Set all ePay settings using an array.
 valid ()
 Check if the current settings looks valid.
 clearAll ()
 Clears the payment settings for the epay payment method.
 save ()
 Inserts or updates (if payment settings already exist) the epay settings data.

Static Public Member Functions

static getInstance ()
 Static method to get the singleton instance.

Data Fields

 $pSettings

Private Member Functions

 __construct ()
 Constructor.
 getSettings ()
 Called from constructor to fetch settings from database.
 fetchSettingsId ()
 Fetches and sets the primary key of the payment settings.
 getServerHost ()
 getServerPath ()
 getMerchantNumber ()
 getAuthToken ()
 getAuthEmail ()
 getInstantCapture ()

Private Attributes

 $db
 $server_host
 $server_path
 $vendor
 $auth_token
 $page_style
 $merchant_number
 $ssl
 $instant_capture

Static Private Attributes

static $instance = null

Detailed Description

Author
Nicolai Lundgaard nicol.nosp@m.ai@i.nosp@m.lias..nosp@m.dk
Jesper Godvad jespe.nosp@m.r@il.nosp@m.ias.d.nosp@m.k
Version
Id:
class.ilPaypalSettings.php 19533 2009-04-03 10:23:37Z nkrzywon

Definition at line 35 of file class.ilEPaySettings.php.

Constructor & Destructor Documentation

ilEPaySettings::__construct ( )
private

Constructor.

Definition at line 74 of file class.ilEPaySettings.php.

References ilPaymentSettings\_getInstance(), and getSettings().

{
$this->pSettings = ilPaymentSettings::_getInstance();
$this->getSettings();
}

+ Here is the call graph for this function:

Member Function Documentation

ilEPaySettings::clearAll ( )

Clears the payment settings for the epay payment method.

public

Definition at line 283 of file class.ilEPaySettings.php.

{
$this->pSettings->set('epay', NULL, 'epay');
$this->settings = array();
// $statement = $this->db->manipulateF('
// UPDATE payment_settings
// SET epay = %s
// WHERE settings_id = %s',
// array('text', 'integer'),
// array('NULL', $this->getSettingsId()));
//
//
// $this->settings = array();
}
ilEPaySettings::fetchSettingsId ( )
private

Fetches and sets the primary key of the payment settings.

private

Definition at line 147 of file class.ilEPaySettings.php.

{
// global $ilDB;
//
// $res = $ilDB->query('SELECT * FROM payment_settings');
//
// $result = $res->fetchRow(DB_FETCHMODE_OBJECT);
//
// $this->setSettingsId($result->settings_id);
}
ilEPaySettings::generatekeyForEpay (   $cur,
  $amount,
  $orderid 
)

This function generates a valid MD5 key on the data about to be transmitted to ePay.

ePay will again verify the data and if the data is not valid and error will be thrown (redirected to decline)

Definition at line 104 of file class.ilEPaySettings.php.

References getAuthToken(), and getSettings().

{
$this->getSettings();
$password = $this->getAuthToken();
return md5($cur . $amount . $orderid . $password);
}

+ Here is the call graph for this function:

ilEPaySettings::getAll ( )

Returns array of all epay settings.

public

Returns
array $values Array of all epay settings

Definition at line 237 of file class.ilEPaySettings.php.

References getAuthEmail(), getAuthToken(), getInstantCapture(), getMerchantNumber(), getServerHost(), and getServerPath().

Referenced by save(), and valid().

{
$values = array(
"server_host" => $this->getServerHost(),
"server_path" => $this->getServerPath(),
"merchant_number" => (int) $this->getMerchantNumber(),
"auth_token" => $this->getAuthToken(),
"auth_email" => $this->getAuthEmail(),
"instant_capture" => $this->getInstantCapture()
);
return $values;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEPaySettings::getAuthEmail ( )
private

Definition at line 214 of file class.ilEPaySettings.php.

Referenced by getAll().

{
return $this->auth_email;
}

+ Here is the caller graph for this function:

ilEPaySettings::getAuthToken ( )
private

Definition at line 203 of file class.ilEPaySettings.php.

References $auth_token.

Referenced by generatekeyForEpay(), getAll(), and validateEPayData().

{
}

+ Here is the caller graph for this function:

static ilEPaySettings::getInstance ( )
static

Static method to get the singleton instance.

public

Returns
object $instance Singular ilBMFSettings instance

Definition at line 60 of file class.ilEPaySettings.php.

References $instance.

Referenced by ilShopShoppingCartGUI\__construct(), ilObjPaymentSettingsGUI\epaySettingsObject(), and ilObjPaymentSettingsGUI\saveEPaySettingsObject().

{
if (!self::$instance)
{
self::$instance = new ilEPaySettings();
}
return self::$instance;
}

+ Here is the caller graph for this function:

ilEPaySettings::getInstantCapture ( )
private

Definition at line 225 of file class.ilEPaySettings.php.

References $instant_capture.

Referenced by getAll().

+ Here is the caller graph for this function:

ilEPaySettings::getMerchantNumber ( )
private

Definition at line 193 of file class.ilEPaySettings.php.

References $merchant_number.

Referenced by getAll().

+ Here is the caller graph for this function:

ilEPaySettings::getServerHost ( )
private

Definition at line 173 of file class.ilEPaySettings.php.

References $server_host.

Referenced by getAll().

{
}

+ Here is the caller graph for this function:

ilEPaySettings::getServerPath ( )
private

Definition at line 183 of file class.ilEPaySettings.php.

References $server_path.

Referenced by getAll().

{
}

+ Here is the caller graph for this function:

ilEPaySettings::getSettings ( )
private

Called from constructor to fetch settings from database.

private

Definition at line 117 of file class.ilEPaySettings.php.

References $data, $result, and setAll().

Referenced by __construct(), generatekeyForEpay(), and validateEPayData().

{
$result->epay = $this->pSettings->get('epay');
// global $ilDB;
//
// $this->fetchSettingsId();
//
// $res = $ilDB->queryf('
// SELECT epay FROM payment_settings WHERE settings_id = %s',
// array('integer'), array($this->getSettingsId()));
//
// $result = $res->fetchRow(DB_FETCHMODE_OBJECT);
$data = array();
if (is_object($result))
{
if ($result->epay != "") $data = unserialize($result->epay);
else $data = array();
}
$this->setAll($data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEPaySettings::getSettingsId ( )

Definition at line 163 of file class.ilEPaySettings.php.

{
// return $this->settings_id;
}
ilEPaySettings::save ( )

Inserts or updates (if payment settings already exist) the epay settings data.

public

Definition at line 304 of file class.ilEPaySettings.php.

References getAll().

{
$values = $this->getAll();
$this->pSettings->set('epay', serialize($values), 'epay');
// global $ilDB;
// if ($this->getSettingsId())
// {
// $statement = $ilDB->manipulateF('
// UPDATE payment_settings
// SET epay = %s
// WHERE settings_id = %s',
// array('text', 'integer'),
// array(serialize($values), $this->getSettingsId()));
//
// }
// else
// {
// $next_id = $ilDB->nextId('payment_settings');
// $statement = $ilDB->manipulateF('
// INSERT INTO payment_settings
// ( settings_id,
// epay)
// VALUES (%s, %s)',
// array('integer','text'), array($next_id, serialize($values)));
//
// $this->setSettingsId($next_id);
// }
}

+ Here is the call graph for this function:

ilEPaySettings::setAll (   $a)

Set all ePay settings using an array.

Definition at line 253 of file class.ilEPaySettings.php.

References setAuthEmail(), setAuthToken(), setInstantCapture(), setMerchantNumber(), setServerHost(), and setServerPath().

Referenced by getSettings().

{
if (isset($a['server_host'])) $this->setServerHost($a['server_host']);
if (isset($a['server_path'])) $this->setServerPath($a['server_path']);
if (isset($a['merchant_number'])) $this->setMerchantNumber($a['merchant_number']);
if (isset($a['auth_token'])) $this->setAuthToken($a['auth_token']);
if (isset($a['auth_email'])) $this->setAuthEmail($a['auth_email']);
if (isset($a['instant_capture'])) $this->setInstantCapture($a['instant_capture']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilEPaySettings::setAuthEmail (   $a_auth_email)

Definition at line 209 of file class.ilEPaySettings.php.

Referenced by setAll().

{
$this->auth_email = $a_auth_email;
}

+ Here is the caller graph for this function:

ilEPaySettings::setAuthToken (   $a_auth_token)

Definition at line 198 of file class.ilEPaySettings.php.

Referenced by setAll().

{
$this->auth_token = $a_auth_token;
}

+ Here is the caller graph for this function:

ilEPaySettings::setInstantCapture (   $a_instant_capture)

Definition at line 219 of file class.ilEPaySettings.php.

Referenced by setAll().

{
if ((!$a_instant_capture == 1) || (!$a_instant_capture== '1')) $a_instant_capture=0; else $a_instant_capture=1;
$this->instant_capture = $a_instant_capture;
}

+ Here is the caller graph for this function:

ilEPaySettings::setMerchantNumber (   $a_merchant_number)

Definition at line 188 of file class.ilEPaySettings.php.

Referenced by setAll().

{
$this->merchant_number = (int) $a_merchant_number;
}

+ Here is the caller graph for this function:

ilEPaySettings::setServerHost (   $a_server_host)

Definition at line 168 of file class.ilEPaySettings.php.

Referenced by setAll().

{
$this->server_host = $a_server_host;
}

+ Here is the caller graph for this function:

ilEPaySettings::setServerPath (   $a_server_path)

Definition at line 178 of file class.ilEPaySettings.php.

Referenced by setAll().

{
$this->server_path = $a_server_path;
}

+ Here is the caller graph for this function:

ilEPaySettings::setSettingsId (   $a_settings_id = 0)

Definition at line 158 of file class.ilEPaySettings.php.

{
// $this->settings_id = $a_settings_id;
}
ilEPaySettings::valid ( )

Check if the current settings looks valid.

Definition at line 266 of file class.ilEPaySettings.php.

References getAll().

{
$r = true;
$a = $this->getAll();
if ( ($a['server_host'] == '') || ($a['server_path'] == '') ) $r = false;
if ( (int) $a['merchant_number'] <= 0 ) $r = false;
if ( ((int) $a['instant_capture'] != 0 ) && ((int) $a['instant_capture'] != 1)) $r = false;
return $r;
}

+ Here is the call graph for this function:

ilEPaySettings::validateEPayData (   $amount,
  $orderid,
  $transactionid,
  $md5Key 
)

This function validates data received from ePay, and verifies the md5key is valid.

Returns
bool

Definition at line 85 of file class.ilEPaySettings.php.

References getAuthToken(), and getSettings().

{
$this->getSettings();
$password = $this->getAuthToken();
$strForValidate = "";
$strForValidate = $amount . $orderid . $transactionid . $password;
if (md5($strForValidate) == $md5Key) {
return true;
}
else {
return false;
}
}

+ Here is the call graph for this function:

Field Documentation

ilEPaySettings::$auth_token
private

Definition at line 46 of file class.ilEPaySettings.php.

Referenced by getAuthToken().

ilEPaySettings::$db
private

Definition at line 37 of file class.ilEPaySettings.php.

ilEPaySettings::$instance = null
staticprivate

Definition at line 52 of file class.ilEPaySettings.php.

Referenced by getInstance().

ilEPaySettings::$instant_capture
private

Definition at line 50 of file class.ilEPaySettings.php.

Referenced by getInstantCapture().

ilEPaySettings::$merchant_number
private

Definition at line 48 of file class.ilEPaySettings.php.

Referenced by getMerchantNumber().

ilEPaySettings::$page_style
private

Definition at line 47 of file class.ilEPaySettings.php.

ilEPaySettings::$pSettings

Definition at line 38 of file class.ilEPaySettings.php.

ilEPaySettings::$server_host
private

Definition at line 43 of file class.ilEPaySettings.php.

Referenced by getServerHost().

ilEPaySettings::$server_path
private

Definition at line 44 of file class.ilEPaySettings.php.

Referenced by getServerPath().

ilEPaySettings::$ssl
private

Definition at line 49 of file class.ilEPaySettings.php.

ilEPaySettings::$vendor
private

Definition at line 45 of file class.ilEPaySettings.php.


The documentation for this class was generated from the following file: