public function load() { //$this->clear(); if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } $session = JFactory::getSession(); $sessionData = $session->get('paypal', 0, 'vm'); if (!empty($sessionData)) { $data = (object) json_decode($sessionData, true); $this->_selected_method = $data->selected_method; // card information $this->_cc_type = $data->cc_type; $this->_cc_number = tsmCrypt::decrypt($data->cc_number); $this->_cc_cvv = tsmCrypt::decrypt($data->cc_cvv); $this->_cc_expire_month = $data->cc_expire_month; $this->_cc_expire_year = $data->cc_expire_year; $this->_cc_valid = $data->cc_valid; //Customer settings $this->_autobilling_max_amount = $data->autobilling_max_amount; //PayPal Express $this->_token = $data->token; $this->_payer_id = $data->payer_id; $this->_first_name = $data->first_name; $this->_last_name = $data->last_name; $this->_payer_email = $data->payer_email; // $this->_txn_id = $data->txn_id; // $this->_txn_type = $data->txn_type; // $this->_payment_status = $data->payment_status; // $this->_pending_reason = $data->pending_reason; $this->save(); return $data; } }
function decryptFields() { if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } if (isset($this->modified_on) and $this->modified_on != '0000-00-00 00:00:00') { $date = JFactory::getDate($this->modified_on); $date = $date->toUnix(); } else { if (isset($this->created_on) and $this->created_on != '0000-00-00 00:00:00') { $date = JFactory::getDate($this->created_on); $date = $date->toUnix(); } else { $date = 0; } } foreach ($this->_cryptedFields as $field) { if (isset($this->{$field})) { $this->{$field} = tsmCrypt::decrypt($this->{$field}, $date); vmdebug($this->_tbl . ' Field ' . $field . ' encrypted = ' . $this->{$field}); } } }
/** * Retrieve the detail record for the current $id if the data has not already been loaded. * * @author RickG */ function getShipment($id = 0) { if (!empty($id)) { $this->_id = (int) $id; } if (empty($this->_cache[$this->_id])) { $this->_cache[$this->_id] = $this->getTable('shipmentmethods'); $this->_cache[$this->_id]->load((int) $this->_id); if (empty($this->_cache[$this->_id]->tsmart_vendor_id)) { if (!class_exists('tsmartModelVendor')) { require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php'; } $this->_cache[$this->_id]->tsmart_vendor_id = tsmartModelVendor::getLoggedVendor(); } if ($this->_cache[$this->_id]->shipment_jplugin_id) { JPluginHelper::importPlugin('vmshipment'); $dispatcher = JDispatcher::getInstance(); $blind = 0; $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsShipmentVM3', array(&$this->_cache[$this->_id])); } if (!empty($this->_cache[$this->_id]->_varsToPushParam)) { tsmTable::bindParameterable($this->_cache[$this->_id], 'shipment_params', $this->_cache[$this->_id]->_varsToPushParam); } //We still need this, because the table is already loaded, but the keys are set later if ($this->_cache[$this->_id]->getCryptedFields()) { if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } if (isset($this->_cache[$this->_id]->modified_on)) { $date = JFactory::getDate($this->_cache[$this->_id]->modified_on); $date = $date->toUnix(); } else { $date = 0; } foreach ($this->_cache[$this->_id]->getCryptedFields() as $field) { if (isset($this->_cache[$this->_id]->{$field})) { $this->_cache[$this->_id]->{$field} = tsmCrypt::decrypt($this->_cache[$this->_id]->{$field}, $date); } } } /* Add the shipmentcarreir shoppergroups */ $q = 'SELECT `tsmart_shoppergroup_id` FROM #__tsmart_shipmentmethod_shoppergroups WHERE `tsmart_shipmentmethod_id` = "' . $this->_id . '"'; $this->_db->setQuery($q); $this->_cache[$this->_id]->tsmart_shoppergroup_ids = $this->_db->loadColumn(); if (empty($this->_cache[$this->_id]->tsmart_shoppergroup_ids)) { $this->_cache[$this->_id]->tsmart_shoppergroup_ids = 0; } } return $this->_cache[$this->_id]; }
public static function getBgManagerId() { if (!isset(self::$_cuId)) { $cuId = JFactory::getSession()->get('vmAdminID', null); //echo $cuId; if ($cuId) { if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } $cuId = tsmCrypt::decrypt($cuId); if (empty($cuId)) { $cuId = null; } } self::$_cuId = $cuId; } return self::$_cuId; }
function getMd($cryptedMd) { if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } $decryptedMd = tsmCrypt::decrypt($cryptedMd); $md = json_decode($decryptedMd, true); return $md; }
function _getAuthorizeNetFromSession() { if (!class_exists('tsmCrypt')) { require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'tsmcrypt.php'; } $session = JFactory::getSession(); $authorizenetSession = $session->get('authorizenet', 0, 'vm'); if (!empty($authorizenetSession)) { $authorizenetData = (object) json_decode($authorizenetSession, true); $this->_cc_type = $authorizenetData->cc_type; $this->_cc_number = tsmCrypt::decrypt($authorizenetData->cc_number); $this->_cc_cvv = tsmCrypt::decrypt($authorizenetData->cc_cvv); $this->_cc_expire_month = $authorizenetData->cc_expire_month; $this->_cc_expire_year = $authorizenetData->cc_expire_year; $this->_cc_valid = $authorizenetData->cc_valid; } }
private function getRetourParams($cryptedParams) { if (!class_exists('tsmCrypt')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmcrypt.php'; } $cryptedParams = base64_decode($cryptedParams); $params = tsmCrypt::decrypt($cryptedParams); $paramsArray = explode(":", $params); $retourParams['virtuemart_paymentmethod_id'] = $paramsArray[0]; $retourParams['order_number'] = $paramsArray[1]; $retourParams['context'] = $paramsArray[2]; return $retourParams; }