public function __construct(Am_Paysystem_Abstract $plugin, Am_Request $request, Zend_Controller_Response_Http $response, $invokeArgs) { $DR = preg_replace("/\\s/", "+", $request->get('DR', $_GET['DR'])); $rc4 = new Crypt_RC4($plugin->getConfig('secret', 'ebskey')); $QueryString = base64_decode($DR); $rc4->decrypt($QueryString); $QueryString = split('&', $QueryString); foreach ($QueryString as $param) { $param = split('=', $param); $request->setParam($param[0], $param[1]); } parent::__construct($plugin, $request, $request, $invokeArgs); }
/** * Success response from Secure Ebs * * @return void */ public function successAction() { if (isset($_GET['DR'])) { $DR = preg_replace("/\\s/", "+", $_GET['DR']); $secret_key = Mage::getSingleton('secureebs/config')->getSecretKey(); // Your Secret Key $rc4 = new Crypt_RC4($secret_key); $QueryString = base64_decode($DR); $rc4->decrypt($QueryString); $QueryString = split('&', $QueryString); $response = array(); foreach ($QueryString as $param) { $param = split('=', $param); $response[$param[0]] = urldecode($param[1]); } } if ($response['ResponseCode'] == 0) { $session = Mage::getSingleton('checkout/session'); $session->setQuoteId($session->getSecureebsStandardQuoteId()); $session->unsSecureebsStandardQuoteId(); $order = $this->getOrder(); if (!$order->getId()) { $this->norouteAction(); return; } $order->addStatusToHistory($order->getStatus(), Mage::helper('secureebs')->__('Customer successfully returned from Secureebs')); $order->save(); //Changes by basant // $order->sendNewOrderEmail(); if ($order->canInvoice()) { /** * Create invoice * The invoice will be in 'Pending' state */ $invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array()); $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoiceId); $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE); /** * Pay invoice * i.e. the invoice state is now changed to 'Paid' */ $invoice->capture()->save(); $invoice->sendEmail(true); } //changes ends $this->_redirect('checkout/onepage/success'); } else { $this->_redirect('secureebs/standard/failure'); } }
public static function jieMi($string) { $key = zmf::config('authorCode'); $plain_text = trim($string); Yii::import('application.vendors.*'); require_once 'rc4crypt.php'; $rc4 = new Crypt_RC4(); $rc4->setKey($key); $text = $plain_text; $x = $rc4->decrypt($text); return $x; }
/** * Deep scan */ private function deepscanAction() { if (file_exists('tmp/corefiles.sql')) { bfLog::log('Found core files - marking them as such'); $this->db->setQuery(file_get_contents('tmp/corefiles.sql')); $this->db->query(); unlink('tmp/corefiles.sql'); $this->saveState(FALSE, __LINE__); } if (file_exists('tmp/hashfailed.sql')) { bfLog::log('Found modified core files - adding to deepscan'); $this->db->setQuery(file_get_contents('tmp/hashfailed.sql')); $this->db->query(); unlink('tmp/hashfailed.sql'); $this->saveState(FALSE, __LINE__); } try { // if we are not complete $this->db->setQuery('SELECT COUNT(*) FROM bf_files WHERE queued = 1'); $queueCount = $this->db->loadResult(); if ($queueCount == 0 && $this->deepscancomplete == TRUE) { // use known md5 100% certain positive hacker files database to flag even more $this->db->setQuery(sprintf('UPDATE bf_files SET suspectcontent = 1 WHERE currenthash IN (%s)', file_get_contents('db/suspectfiles.txt'))); $this->db->query(); $this->deepscancomplete = TRUE; $this->nextStepPlease(); } if (!$queueCount && !$this->deepscancomplete) { bfLog::log('Adding files to the scan queue'); $sql = "SELECT id FROM bf_files\n WHERE\n (\n SIZE < 524288 -- 512k Limit\n AND\n SIZE > 0 -- Must have content!\n )\n AND\n (\n iscorefile = 0 -- No Core Files\n OR\n iscorefile IS NULL -- No Core Files - NULL !== 0 -- IDIOT PHIL!!!!\n OR\n hashfailed = 1 -- Or core files which hash has failed\n )\n AND -- Filter out the probably ok file extensions and other stuff we are 'fairly' happy to ignore\n (\n currenthash != 'f96aa8838dffa02a4a8438f2a8596025' -- ok blank index.html file\n AND currenthash != '86de3aeb6bd953d656a6994eaa495a6d' -- /libraries/fof/autoloader/component.php\n\n AND filewithpath NOT LIKE '/plugins/system/bfnetwork%' -- Our stuff\n AND filewithpath NOT LIKE '%.DS_Store%' -- Mac finder files\n AND filewithpath NOT LIKE '%.zip' -- cant preg_match inside a zip!\n AND filewithpath NOT LIKE '%.gzip' -- cant preg_match inside a zip!\n AND filewithpath NOT LIKE '%.gz' -- cant preg_match inside a zip!\n AND filewithpath NOT LIKE '%.doc'\n AND filewithpath NOT LIKE '%.docx'\n AND filewithpath NOT LIKE '%.xls'\n AND filewithpath NOT LIKE '%.ppt'\n AND filewithpath NOT LIKE '%.pdf'\n AND filewithpath NOT LIKE '%.rtf' -- never seen anything bad in a rtf\n AND filewithpath NOT LIKE '%.mno'\n AND filewithpath NOT LIKE '%.ashx'\n AND filewithpath NOT LIKE '%.png' -- never seen anything bad in a png\n AND filewithpath NOT LIKE '%.psd' -- Photoshop, normally a massive file too\n AND filewithpath NOT LIKE '%.wott' -- font file\n AND filewithpath NOT LIKE '%.ttf' -- font file\n AND filewithpath NOT LIKE '%.css' -- plain text css, never seen Joomla hack in css file\n AND filewithpath NOT LIKE '%.swf' -- flash\n AND filewithpath NOT LIKE '%.flv' -- flash\n AND filewithpath NOT LIKE '%.po' -- language files\n AND filewithpath NOT LIKE '%.mo'\n AND filewithpath NOT LIKE '%.pot'\n AND filewithpath NOT LIKE '%.eot'\n AND filewithpath NOT LIKE '%.ini'\n AND filewithpath NOT LIKE '%.svg'\n AND filewithpath NOT LIKE '%.mpeg' -- No need to audit inside audio files, never seen a Joomla hack in these\n AND filewithpath NOT LIKE '%.mvk' -- No need to audit inside audio files, never seen a Joomla hack in these\n AND filewithpath NOT LIKE '%.mp3' -- No need to audit inside audio files, never seen a Joomla hack in these\n AND filewithpath NOT LIKE '%.less'\n AND filewithpath NOT LIKE '%.sql'\n AND filewithpath NOT LIKE '%.wsdl'\n AND filewithpath NOT LIKE '%.woff'\n AND filewithpath NOT LIKE '%.xml' -- never seen a hack in an xml file\n AND filewithpath NOT LIKE '%.php_expire' -- Expired cache file\n AND filewithpath NOT LIKE '%.jpa' -- Akeeba backup files\n AND filewithpath NOT LIKE '%/akeeba_json.php' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/administrator/components/com_akeeba/backup/akeeba_json' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_backend.id%.php' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_backend.php' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_backend.id%.log' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_backend.log' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_lazy.php' -- Akeeba json state file\n AND filewithpath NOT LIKE '%/akeeba_frontend.php' -- Akeeba json state file\n AND filewithpath NOT LIKE '%error_log' -- PHP error logs, we alert to ALL these in another check\n AND filewithpath NOT LIKE '%/stats/webalizer.current' -- Crappy file\n AND filewithpath NOT LIKE '%/stats/usage_%.html' -- Crappy file\n AND filewithpath NOT LIKE '%/components/libraries/cmslib/cache/cache__%' -- Massive folder of cache files\n AND filewithpath NOT LIKE '%/plugins/system/akgeoip/lib/vendor/guzzle/guzzle/%' -- Akeeba GeoIP Docs\n AND filewithpath NOT LIKE '%/components/com_jce/editor/tiny_mce/plugins/code/img/icons.gif' -- JCE Code icons\n )"; $this->db->setQuery($sql); if (method_exists($this->db, 'loadColumn')) { $ids = $this->db->loadColumn(); } else { $ids = $this->db->loadResultArray(); } bfLog::log($this->db->getErrorMsg()); if (!count($ids)) { bfLog::log('NO FILES TO DEEP SCAN = THIS CANNOT BE POSSIBLE RIGHT?'); $this->db->setQuery($sql); $some = $this->db->query(); } else { $sql = "UPDATE bf_files SET queued = 1 WHERE id IN ( %s )"; if (strlen(sprintf($sql, implode(', ', $ids))) > $this->max_allowed_packet) { $parts = $this->array_split($ids, 4); $sqlToRun1 = sprintf($sql, implode(', ', $parts[0])); bfLog::log('sql size 1= ' . strlen($sqlToRun1)); $this->db->setQuery($sqlToRun1); $this->db->query(); $sqlToRun2 = sprintf($sql, implode(', ', $parts[1])); bfLog::log('sql size 2= ' . strlen($sqlToRun2)); $this->db->setQuery($sqlToRun2); $this->db->query(); $sqlToRun3 = sprintf($sql, implode(', ', $parts[2])); bfLog::log('sql size 3= ' . strlen($sqlToRun3)); $this->db->setQuery($sqlToRun3); $this->db->query(); $sqlToRun4 = sprintf($sql, implode(', ', $parts[3])); bfLog::log('sql size 4= ' . strlen($sqlToRun4)); $this->db->setQuery($sqlToRun4); $this->db->query(); } else { $sql = "UPDATE bf_files SET queued = 1 WHERE id IN\n (\n " . implode(',', $ids) . "\n )"; $this->db->setQuery($sql); $this->db->query(); } } // DEQUEUE known clean files not changed bfLog::log('DONE Adding ' . count($ids) . ' files to the scan queue db table'); // Cache our patterns $pattern = file_get_contents('tmp/tmp.pattern'); if (file_exists('tmp/tmp.pattern.lastmd5')) { $lastPatternmd5 = file_get_contents('tmp/tmp.pattern.lastmd5'); } else { $lastPatternmd5 = ""; } // if encrypted - decrypt if (substr($pattern, 0, 4) == 'RC4:') { $pattern = base64_decode(substr($pattern, 4, strlen($pattern) - 4)); $RC4 = new Crypt_RC4(); $RC4->setKey('NotMeantToBeSecure'); // just to hide from other server side scanners $pattern = $RC4->decrypt($pattern); file_put_contents('tmp/tmp.pattern.lastmd5', md5($pattern)); //file_put_contents('tmp/tmp.pattern.unenc', $pattern); bfLog::log('LAST PATTERN TEST = ' . $lastPatternmd5 . '==' . md5($pattern)); if ($lastPatternmd5 == md5($pattern)) { $doSpeedup = TRUE; } else { $doSpeedup = FALSE; } } // load up the false positives hashes $falsepositives = file_get_contents('./tmp/tmp.false'); if ($doSpeedup && (_BF_SPEED == 'DEFAULT' || _BF_SPEED == 'FAST')) { $this->db->setQuery('SHOW TABLES LIKE "bf_files_last"'); if ($this->db->loadResult()) { $speedupSQL = 'UPDATE bf_files AS NEWTABLE INNER JOIN ( SELECT bf_files_last.filewithpath, bf_files_last.suspectcontent, bf_files_last.falsepositive, bf_files_last.encrypted FROM bf_files_last LEFT JOIN bf_files ON bf_files_last.filewithpath = bf_files.filewithpath WHERE bf_files_last.currenthash = bf_files.currenthash AND bf_files_last.filemtime = bf_files.filemtime AND bf_files_last.fileperms = bf_files.fileperms AND bf_files_last.filewithpath = bf_files.filewithpath ) AS OLDTABLE ON NEWTABLE.filewithpath = OLDTABLE.filewithpath SET NEWTABLE.filewithpath = OLDTABLE.filewithpath, NEWTABLE.suspectcontent = OLDTABLE.suspectcontent, NEWTABLE.falsepositive = OLDTABLE.falsepositive, NEWTABLE.encrypted = OLDTABLE.encrypted, NEWTABLE.queued = 0 WHERE OLDTABLE.suspectcontent != 1 '; file_put_contents('tmp/speedup.sql', $speedupSQL); } } // ok this took a lot of time, so to be careful we will re-tick $this->saveState(FALSE, __LINE__); } $pattern = file_get_contents('tmp/tmp.pattern'); // if encrypted - decrypt if (substr($pattern, 0, 4) == 'RC4:') { $pattern = base64_decode(substr($pattern, 4, strlen($pattern) - 4)); $RC4 = new Crypt_RC4(); $RC4->setKey('NotMeantToBeSecure'); // just to hide from other server side scanners $pattern = $RC4->decrypt($pattern); } // load up the false positives hashes $falsepositives = file_get_contents('./tmp/tmp.false'); if (file_exists('tmp/speedup.sql') && (_BF_SPEED == 'DEFAULT' || _BF_SPEED == 'FAST')) { bfLog::log('Found speedup sql files - removing files to deepscan'); $this->db->setQuery(file_get_contents('tmp/speedup.sql')); $this->db->query(); // force at least one file to be audited to prevent broken loop $this->db->setQuery('UPDATE bf_files SET queued = 1 WHERE filewithpath = "/configuration.php"'); $this->db->query(); unlink('tmp/speedup.sql'); $this->saveState(FALSE, __LINE__); } else { if (file_exists(dirname(__FILE__) . '/tmp/speedup.sql')) { @unlink(dirname(__FILE__) . '/tmp/speedup.sql'); } } // A nice while loop while we have time left if (count($this->getmergedIds())) { $this->db->setQuery("SELECT count(*) FROM bf_files WHERE queued = 1 AND id NOT IN (" . implode(',', $this->getmergedIds()) . ")"); } else { $this->db->setQuery("SELECT COUNT(*) FROM bf_files WHERE queued = 1"); } while ($this->db->loadResult() > 0 && $this->_timer->getTimeLeft() > _BF_CONFIG_DEEPSCAN_TIMER_ONE) { // ok so we have a load of files.... if (count($this->getmergedIds())) { $this->db->setQuery("SELECT * FROM bf_files WHERE queued = 1 AND id NOT IN (" . implode(',', $this->getmergedIds()) . ") ORDER BY id ASC LIMIT " . _BF_CONFIG_DEEPSCAN_COUNT_ONE); } else { $this->db->setQuery("SELECT * FROM bf_files WHERE queued = 1 ORDER BY id ASC LIMIT " . _BF_CONFIG_DEEPSCAN_COUNT_ONE); } $files_to_scan = $this->db->loadObjectList(); // still, while we have files and time left while (count($files_to_scan) && $this->_timer->getTimeLeft() > _BF_CONFIG_DEEPSCAN_TIMER_ONE) { // get one file $file_to_scan = array_pop($files_to_scan); /** * If this is a large JS file like jquery.ui.src.js then we need more time dammit! * Also need to do this on WSDL files for some reason */ $size = filesize(JPATH_BASE . $file_to_scan->filewithpath); if ((strpos($file_to_scan->filewithpath, 'wsdl') || strpos($file_to_scan->filewithpath, 'jquery')) && $this->_timer->getTimeLeft() < 4 || $size > 100000 && (_BF_SPEED != 'DEFAULT' && _BF_SPEED != 'FAST') && $this->_timer->getTimeLeft() < 4) { bfLog::log('Next file is a problematic JS/wsdl is of size ' . $size . ' and we only had ' . $this->_timer->getTimeLeft() . ' left so we are Zzz... and will come back next tick'); $this->updateFilesFromDeepscan(__LINE__); $this->saveState(FALSE, __LINE__); } // toggle if we can safely skip ip $skip = FALSE; // Is this a suspect file $isSuspect = FALSE; // Is this file encrypted $encrypted = FALSE; // Is this a false positive $falsepositive = FALSE; $file_extension = strtolower(pathinfo(JPATH_BASE . $file_to_scan->filewithpath, PATHINFO_EXTENSION)); // If the file no longer exists then skip if (!file_exists(JPATH_BASE . $file_to_scan->filewithpath)) { bfLog::log('FILE WAS SKIPPED AS DOES NOT EXIST!!! ' . $file_to_scan->filewithpath); $skip = TRUE; } if ($skip == FALSE && $file_extension == 'gif') { if ($this->is_ani(JPATH_BASE . $file_to_scan->filewithpath)) { bfLog::log('FILE WAS ANIMATED GIF - skipping ' . $file_to_scan->filewithpath); $skip = TRUE; } } // example skip if ($file_to_scan->filewithpath == '/backups/akeeba_json.php') { bfLog::log('skipping ' . $file_to_scan->filewithpath); $skip = TRUE; } // example skip if ($file_to_scan->filewithpath == '/stats/webalizer.current') { bfLog::log('skipping ' . $file_to_scan->filewithpath); $skip = TRUE; } // example skip if (preg_match('/\\/stats\\/usage_.*\\.html/', $file_to_scan->filewithpath)) { bfLog::log('skipping ' . $file_to_scan->filewithpath); $skip = TRUE; } if ($skip == FALSE) { // If this is in our known false positives list then skip it $lookfor = md5($file_to_scan->filewithpath) . md5_file(JPATH_BASE . $file_to_scan->filewithpath); if (preg_match('/' . $lookfor . '/', $falsepositives)) { $skip = TRUE; $falsepositive = TRUE; bfLog::log('FILE WAS SKIPPED AS FALSE POSITIVE!!! ' . $file_to_scan->filewithpath); } } if ($skip == FALSE && filesize(JPATH_BASE . $file_to_scan->filewithpath) > 524288) { bfLog::log('FILE WAS OVER 1Mb - skipping ' . $file_to_scan->filewithpath); $skip = TRUE; } if ($skip === TRUE) { // mark it as false positive (-2) or skipped (-1) $status = $falsepositive == TRUE ? "-2" : "-1"; $sql = sprintf("UPDATE bf_files SET queued = 0, suspectcontent = %s WHERE id = '%s'", $status, addslashes($file_to_scan->id)); $this->db->setQuery($sql); $this->db->query(); continue; // no more processing on this file - skipped } // cleanup $fff = JPATH_BASE . stripslashes($file_to_scan->filewithpath); // WINDOWS I HATE YOU! - bodge it $fff = str_replace('\\:', '/:', $fff); // need a @ to prevent access denied $chunk = @file_get_contents($fff); // remove stuff that is likely to be marked as suspect, when we are happy its not $chunk = $this->applyStringExceptions($chunk, $file_to_scan); // Not really a chunk now, as we load the whole file into memory if (trim($chunk)) { // Need at least 3 seconds to run the preg_match on // average slow machine if ($this->_timer->getTimeLeft() < _BF_CONFIG_DEEPSCAN_TIMER_TWO) { $this->saveState(FALSE, __LINE__); } // hard to audit c99 clones preg_match('/(auth_pass).*(default_use_ajax)/ism', $chunk, $matches); if (count($matches) >= 3) { $isSuspect = true; } else { // Test if suspect bfLog::log('Auditing File: ' . $file_to_scan->filewithpath . ' - ' . $file_to_scan->size . ' bytes'); $isSuspect = preg_match('/' . $pattern . '/ism', $chunk) ? TRUE : FALSE; } // Test If encrypted $regex = "/OOO000000|if\\(!extension_loaded\\('ionCube\\sLoader'\\)\\)|<\\?php\\s@Zend;|This\\sfile\\swas\\sencoded\\sby\\sthe.*Zend Encoder/i"; $encrypted = preg_match($regex, $chunk) ? 1 : 0; } else { bfLog::log('FILE WAS EMPTY!!! ' . $file_to_scan->filewithpath); } // free up memory unset($chunk); $encrypted == (int) $encrypted; $isSuspect = (int) $isSuspect; if ($encrypted && $isSuspect) { $this->_encryptedAndSuspectIds[] = $file_to_scan->id; } else { if ($encrypted) { $this->_encryptedIds[] = $file_to_scan->id; } else { if ($isSuspect) { $this->_suspectIds[] = $file_to_scan->id; } else { $this->_notencryptedAndSuspectIds[] = $file_to_scan->id; } } } if (_BF_SPEED == 'CRAPPYWEBHOST' || $this->_timer->getTimeLeft() < _BF_CONFIG_DEEPSCAN_TIMER_TWO) { $this->updateFilesFromDeepscan(__LINE__); $this->saveState(FALSE, __LINE__); } } if ($this->_timer->getTimeLeft() < _BF_CONFIG_DEEPSCAN_TIMER_TWO) { $this->updateFilesFromDeepscan(__LINE__); $this->saveState(FALSE, __LINE__); } // needed to go back up to the top of the loop if (count($this->getmergedIds())) { $this->db->setQuery("SELECT count(*) FROM bf_files WHERE queued = 1 AND id NOT IN (" . implode(',', $this->getmergedIds()) . ")"); } else { $this->db->setQuery("SELECT COUNT(*) FROM bf_files WHERE queued = 1"); } } if (count($this->getmergedIds())) { $this->db->setQuery("SELECT count(*) FROM bf_files WHERE queued = 1 AND id NOT IN (" . implode(',', $this->getmergedIds()) . ")"); } else { $this->db->setQuery("SELECT COUNT(*) FROM bf_files WHERE queued = 1"); } if ($this->db->loadResult() == 0) { bfLog::log(' ======== deepscancomplete ========'); $this->deepscancomplete = TRUE; $this->updateFilesFromDeepscan(__LINE__); $this->nextStepPlease(); } else { bfLog::log(' ======== deepscancomplete NOT COMPLETE========'); $this->updateFilesFromDeepscan(__LINE__); $this->saveState(FALSE, __LINE__); } } catch (Exception $e) { // Just continue... if (!defined('_BF_LAST_BREATH')) { define('_BF_LAST_BREATH', $e->getMessage()); } bfLog::log(' ======== EXCEPTION =========' . $e->getMessage()); } }
<?php $secret_key = "7d7e206d9e5b4e491d087828736f4ea8"; // Your Secret Key if (isset($_GET['DR'])) { require 'Rc43.php'; $DR = preg_replace("/\\s/", "+", $_GET['DR']); $rc4 = new Crypt_RC4($secret_key); $QueryString = base64_decode($DR); $rc4->decrypt($QueryString); $QueryString = split('&', $QueryString); $response = array(); foreach ($QueryString as $param) { $param = split('=', $param); $response[$param[0]] = urldecode($param[1]); } } ?> <HTML> <HEAD> <TITLE>Payment Made on E-Billing Solutions Pvt Ltd </TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <style> h1 { font-family:Arial,sans-serif; font-size:24pt; color:#08185A; font-weight:100; margin-bottom:0.1em} h2.co { font-family:Arial,sans-serif; font-size:24pt; color:#FFFFFF; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} h3.co { font-family:Arial,sans-serif; font-size:16pt; color:#000000; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} h3 { font-family:Arial,sans-serif; font-size:16pt; color:#08185A; margin-top:0.1em; margin-bottom:0.1em; font-weight:100} body { font-family:Verdana,Arial,sans-serif; font-size:11px; color:#08185A;} th { font-size:12px;background:#015289;color:#FFFFFF;font-weight:bold;height:30px;} td { font-size:12px;background:#DDE8F3} .pageTitle { font-size:24px;}
function sixscan_common_decrypt_string($encr_data, $key) { if (class_exists('Crypt_RC4') == FALSE) { require_once SIXSCAN_PLUGIN_DIR . "modules/signatures/Crypt/RC4.php"; } $rc4_encr = new Crypt_RC4(); $rc4_encr->setKey($key); return $rc4_encr->decrypt($encr_data); }
/** * Attempts to finalize an accepted transaction * * @result string Should be 'accepted' unless something has gone quite wrong */ public function finalizeOrder($response) { global $smarty, $cart, $cookie; require dirname(__FILE__) . '/Rc43.php'; $DR = $response; $secret_key = Configuration::get('SECRET_KEY'); //print_r($secret_key); if (isset($DR)) { $DR = preg_replace("/\\s/", "+", $DR); $rc4 = new Crypt_RC4($secret_key); $QueryString = base64_decode($DR); $rc4->decrypt($QueryString); $QueryString = split('&', $QueryString); $response = array(); foreach ($QueryString as $param) { $param = split('=', $param); $response[$param[0]] = urldecode($param[1]); } //print_r($response); } $cartID = $response['MerchantRefNo']; $cart = new Cart($cartID); $deliveryAddress = new Address($cart->id_address_delivery); $op = $cod = 0; Carrier::getPreferredCarriers($deliveryAddress->postcode, $cod, $op); if ($op > 0) { $cart->id_carrier = (int) $op; $cart->update(); } if ($response['ResponseCode'] == 0) { $responseMsg = "Your Order has Been Processed"; } else { $responseMsg = "Transaction Failed, Retry!!"; } $cart = new Cart(intval($response['MerchantRefNo'])); //echo "<pre>";print_r($cart); //if (!$cart->id) // return $this->l('Cart not found'); if ($response['ResponseCode'] == 0) { $status = _PS_OS_PREPARATION_; } else { $status = Configuration::get('EBS_ID_ORDER_FAILED'); } $this->validateOrder($response['MerchantRefNo'], $status, $response['Amount'], $this->displayName, $this->l('EBS transaction ID: ') . $response['PaymentID'], $response['ResponseMessage']); $customer = new Customer((int) $cart->id_customer); if ($response['ResponseCode'] == 0) { Tools::redirectLink(__PS_BASE_URI__ . 'order-confirmation.php?key=' . $customer->secure_key . '&id_cart=' . (int) $cart->id . '&id_module=' . (int) $this->id . '&id_order=' . (int) $this->currentOrder); } $smarty->assign(array('this_path' => $this->_path, 'responseMsg' => $responseMsg, 'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'modules/' . $this->name . '/')); }