Version Notes
- Fraud status created when order request is cached
- Timeout added for non-final statuses and for orders which isn't sent to eye4fraud, this fix overflow issue for unprocessed orders
- Changed internal logic for statuses, now they are saved to DB everytime
- Access to logfile added to extension settings
- Short info about extension cron task added to extension settings
Download this release
Release Info
Developer | Shloimy Stauber |
Extension | Eye4Fraud_Connector_integration |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.3
- app/code/local/Eye4Fraud/Connector/Helper/Data.php +74 -6
- app/code/local/Eye4Fraud/Connector/Model/Config/Backend/Data.php +0 -38
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Authorizenet.php +11 -3
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Cron.php +91 -0
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Grid.php +14 -4
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Logfile.php +27 -0
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Payflowpro.php +12 -4
- app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Paypaluk.php +13 -4
- app/code/local/Eye4Fraud/Connector/Model/Observer.php +37 -13
- app/code/local/Eye4Fraud/Connector/Model/Resource/Status/Collection.php +89 -11
- app/code/local/Eye4Fraud/Connector/Model/Status.php +31 -23
- app/code/local/Eye4Fraud/Connector/changes.txt +16 -0
- app/code/local/Eye4Fraud/Connector/controllers/Eye4fraudController.php +43 -0
- app/code/local/Eye4Fraud/Connector/etc/config.xml +21 -5
- app/code/local/Eye4Fraud/Connector/etc/system.xml +67 -24
- app/code/local/Eye4Fraud/Connector/sql/eye4fraud_setup/upgrade-1.2.2-1.2.3.php +17 -0
- app/locale/en_US/Eye4Fraud_Connector.csv +5 -2
- package.xml +9 -9
app/code/local/Eye4Fraud/Connector/Helper/Data.php
CHANGED
@@ -24,7 +24,7 @@ class Eye4Fraud_Connector_Helper_Data
|
|
24 |
* List of statuses allowed to save in DB
|
25 |
* @var array
|
26 |
*/
|
27 |
-
protected $finalStatuses = array('A','D','I','C','F','M','INV','ALW');
|
28 |
|
29 |
/**
|
30 |
* Returns store config item
|
@@ -60,6 +60,20 @@ class Eye4Fraud_Connector_Helper_Data
|
|
60 |
Mage::log($txt, null, $this->_logFile, $force);
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
/**
|
64 |
* Checks config to see if module is enabled
|
65 |
* @return boolean
|
@@ -71,7 +85,7 @@ class Eye4Fraud_Connector_Helper_Data
|
|
71 |
}
|
72 |
|
73 |
$config = $this->getConfig();
|
74 |
-
return !isset($config['
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -88,7 +102,7 @@ class Eye4Fraud_Connector_Helper_Data
|
|
88 |
*/
|
89 |
public function isDebug(){
|
90 |
$config = $this->getConfig();
|
91 |
-
return !isset($config['
|
92 |
}
|
93 |
|
94 |
/**
|
@@ -456,7 +470,7 @@ class Eye4Fraud_Connector_Helper_Data
|
|
456 |
curl_close($ch);
|
457 |
|
458 |
//Log $code for bad response if in debug mode
|
459 |
-
if ($
|
460 |
$this->log("=== E4F Observer::send() Error, \$response NOT ok ===");
|
461 |
$this->log("Code: $code");
|
462 |
}
|
@@ -486,14 +500,22 @@ class Eye4Fraud_Connector_Helper_Data
|
|
486 |
/** @var Eye4Fraud_Connector_Model_Resource_Requests_Cache_Collection $cache */
|
487 |
$cache = Mage::getResourceModel('eye4fraud_connector/requests_cache_collection');
|
488 |
$cache->addFieldToFilter('attempts',array('lt'=>$this->_request_attempts));
|
489 |
-
$cache->addFieldToFilter('sent_time', array('lt'=>Mage::getModel('core/date')->date('Y-m-d H:i:s',time()
|
490 |
$cache->load();
|
491 |
|
492 |
$this->log('Requests to send found: '.$cache->count());
|
493 |
foreach($cache as $request){
|
|
|
494 |
/** @var Eye4Fraud_Connector_Model_Request $request */
|
495 |
-
$result = $this->send(
|
496 |
if($result=='ok'){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
$request->delete();
|
498 |
}
|
499 |
else{
|
@@ -568,4 +590,50 @@ class Eye4Fraud_Connector_Helper_Data
|
|
568 |
}
|
569 |
return $result;
|
570 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
}
|
24 |
* List of statuses allowed to save in DB
|
25 |
* @var array
|
26 |
*/
|
27 |
+
protected $finalStatuses = array('A','D','I','C','F','M','INV','ALW', 'Q');
|
28 |
|
29 |
/**
|
30 |
* Returns store config item
|
60 |
Mage::log($txt, null, $this->_logFile, $force);
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* Get log file size
|
65 |
+
* @return int|string
|
66 |
+
*/
|
67 |
+
public function getLogSize() {
|
68 |
+
$log_file_path = Mage::getBaseDir('log').'/'.$this->_logFile;
|
69 |
+
if(!file_exists($log_file_path)) return 0;
|
70 |
+
return $this->fileSizeConvert(filesize($log_file_path));
|
71 |
+
}
|
72 |
+
|
73 |
+
public function getLogFilePath(){
|
74 |
+
return Mage::getBaseDir('log').'/'.$this->_logFile;
|
75 |
+
}
|
76 |
+
|
77 |
/**
|
78 |
* Checks config to see if module is enabled
|
79 |
* @return boolean
|
85 |
}
|
86 |
|
87 |
$config = $this->getConfig();
|
88 |
+
return !isset($config['general']['enabled']) ? false : (bool)$config['general']['enabled'];
|
89 |
}
|
90 |
|
91 |
/**
|
102 |
*/
|
103 |
public function isDebug(){
|
104 |
$config = $this->getConfig();
|
105 |
+
return !isset($config['general']['debug_mode']) ? false : (bool)$config['general']['debug_mode'];
|
106 |
}
|
107 |
|
108 |
/**
|
470 |
curl_close($ch);
|
471 |
|
472 |
//Log $code for bad response if in debug mode
|
473 |
+
if ($code != 200) {
|
474 |
$this->log("=== E4F Observer::send() Error, \$response NOT ok ===");
|
475 |
$this->log("Code: $code");
|
476 |
}
|
500 |
/** @var Eye4Fraud_Connector_Model_Resource_Requests_Cache_Collection $cache */
|
501 |
$cache = Mage::getResourceModel('eye4fraud_connector/requests_cache_collection');
|
502 |
$cache->addFieldToFilter('attempts',array('lt'=>$this->_request_attempts));
|
503 |
+
$cache->addFieldToFilter('sent_time', array('lt'=>Mage::getModel('core/date')->date('Y-m-d H:i:s',time()-$this->_request_sent_delay*60)));
|
504 |
$cache->load();
|
505 |
|
506 |
$this->log('Requests to send found: '.$cache->count());
|
507 |
foreach($cache as $request){
|
508 |
+
$request_data = unserialize($request->getData('request_data'));
|
509 |
/** @var Eye4Fraud_Connector_Model_Request $request */
|
510 |
+
$result = $this->send($request_data);
|
511 |
if($result=='ok'){
|
512 |
+
$status = Mage::getModel('eye4fraud_connector/status');
|
513 |
+
$status->load($request_data['OrderNumber']);
|
514 |
+
if($status->isEmpty()){
|
515 |
+
$this->log('Status for order #'.$request_data['OrderNumber'].' not found. Create new.');
|
516 |
+
$status->createQueued($request_data['OrderNumber']);
|
517 |
+
}
|
518 |
+
$status->setWaitingStatus()->save();
|
519 |
$request->delete();
|
520 |
}
|
521 |
else{
|
590 |
}
|
591 |
return $result;
|
592 |
}
|
593 |
+
|
594 |
+
|
595 |
+
/**
|
596 |
+
* Converts bytes into human readable file size.
|
597 |
+
*
|
598 |
+
* @param string $bytes
|
599 |
+
* @return string human readable file size (2,87 Мб)
|
600 |
+
* @author Mogilev Arseny
|
601 |
+
*/
|
602 |
+
protected function fileSizeConvert($bytes){
|
603 |
+
$bytes = floatval($bytes);
|
604 |
+
$arBytes = array(
|
605 |
+
0 => array(
|
606 |
+
"UNIT" => "TB",
|
607 |
+
"VALUE" => pow(1024, 4)
|
608 |
+
),
|
609 |
+
1 => array(
|
610 |
+
"UNIT" => "GB",
|
611 |
+
"VALUE" => pow(1024, 3)
|
612 |
+
),
|
613 |
+
2 => array(
|
614 |
+
"UNIT" => "MB",
|
615 |
+
"VALUE" => pow(1024, 2)
|
616 |
+
),
|
617 |
+
3 => array(
|
618 |
+
"UNIT" => "KB",
|
619 |
+
"VALUE" => 1024
|
620 |
+
),
|
621 |
+
4 => array(
|
622 |
+
"UNIT" => "B",
|
623 |
+
"VALUE" => 1
|
624 |
+
),
|
625 |
+
);
|
626 |
+
$result = $bytes;
|
627 |
+
foreach($arBytes as $arItem)
|
628 |
+
{
|
629 |
+
if($bytes >= $arItem["VALUE"])
|
630 |
+
{
|
631 |
+
$result = $bytes / $arItem["VALUE"];
|
632 |
+
$result = str_replace(".", "," , strval(round($result, 2)))." ".$arItem["UNIT"];
|
633 |
+
break;
|
634 |
+
}
|
635 |
+
}
|
636 |
+
return $result;
|
637 |
+
}
|
638 |
+
|
639 |
}
|
app/code/local/Eye4Fraud/Connector/Model/Config/Backend/Data.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Backend model of system variable
|
5 |
-
* @category Eye4fraud
|
6 |
-
* @package Eye4fraud_Connector
|
7 |
-
*/
|
8 |
-
class Eye4Fraud_Connector_Model_Config_Backend_Data extends Mage_Core_Model_Config_Data
|
9 |
-
{
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Add availability call after load as public
|
13 |
-
*/
|
14 |
-
public function afterLoad()
|
15 |
-
{
|
16 |
-
$this->setData('checked','1');
|
17 |
-
$this->setData('value','2');
|
18 |
-
$this->_afterLoad();
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Disable load
|
23 |
-
* @param int $id
|
24 |
-
* @param null $field
|
25 |
-
* @return $this
|
26 |
-
*/
|
27 |
-
public function load($id, $field=null){
|
28 |
-
return $this;
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Disable save
|
33 |
-
* @return $this
|
34 |
-
*/
|
35 |
-
public function save(){
|
36 |
-
return $this;
|
37 |
-
}
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Authorizenet.php
CHANGED
@@ -15,10 +15,18 @@ class Eye4Fraud_Connector_Model_Config_Frontend_Authorizenet extends Mage_Adminh
|
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::helper('payment')->getMethodInstance('authorizenet');
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
$html = parent::render($element);
|
21 |
-
|
22 |
return $html;
|
23 |
}
|
24 |
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::helper('payment')->getMethodInstance('authorizenet');
|
18 |
+
$rewrite_status = method_exists($model, 'getResponseData');
|
19 |
+
$element->setData('value', '[dummy]');
|
20 |
+
|
21 |
+
if($rewrite_status){
|
22 |
+
$value = '<img src="'.$this->getSkinUrl('images/fam_bullet_success.gif').'" style="margin-bottom: -5px;">';
|
23 |
+
}
|
24 |
+
else{
|
25 |
+
$value = '<img src="'.$this->getSkinUrl('images/error_msg_icon.gif').'" style="margin-bottom: -5px;">';
|
26 |
+
$element->setData('comment', get_class($model));
|
27 |
+
}
|
28 |
$html = parent::render($element);
|
29 |
+
$html = str_replace('[dummy]', $value, $html);
|
30 |
return $html;
|
31 |
}
|
32 |
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Cron.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Extension cron status
|
5 |
+
* @category Eye4fraud
|
6 |
+
* @package Eye4fraud_Connector
|
7 |
+
*/
|
8 |
+
class Eye4Fraud_Connector_Model_Config_Frontend_Cron extends Mage_Adminhtml_Block_System_Config_Form_Field
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Render config field
|
12 |
+
*
|
13 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
14 |
+
* @return string
|
15 |
+
*/
|
16 |
+
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
+
|
18 |
+
$cron_task_finished = $this->getCronFinishedTask();
|
19 |
+
$cron_task_pending = $this->getCronPendingTask();
|
20 |
+
|
21 |
+
$helper = Mage::helper('eye4fraud_connector');
|
22 |
+
$requestInterval = intval($helper->getConfig("cron_settings/update_interval"));
|
23 |
+
|
24 |
+
$value = '';
|
25 |
+
if(!$cron_task_finished->isEmpty()){
|
26 |
+
$color = 'green';
|
27 |
+
$tooltip = '';
|
28 |
+
if($cron_task_finished->getData('finished_at')){
|
29 |
+
$finished_interval = time() - strtotime($cron_task_finished->getData('finished_at'));
|
30 |
+
if($finished_interval > ($requestInterval*60+3)) {
|
31 |
+
$color = 'red';
|
32 |
+
$tooltip = 'Task finished more than '.$requestInterval.'m ago';
|
33 |
+
}
|
34 |
+
}
|
35 |
+
$value .= '<div>Last cron task finished at <span style="color: '.$color.'" title="'.$tooltip.'">'.$cron_task_finished->getData('finished_at').'</span></div>';
|
36 |
+
}
|
37 |
+
else{
|
38 |
+
$value .= '<div>Finished cron task not found</div>';
|
39 |
+
}
|
40 |
+
|
41 |
+
if(!$cron_task_pending->isEmpty()){
|
42 |
+
$color = 'green';
|
43 |
+
$tooltip = '';
|
44 |
+
if($cron_task_pending->getData('scheduled_at')){
|
45 |
+
$pending_interval = strtotime($cron_task_pending->getData('scheduled_at')) - time();
|
46 |
+
if($pending_interval < 0) {
|
47 |
+
$color = 'red';
|
48 |
+
$tooltip = 'Task scheduled time is in the past';
|
49 |
+
}
|
50 |
+
}
|
51 |
+
$value .= '<div>Cron task scheduled at <span style="color: '.$color.'" title="'.$tooltip.'">'.$cron_task_pending->getData('scheduled_at').'</span></div>';
|
52 |
+
}
|
53 |
+
else{
|
54 |
+
$value .= '<div>Scheduled cron task <strong>NOT</strong> found</div>';
|
55 |
+
}
|
56 |
+
|
57 |
+
$value .= '<input type="hidden" value="0" id="eye4fraud_connector_cron_settings_cron_task">';
|
58 |
+
|
59 |
+
$element->setData('value', '[dummy]');
|
60 |
+
$html = parent::render($element);
|
61 |
+
$html = str_replace('[dummy]',$value, $html);
|
62 |
+
return $html;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Get Last finished cron task
|
67 |
+
* @return Mage_Cron_Model_Schedule|Varien_Object
|
68 |
+
*/
|
69 |
+
protected function getCronFinishedTask(){
|
70 |
+
/** @var Mage_Cron_Model_Resource_Schedule_Collection $collection */
|
71 |
+
$collection = Mage::getModel('cron/schedule')->getCollection();
|
72 |
+
$collection->addFieldToFilter('job_code', 'eye4fraud_refresh');
|
73 |
+
$collection->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_SUCCESS);
|
74 |
+
$collection->setOrder('finished_at', Mage_Cron_Model_Resource_Schedule_Collection::SORT_ORDER_DESC);
|
75 |
+
return $collection->getFirstItem();
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Get first pending cron task
|
80 |
+
* @return Mage_Cron_Model_Schedule|Varien_Object
|
81 |
+
*/
|
82 |
+
protected function getCronPendingTask(){
|
83 |
+
/** @var Mage_Cron_Model_Resource_Schedule_Collection $collection */
|
84 |
+
$collection = Mage::getModel('cron/schedule')->getCollection();
|
85 |
+
$collection->addFieldToFilter('job_code', 'eye4fraud_refresh');
|
86 |
+
$collection->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_PENDING);
|
87 |
+
$collection->setOrder('scheduled_at', Mage_Cron_Model_Resource_Schedule_Collection::SORT_ORDER_ASC);
|
88 |
+
return $collection->getFirstItem();
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Grid.php
CHANGED
@@ -16,10 +16,20 @@ class Eye4Fraud_Connector_Model_Config_Frontend_Grid extends Mage_Adminhtml_Bloc
|
|
16 |
*/
|
17 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
18 |
$order_grid = Mage::getBlockSingleton('adminhtml/sales_order_grid');
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
return $html;
|
24 |
}
|
25 |
}
|
16 |
*/
|
17 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
18 |
$order_grid = Mage::getBlockSingleton('adminhtml/sales_order_grid');
|
19 |
+
|
20 |
+
$rewrite_status = is_a($order_grid, 'Eye4Fraud_Connector_Block_Sales_Order_Grid');
|
21 |
+
$element->setData('value', '[dummy]');
|
22 |
+
|
23 |
+
if($rewrite_status){
|
24 |
+
$value = '<img src="'.$this->getSkinUrl('images/fam_bullet_success.gif').'" style="margin-bottom: -5px;">';
|
25 |
+
}
|
26 |
+
else{
|
27 |
+
$value = '<img src="'.$this->getSkinUrl('images/error_msg_icon.gif').'" style="margin-bottom: -5px;">';
|
28 |
+
$element->setData('comment', get_class($order_grid));
|
29 |
+
}
|
30 |
+
$html = parent::render($element);
|
31 |
+
$html = str_replace('[dummy]', $value, $html);
|
32 |
+
|
33 |
return $html;
|
34 |
}
|
35 |
}
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Logfile.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* System setting field rewrite
|
5 |
+
* @category Eye4fraud
|
6 |
+
* @package Eye4fraud_Connector
|
7 |
+
*/
|
8 |
+
class Eye4Fraud_Connector_Model_Config_Frontend_Logfile extends Mage_Adminhtml_Block_System_Config_Form_Field
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Render config field
|
12 |
+
*
|
13 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
14 |
+
* @return string
|
15 |
+
*/
|
16 |
+
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
+
$helper = Mage::helper('eye4fraud_connector');
|
18 |
+
$logfile_size = $helper->getLogSize();
|
19 |
+
if(!$logfile_size) return $this->__('Log file not exists or empty');
|
20 |
+
$element->setData('value', '[dummy]');
|
21 |
+
$html = parent::render($element);
|
22 |
+
$value = '<a href="'.$this->getUrl('*/eye4fraud/logfile').'" target="_blank">Download</a> <input type="hidden" value="0" id="eye4fraud_connector_general_debug_file"><span>Log file size: '.$logfile_size.'</span>';
|
23 |
+
$html = str_replace('[dummy]',$value, $html);
|
24 |
+
return $html;
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Payflowpro.php
CHANGED
@@ -15,10 +15,18 @@ class Eye4Fraud_Connector_Model_Config_Frontend_Payflowpro extends Mage_Adminhtm
|
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::helper('payment')->getMethodInstance('verisign');
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
return $html;
|
23 |
}
|
24 |
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::helper('payment')->getMethodInstance('verisign');
|
18 |
+
$rewrite_status = is_a($model, 'Eye4Fraud_Connector_Model_Payflowpro');
|
19 |
+
$element->setData('value', '[dummy]');
|
20 |
+
|
21 |
+
if($rewrite_status){
|
22 |
+
$value = '<img src="'.$this->getSkinUrl('images/fam_bullet_success.gif').'" style="margin-bottom: -5px;">';
|
23 |
+
}
|
24 |
+
else{
|
25 |
+
$value = '<img src="'.$this->getSkinUrl('images/error_msg_icon.gif').'" style="margin-bottom: -5px;">';
|
26 |
+
$element->setData('comment', get_class($model));
|
27 |
+
}
|
28 |
+
$html = parent::render($element);
|
29 |
+
$html = str_replace('[dummy]', $value, $html);
|
30 |
return $html;
|
31 |
}
|
32 |
|
app/code/local/Eye4Fraud/Connector/Model/Config/Frontend/Paypaluk.php
CHANGED
@@ -15,10 +15,19 @@ class Eye4Fraud_Connector_Model_Config_Frontend_Paypaluk extends Mage_Adminhtml_
|
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::getModel('paypaluk/api_nvp');
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
return $html;
|
23 |
}
|
24 |
|
15 |
*/
|
16 |
public function render(Varien_Data_Form_Element_Abstract $element){
|
17 |
$model = Mage::getModel('paypaluk/api_nvp');
|
18 |
+
|
19 |
+
$rewrite_status = is_a($model, 'Eye4Fraud_Connector_Model_PaypalUk_Api_Nvp');
|
20 |
+
$element->setData('value', '[dummy]');
|
21 |
+
|
22 |
+
if($rewrite_status){
|
23 |
+
$value = '<img src="'.$this->getSkinUrl('images/fam_bullet_success.gif').'" style="margin-bottom: -5px;">';
|
24 |
+
}
|
25 |
+
else{
|
26 |
+
$value = '<img src="'.$this->getSkinUrl('images/error_msg_icon.gif').'" style="margin-bottom: -5px;">';
|
27 |
+
$element->setData('comment', get_class($model));
|
28 |
+
}
|
29 |
+
$html = parent::render($element);
|
30 |
+
$html = str_replace('[dummy]', $value, $html);
|
31 |
return $html;
|
32 |
}
|
33 |
|
app/code/local/Eye4Fraud/Connector/Model/Observer.php
CHANGED
@@ -243,6 +243,30 @@ class Eye4Fraud_Connector_Model_Observer
|
|
243 |
$card_type = $payment->getData('cc_type');
|
244 |
break;
|
245 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
default:
|
247 |
$transId = $payment->getLastTransId();
|
248 |
if ($helper->badTransId($transId)) {
|
@@ -286,6 +310,9 @@ class Eye4Fraud_Connector_Model_Observer
|
|
286 |
$semail = $bemail;
|
287 |
}
|
288 |
|
|
|
|
|
|
|
289 |
$shippingMethod = $order->getShippingMethod(false);
|
290 |
$post_array = array(
|
291 |
'SiteName' => $config["api_settings"]['api_site_name'],
|
@@ -469,7 +496,11 @@ class Eye4Fraud_Connector_Model_Observer
|
|
469 |
}
|
470 |
}
|
471 |
else{
|
|
|
472 |
$this->_getHelper()->prepareRequest($post_array, $payment_method);
|
|
|
|
|
|
|
473 |
}
|
474 |
} catch (Exception $e) {
|
475 |
$this->_getHelper()->log($e->getMessage() . "\n" . $e->getTraceAsString());
|
@@ -481,8 +512,7 @@ class Eye4Fraud_Connector_Model_Observer
|
|
481 |
* Returns the module helper. Initializes one if not already set.
|
482 |
* @return Eye4fraud_Connector_Helper_Data $this->_helper
|
483 |
*/
|
484 |
-
protected function _getHelper()
|
485 |
-
{
|
486 |
if (empty($this->_helper)) {
|
487 |
$this->_helper = Mage::helper("eye4fraud_connector");
|
488 |
}
|
@@ -493,12 +523,11 @@ class Eye4Fraud_Connector_Model_Observer
|
|
493 |
* Prepare fraud statuses to display in orders grid
|
494 |
* @param array $event
|
495 |
*/
|
496 |
-
public function prepareFraudStatuses($event)
|
497 |
-
{
|
498 |
if (!Mage::helper('core/data')->isModuleOutputEnabled('Eye4Fraud_Connector')) return;
|
499 |
if (!$this->_getHelper()->isEnabled()) return;
|
500 |
|
501 |
-
/** @var Mage_Sales_Model_Resource_Order_Grid_Collection $
|
502 |
$ordersCollection = $event['order_grid_collection'];
|
503 |
$statuses = array();
|
504 |
foreach ($ordersCollection as $order) $statuses[$order['increment_id']] = 0;
|
@@ -521,16 +550,10 @@ class Eye4Fraud_Connector_Model_Observer
|
|
521 |
|
522 |
if(!$helper->getConfig("cron_settings/enabled")) return;
|
523 |
|
524 |
-
$finalStatuses = $helper->getFinalStatuses();
|
525 |
-
$requestInterval = $helper->getConfig("cron_settings/update_interval");
|
526 |
-
$requestInterval || $requestInterval = 60;
|
527 |
-
$maxDate = Mage::getModel('core/date')->date('Y-m-d H:i:s', time() - $requestInterval*60);
|
528 |
-
|
529 |
$statusesCollection = Mage::getResourceSingleton('eye4fraud_connector/status_collection');
|
530 |
-
$statusesCollection->
|
531 |
-
->notOlderThan($maxDate)->limitRecordsCount(50)->setCronFlag(true);
|
532 |
$records_count = $statusesCollection->count();
|
533 |
-
$helper->log("
|
534 |
|
535 |
$helper->log("Cron job finished ".date("d-m-Y H:i"));
|
536 |
}
|
@@ -540,6 +563,7 @@ class Eye4Fraud_Connector_Model_Observer
|
|
540 |
*/
|
541 |
public function sendRequestsManual(){
|
542 |
$helper = Mage::helper('eye4fraud_connector');
|
|
|
543 |
$helper->log("Send request manually");
|
544 |
|
545 |
$helper->sendRequests();
|
243 |
$card_type = $payment->getData('cc_type');
|
244 |
break;
|
245 |
}
|
246 |
+
case Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS:
|
247 |
+
case Mage_Paypal_Model_Config::METHOD_WPP_PE_EXPRESS:{
|
248 |
+
// Workaround about shipping name in one string
|
249 |
+
if(!$shipping->getLastname()){
|
250 |
+
$firstname_match = strpos($shipping->getFirstname(), $billing->getFirstname())!==false;
|
251 |
+
$lastname_match = strpos($shipping->getFirstname(), $billing->getLastname())!==false;
|
252 |
+
if($firstname_match and $lastname_match){
|
253 |
+
$shipping->setFirstname($billing->getFirstname());
|
254 |
+
$shipping->setLastname($billing->getLastname());
|
255 |
+
}
|
256 |
+
else{
|
257 |
+
$parts = explode(" ", $shipping->getFirstname());
|
258 |
+
if(count($parts)==2){
|
259 |
+
$shipping->setFirstname($parts[0]);
|
260 |
+
$shipping->setLastname($parts[1]);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
264 |
+
$transId = $payment->getLastTransId();
|
265 |
+
if ($helper->badTransId($transId)) {
|
266 |
+
$transId = $payment->getCcTransId();
|
267 |
+
}
|
268 |
+
break;
|
269 |
+
}
|
270 |
default:
|
271 |
$transId = $payment->getLastTransId();
|
272 |
if ($helper->badTransId($transId)) {
|
310 |
$semail = $bemail;
|
311 |
}
|
312 |
|
313 |
+
/** Clear cc number if it not right */
|
314 |
+
$cc_number = preg_replace("/\D*/",'',$cc_number);
|
315 |
+
|
316 |
$shippingMethod = $order->getShippingMethod(false);
|
317 |
$post_array = array(
|
318 |
'SiteName' => $config["api_settings"]['api_site_name'],
|
496 |
}
|
497 |
}
|
498 |
else{
|
499 |
+
$helper->log("Prepare and queue request for order #".$post_array['OrderNumber']);
|
500 |
$this->_getHelper()->prepareRequest($post_array, $payment_method);
|
501 |
+
$status = Mage::getModel('eye4fraud_connector/status');
|
502 |
+
$status->createQueued($post_array['OrderNumber']);
|
503 |
+
$status->save();
|
504 |
}
|
505 |
} catch (Exception $e) {
|
506 |
$this->_getHelper()->log($e->getMessage() . "\n" . $e->getTraceAsString());
|
512 |
* Returns the module helper. Initializes one if not already set.
|
513 |
* @return Eye4fraud_Connector_Helper_Data $this->_helper
|
514 |
*/
|
515 |
+
protected function _getHelper(){
|
|
|
516 |
if (empty($this->_helper)) {
|
517 |
$this->_helper = Mage::helper("eye4fraud_connector");
|
518 |
}
|
523 |
* Prepare fraud statuses to display in orders grid
|
524 |
* @param array $event
|
525 |
*/
|
526 |
+
public function prepareFraudStatuses($event){
|
|
|
527 |
if (!Mage::helper('core/data')->isModuleOutputEnabled('Eye4Fraud_Connector')) return;
|
528 |
if (!$this->_getHelper()->isEnabled()) return;
|
529 |
|
530 |
+
/** @var Mage_Sales_Model_Resource_Order_Grid_Collection $collection */
|
531 |
$ordersCollection = $event['order_grid_collection'];
|
532 |
$statuses = array();
|
533 |
foreach ($ordersCollection as $order) $statuses[$order['increment_id']] = 0;
|
550 |
|
551 |
if(!$helper->getConfig("cron_settings/enabled")) return;
|
552 |
|
|
|
|
|
|
|
|
|
|
|
553 |
$statusesCollection = Mage::getResourceSingleton('eye4fraud_connector/status_collection');
|
554 |
+
$statusesCollection->prepareCronUpdateQuery();
|
|
|
555 |
$records_count = $statusesCollection->count();
|
556 |
+
$helper->log("Processed records: ".json_encode($records_count));
|
557 |
|
558 |
$helper->log("Cron job finished ".date("d-m-Y H:i"));
|
559 |
}
|
563 |
*/
|
564 |
public function sendRequestsManual(){
|
565 |
$helper = Mage::helper('eye4fraud_connector');
|
566 |
+
$helper->log("Start from orders grid");
|
567 |
$helper->log("Send request manually");
|
568 |
|
569 |
$helper->sendRequests();
|
app/code/local/Eye4Fraud/Connector/Model/Resource/Status/Collection.php
CHANGED
@@ -41,6 +41,32 @@ class Eye4Fraud_Connector_Model_Resource_Status_Collection extends Mage_Core_Mod
|
|
41 |
return $this;
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
/**
|
45 |
* Select all statuses except
|
46 |
* @param $statuses
|
@@ -57,12 +83,17 @@ class Eye4Fraud_Connector_Model_Resource_Status_Collection extends Mage_Core_Mod
|
|
57 |
* @param $timestamp
|
58 |
* @return $this
|
59 |
*/
|
60 |
-
public function
|
61 |
$this->getSelect()->where('updated_at < ?',$timestamp);
|
62 |
return $this;
|
63 |
}
|
64 |
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
66 |
$this->getSelect()->limit($limit);
|
67 |
return $this;
|
68 |
}
|
@@ -82,12 +113,15 @@ class Eye4Fraud_Connector_Model_Resource_Status_Collection extends Mage_Core_Mod
|
|
82 |
*/
|
83 |
protected function _afterLoad(){
|
84 |
parent::_afterLoad();
|
|
|
|
|
|
|
85 |
$helper = Mage::helper("eye4fraud_connector");
|
86 |
$isCronEnabled = $helper->getConfig('cron_settings/enabled');
|
87 |
-
|
88 |
foreach ($this->_items as $item) {
|
89 |
/** @var Eye4Fraud_Connector_Model_Status $item */
|
90 |
-
if((!$isCronEnabled
|
91 |
$this->statuses[$item->getData('order_id')] = 0;
|
92 |
}
|
93 |
else $this->statuses[$item->getData('order_id')] = 1;
|
@@ -111,6 +145,36 @@ class Eye4Fraud_Connector_Model_Resource_Status_Collection extends Mage_Core_Mod
|
|
111 |
return $this;
|
112 |
}
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
/**
|
115 |
* Get fraud status from status Model
|
116 |
* @param Mage_Sales_Model_Order $order
|
@@ -141,22 +205,36 @@ class Eye4Fraud_Connector_Model_Resource_Status_Collection extends Mage_Core_Mod
|
|
141 |
$helper = Mage::helper('eye4fraud_connector');
|
142 |
$description = $fraudStatusItem->getData('description');
|
143 |
$updateMinutes = 0;
|
|
|
|
|
|
|
144 |
if($helper->getConfig('cron_settings/enabled')=="1" and !in_array($fraudStatusItem->getData('status'), $helper->getFinalStatuses())){
|
145 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
146 |
-
$updateMinutes = round(($currentTimestamp - strtotime($fraudStatusItem->getData('updated_at')))/60,
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
150 |
if($updateMinutes<60) $text = $updateMinutes."m";
|
151 |
else{
|
152 |
$updateMinutes = round($updateMinutes/60,2);
|
153 |
$text = $updateMinutes."h";
|
154 |
}
|
155 |
-
|
|
|
156 |
}
|
157 |
-
return $renderedValue;
|
158 |
}
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
161 |
|
162 |
/**
|
41 |
return $this;
|
42 |
}
|
43 |
|
44 |
+
/**
|
45 |
+
* Prepare collection for cron update
|
46 |
+
*/
|
47 |
+
public function prepareCronUpdateQuery(){
|
48 |
+
$helper = Mage::helper('eye4fraud_connector');
|
49 |
+
|
50 |
+
$finalStatuses = $helper->getFinalStatuses();
|
51 |
+
$requestInterval = $helper->getConfig("cron_settings/update_interval");
|
52 |
+
$requestInterval || $requestInterval = 60;
|
53 |
+
$maxDate = Mage::getModel('core/date')->date('Y-m-d H:i:s', time() - $requestInterval*60);
|
54 |
+
|
55 |
+
$update_limit = $helper->getConfig("general/update_limit");
|
56 |
+
$update_limit || $update_limit = 5;
|
57 |
+
$minDate = Mage::getModel('core/date')->date('Y-m-d H:i:s', time() - $update_limit*60*60*24);
|
58 |
+
|
59 |
+
$update_limit_no_order = $helper->getConfig("general/update_limit_no_order");
|
60 |
+
$update_limit_no_order || $update_limit_no_order = 2;
|
61 |
+
$minDateNoOrder = Mage::getModel('core/date')->date('Y-m-d H:i:s', time() - $update_limit_no_order*60*60);
|
62 |
+
|
63 |
+
$this->exceptStatuses($finalStatuses)
|
64 |
+
->updatedBefore($maxDate)->notOlderThan($minDate, $minDateNoOrder)
|
65 |
+
->limitRecordsCount(50)->setCronFlag(true);
|
66 |
+
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
/**
|
71 |
* Select all statuses except
|
72 |
* @param $statuses
|
83 |
* @param $timestamp
|
84 |
* @return $this
|
85 |
*/
|
86 |
+
public function updatedBefore($timestamp){
|
87 |
$this->getSelect()->where('updated_at < ?',$timestamp);
|
88 |
return $this;
|
89 |
}
|
90 |
|
91 |
+
public function notOlderThan($update_limit, $update_limit_no_order){
|
92 |
+
$this->getSelect()->where('(created_at > "'.$update_limit.'" and status!="N") or (created_at > "'.$update_limit_no_order.'" and status="N")');
|
93 |
+
return $this;
|
94 |
+
}
|
95 |
+
|
96 |
+
public function limitRecordsCount($limit){
|
97 |
$this->getSelect()->limit($limit);
|
98 |
return $this;
|
99 |
}
|
113 |
*/
|
114 |
protected function _afterLoad(){
|
115 |
parent::_afterLoad();
|
116 |
+
// if($this->_cronFlag) {
|
117 |
+
// Mage::helper("eye4fraud_connector")->log($this->getSelect()->assemble());
|
118 |
+
// }
|
119 |
$helper = Mage::helper("eye4fraud_connector");
|
120 |
$isCronEnabled = $helper->getConfig('cron_settings/enabled');
|
121 |
+
|
122 |
foreach ($this->_items as $item) {
|
123 |
/** @var Eye4Fraud_Connector_Model_Status $item */
|
124 |
+
if($this->_cronFlag or (!$isCronEnabled and $this->isItemUpdateAllowed($item))){
|
125 |
$this->statuses[$item->getData('order_id')] = 0;
|
126 |
}
|
127 |
else $this->statuses[$item->getData('order_id')] = 1;
|
145 |
return $this;
|
146 |
}
|
147 |
|
148 |
+
/**
|
149 |
+
* Check if status can be updated by its current status and creation date
|
150 |
+
* @param Eye4Fraud_Connector_Model_Status $item
|
151 |
+
* @return bool
|
152 |
+
*/
|
153 |
+
protected function isItemUpdateAllowed($item){
|
154 |
+
$helper = Mage::helper("eye4fraud_connector");
|
155 |
+
$final_statuses = $helper->getFinalStatuses();
|
156 |
+
$is_status_final = in_array($item['status'],$final_statuses);
|
157 |
+
|
158 |
+
$update_allowed_by_date = false;
|
159 |
+
if($item->getData('status')=='N'){
|
160 |
+
$update_limit_no_order = $helper->getConfig("general/update_limit_no_order");
|
161 |
+
$update_limit_no_order || $update_limit_no_order = 2;
|
162 |
+
$minDateNoOrder = time() - $update_limit_no_order*60*60;
|
163 |
+
$created_at = strtotime($item->getData('created_at'));
|
164 |
+
if($created_at > $minDateNoOrder) $update_allowed_by_date = true;
|
165 |
+
}
|
166 |
+
else{
|
167 |
+
$update_limit = $helper->getConfig("general/update_limit");
|
168 |
+
$update_limit || $update_limit = 5;
|
169 |
+
$minDate = time() - $update_limit*60*60*24;
|
170 |
+
$created_at = strtotime($item->getData('created_at'));
|
171 |
+
if($created_at > $minDate) $update_allowed_by_date = true;
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
return (!$is_status_final and $update_allowed_by_date);
|
176 |
+
}
|
177 |
+
|
178 |
/**
|
179 |
* Get fraud status from status Model
|
180 |
* @param Mage_Sales_Model_Order $order
|
205 |
$helper = Mage::helper('eye4fraud_connector');
|
206 |
$description = $fraudStatusItem->getData('description');
|
207 |
$updateMinutes = 0;
|
208 |
+
$color = 'inherit';
|
209 |
+
$title = '';
|
210 |
+
if(in_array($fraudStatusItem->getData('status'), $helper->getFinalStatuses())) $color = 'green';
|
211 |
if($helper->getConfig('cron_settings/enabled')=="1" and !in_array($fraudStatusItem->getData('status'), $helper->getFinalStatuses())){
|
212 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
213 |
+
$updateMinutes = round(($currentTimestamp - strtotime($fraudStatusItem->getData('updated_at')))/60,2);
|
214 |
+
$created_interval = round(($currentTimestamp - strtotime($fraudStatusItem->getData('created_at')))/60/60/24, 3);
|
215 |
+
|
216 |
+
$update_interval = floatval($helper->getConfig('cron_settings/update_interval'));
|
217 |
+
$update_limit = floatval($helper->getConfig('general/update_limit'));
|
218 |
+
if($fraudStatusItem->getData('status')!='N' and $updateMinutes > $update_interval and $created_interval < $update_limit){
|
219 |
if($updateMinutes<60) $text = $updateMinutes."m";
|
220 |
else{
|
221 |
$updateMinutes = round($updateMinutes/60,2);
|
222 |
$text = $updateMinutes."h";
|
223 |
}
|
224 |
+
$title = "Updated ".$text." ago";
|
225 |
+
$color = "red";
|
226 |
}
|
|
|
227 |
}
|
228 |
+
$info_mark = '';
|
229 |
+
if($renderedValue!=$description){
|
230 |
+
$info_mark = '<img style="vertical-align:middle; margin-top:-3px;" src="'.Mage::getDesign()->getSkinUrl('images/i_question-mark.png').'" title="'.$description.'"/>';
|
231 |
+
}
|
232 |
+
//$refresh_button = '<img style="vertical-align:middle; margin-top:-3px;" src="'.Mage::getDesign()->getSkinUrl('images/fam_refresh.gif').'" title="Refresh"/>';
|
233 |
+
$html = '<div><span style="color: '.$color.'" title="'.$title.'">'.$renderedValue.'</span>'.$info_mark.'</div>';
|
234 |
+
|
235 |
+
|
236 |
+
//$html .= '<button type="button"><img src="'.Mage::getDesign()->getSkinUrl('images/fam_refresh.gif').'"></button>';
|
237 |
+
return $html;
|
238 |
}
|
239 |
|
240 |
/**
|
app/code/local/Eye4Fraud/Connector/Model/Status.php
CHANGED
@@ -9,10 +9,8 @@ class Eye4Fraud_Connector_Model_Status extends Mage_Core_Model_Abstract
|
|
9 |
{
|
10 |
protected $_eventPrefix = 'eye4fraud_connector_status';
|
11 |
|
12 |
-
protected function _construct()
|
13 |
-
{
|
14 |
$this->_init('eye4fraud_connector/status');
|
15 |
-
$this->_dataSaveAllowed = false;
|
16 |
}
|
17 |
|
18 |
/**
|
@@ -30,10 +28,14 @@ class Eye4Fraud_Connector_Model_Status extends Mage_Core_Model_Abstract
|
|
30 |
if(isset($fraudData['error']) and $fraudData['error']){
|
31 |
$this->setData('error', true);
|
32 |
}
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
$this->setData('description', $fraudData['Description']);
|
36 |
$this->setData('updated_at', Mage::getModel('core/date')->date('Y-m-d H:i:s'));
|
|
|
37 |
/**
|
38 |
* A little hack to restore order_id field after model was saved
|
39 |
*/
|
@@ -43,6 +45,30 @@ class Eye4Fraud_Connector_Model_Status extends Mage_Core_Model_Abstract
|
|
43 |
return $this;
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* Set or get flag is object new
|
48 |
* @param null $flag
|
@@ -53,22 +79,4 @@ class Eye4Fraud_Connector_Model_Status extends Mage_Core_Model_Abstract
|
|
53 |
return parent::isObjectNew($flag);
|
54 |
}
|
55 |
|
56 |
-
protected function _beforeSave(){
|
57 |
-
parent::_beforeSave();
|
58 |
-
$saveStatuses = Mage::helper('eye4fraud_connector')->getFinalStatuses();
|
59 |
-
if(in_array($this->getData('status'), $saveStatuses)) $this->_dataSaveAllowed = true;
|
60 |
-
$cron_enabled = Mage::helper('eye4fraud_connector')->getConfig('cron_settings/enabled');
|
61 |
-
if($cron_enabled) $this->_dataSaveAllowed = true;
|
62 |
-
if($this->isEmpty()){
|
63 |
-
/** @var Eye4Fraud_Connector_Model_Status $statusObject */
|
64 |
-
$statusObject = Mage::getModel('eye4fraud_connector/status');
|
65 |
-
$statusObject->load($this->getData('order_id'));
|
66 |
-
if(!$statusObject->isEmpty()){
|
67 |
-
Mage::helper("eye4fraud_connector")->log('Order #'.$this->getData('order_id').' already inserted');
|
68 |
-
$this->setData($statusObject->getData());
|
69 |
-
$this->_dataSaveAllowed = false;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
return $this;
|
73 |
-
}
|
74 |
}
|
9 |
{
|
10 |
protected $_eventPrefix = 'eye4fraud_connector_status';
|
11 |
|
12 |
+
protected function _construct(){
|
|
|
13 |
$this->_init('eye4fraud_connector/status');
|
|
|
14 |
}
|
15 |
|
16 |
/**
|
28 |
if(isset($fraudData['error']) and $fraudData['error']){
|
29 |
$this->setData('error', true);
|
30 |
}
|
31 |
+
$status = $fraudData['StatusCode'];
|
32 |
+
if($fraudData['StatusCode']=='E' and strpos($fraudData['Description'], 'No Order')!==false){
|
33 |
+
$status = 'N';
|
34 |
+
}
|
35 |
+
$this->setData('status', $status);
|
36 |
$this->setData('description', $fraudData['Description']);
|
37 |
$this->setData('updated_at', Mage::getModel('core/date')->date('Y-m-d H:i:s'));
|
38 |
+
if(!$this->getOrigData('created_at')) $this->setData('created_at', Mage::getModel('core/date')->date('Y-m-d H:i:s'));
|
39 |
/**
|
40 |
* A little hack to restore order_id field after model was saved
|
41 |
*/
|
45 |
return $this;
|
46 |
}
|
47 |
|
48 |
+
/**
|
49 |
+
* Create queued status after request was cached
|
50 |
+
* @param string $order_id
|
51 |
+
* @return $this
|
52 |
+
*/
|
53 |
+
public function createQueued($order_id){
|
54 |
+
$this->setData('order_id', $order_id);
|
55 |
+
$this->setData('status', 'Q');
|
56 |
+
$this->setData('description', 'Request Queued');
|
57 |
+
$this->setData('updated_at', Mage::getModel('core/date')->date('Y-m-d H:i:s'));
|
58 |
+
$this->setData('created_at', Mage::getModel('core/date')->date('Y-m-d H:i:s'));
|
59 |
+
$this->isObjectNew(true);
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Changes status to Awaiting Response and allow to save
|
65 |
+
*/
|
66 |
+
public function setWaitingStatus(){
|
67 |
+
$this->setData('status', 'W');
|
68 |
+
$this->setData('description', 'Waiting Update');
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
/**
|
73 |
* Set or get flag is object new
|
74 |
* @param null $flag
|
79 |
return parent::isObjectNew($flag);
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
app/code/local/Eye4Fraud/Connector/changes.txt
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
Changes list:
|
4 |
+
|
5 |
+
1.2.3:
|
6 |
+
- Fraud status created when order request is cached
|
7 |
+
- Timeout added for non-final statuses and for orders which isn't sent to eye4fraud, this fix overflow issue for unprocessed orders
|
8 |
+
- Changed internal logic for statuses, now they are saved to DB everytime
|
9 |
+
- Access to logfile added to extension settings
|
10 |
+
- Short info about extension cron task added to extension settings
|
11 |
+
|
12 |
+
1.2.1:
|
13 |
+
- Clear received card number from non-digits before extracting first 6 digits
|
14 |
+
|
15 |
+
|
16 |
+
1.2.0;
|
app/code/local/Eye4Fraud/Connector/controllers/Eye4fraudController.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Eye4fraud admin area controller
|
5 |
+
*
|
6 |
+
* @category Eye4Fraud
|
7 |
+
* @package Eye4Fraud_Connector
|
8 |
+
* @author Michael
|
9 |
+
*/
|
10 |
+
class Eye4Fraud_Connector_Eye4fraudController extends Mage_Adminhtml_Controller_Action
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Customer addresses list
|
15 |
+
*/
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
echo "nothingness is there....";
|
19 |
+
exit;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Remove saved card
|
24 |
+
*/
|
25 |
+
public function logfileAction(){
|
26 |
+
header("Content-type: text/plain");
|
27 |
+
header("Content-Disposition: attachment; filename=eye4fraud_debug.log");
|
28 |
+
|
29 |
+
$helper = Mage::helper("eye4fraud_connector");
|
30 |
+
if(!$helper->getLogSize()) return;
|
31 |
+
|
32 |
+
$file_path = $helper->getLogFilePath();
|
33 |
+
if(!file_exists($file_path)) return;
|
34 |
+
|
35 |
+
$f = fopen($file_path, 'r');
|
36 |
+
while (!feof($f)) {
|
37 |
+
echo fgets($f);
|
38 |
+
}
|
39 |
+
|
40 |
+
fclose($f);
|
41 |
+
exit;
|
42 |
+
}
|
43 |
+
}
|
app/code/local/Eye4Fraud/Connector/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Eye4Fraud_Connector>
|
13 |
-
<version>1.2.
|
14 |
</Eye4Fraud_Connector>
|
15 |
</modules>
|
16 |
<global>
|
@@ -20,7 +20,7 @@
|
|
20 |
</eye4fraud_connector>
|
21 |
</helpers>
|
22 |
<events>
|
23 |
-
<
|
24 |
<observers>
|
25 |
<connector_observer>
|
26 |
<type>singleton</type>
|
@@ -28,7 +28,7 @@
|
|
28 |
<method>sendRequestsManual</method>
|
29 |
</connector_observer>
|
30 |
</observers>
|
31 |
-
</
|
32 |
<sales_order_place_after>
|
33 |
<observers>
|
34 |
<connector_observer>
|
@@ -116,12 +116,28 @@
|
|
116 |
</global>
|
117 |
<default>
|
118 |
<eye4fraud_connector>
|
|
|
|
|
|
|
|
|
|
|
119 |
<cron_settings>
|
120 |
-
<enabled>
|
121 |
-
<update_interval>
|
122 |
</cron_settings>
|
123 |
</eye4fraud_connector>
|
124 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
<adminhtml>
|
126 |
<translate>
|
127 |
<modules>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Eye4Fraud_Connector>
|
13 |
+
<version>1.2.3</version>
|
14 |
</Eye4Fraud_Connector>
|
15 |
</modules>
|
16 |
<global>
|
20 |
</eye4fraud_connector>
|
21 |
</helpers>
|
22 |
<events>
|
23 |
+
<controller_action_predispatch_adminhtml_sales_order_index>
|
24 |
<observers>
|
25 |
<connector_observer>
|
26 |
<type>singleton</type>
|
28 |
<method>sendRequestsManual</method>
|
29 |
</connector_observer>
|
30 |
</observers>
|
31 |
+
</controller_action_predispatch_adminhtml_sales_order_index>
|
32 |
<sales_order_place_after>
|
33 |
<observers>
|
34 |
<connector_observer>
|
116 |
</global>
|
117 |
<default>
|
118 |
<eye4fraud_connector>
|
119 |
+
<general>
|
120 |
+
<enabled>1</enabled>
|
121 |
+
<update_limit>7</update_limit>
|
122 |
+
<update_limit_no_order>2</update_limit_no_order>
|
123 |
+
</general>
|
124 |
<cron_settings>
|
125 |
+
<enabled>1</enabled>
|
126 |
+
<update_interval>10</update_interval>
|
127 |
</cron_settings>
|
128 |
</eye4fraud_connector>
|
129 |
</default>
|
130 |
+
<admin>
|
131 |
+
<routers>
|
132 |
+
<adminhtml>
|
133 |
+
<args>
|
134 |
+
<modules>
|
135 |
+
<eye4fraud after="Mage_Adminhtml">Eye4Fraud_Connector</eye4fraud>
|
136 |
+
</modules>
|
137 |
+
</args>
|
138 |
+
</adminhtml>
|
139 |
+
</routers>
|
140 |
+
</admin>
|
141 |
<adminhtml>
|
142 |
<translate>
|
143 |
<modules>
|
app/code/local/Eye4Fraud/Connector/etc/system.xml
CHANGED
@@ -12,16 +12,14 @@
|
|
12 |
<eye4fraud_connector translate="label">
|
13 |
<label>Eye4Fraud Connector Settings</label>
|
14 |
<tab>sales</tab>
|
15 |
-
<frontend_type>text</frontend_type>
|
16 |
<sort_order>1000</sort_order>
|
17 |
<show_in_default>1</show_in_default>
|
18 |
<show_in_website>1</show_in_website>
|
19 |
<show_in_store>1</show_in_store>
|
20 |
<groups>
|
21 |
-
<
|
22 |
-
<label>
|
23 |
-
<
|
24 |
-
<sort_order>10</sort_order>
|
25 |
<show_in_default>1</show_in_default>
|
26 |
<show_in_website>1</show_in_website>
|
27 |
<show_in_store>1</show_in_store>
|
@@ -35,6 +33,54 @@
|
|
35 |
<show_in_website>1</show_in_website>
|
36 |
<show_in_store>0</show_in_store>
|
37 |
</enabled>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
<api_site_name translate="label">
|
39 |
<label>API Site Name</label>
|
40 |
<frontend_type>text</frontend_type>
|
@@ -59,21 +105,11 @@
|
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>0</show_in_store>
|
61 |
</api_key>
|
62 |
-
<debug_mode translate="label">
|
63 |
-
<label>Debug Mode</label>
|
64 |
-
<frontend_type>select</frontend_type>
|
65 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
-
<sort_order>10</sort_order>
|
67 |
-
<show_in_default>1</show_in_default>
|
68 |
-
<show_in_website>1</show_in_website>
|
69 |
-
<show_in_store>0</show_in_store>
|
70 |
-
</debug_mode>
|
71 |
</fields>
|
72 |
</api_settings>
|
73 |
<cron_settings translate="label,comment">
|
74 |
<label>Cron Settings</label>
|
75 |
<comment>Eye4Fraud status will be cached for orders and updated by cron</comment>
|
76 |
-
<frontend_type>text</frontend_type>
|
77 |
<sort_order>15</sort_order>
|
78 |
<show_in_default>1</show_in_default>
|
79 |
<show_in_website>1</show_in_website>
|
@@ -95,13 +131,24 @@
|
|
95 |
<show_in_default>1</show_in_default>
|
96 |
<show_in_website>0</show_in_website>
|
97 |
<show_in_store>0</show_in_store>
|
|
|
98 |
<comment>Note: cron job is executed each 5 minutes</comment>
|
99 |
</update_interval>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
</fields>
|
101 |
</cron_settings>
|
102 |
<rewrite_status translate="label,comment">
|
103 |
<label>Info for developers</label>
|
104 |
-
<comment>Information for developers to show class rewrite conflicts.
|
105 |
<frontend_type>text</frontend_type>
|
106 |
<sort_order>50</sort_order>
|
107 |
<show_in_default>1</show_in_default>
|
@@ -110,9 +157,8 @@
|
|
110 |
<fields>
|
111 |
<rewrite_grid translate="label">
|
112 |
<label>Order Grid Status</label>
|
113 |
-
<frontend_type>
|
114 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Grid</frontend_model>
|
115 |
-
<backend_model>eye4fraud_connector/config_backend_data</backend_model>
|
116 |
<sort_order>10</sort_order>
|
117 |
<show_in_default>1</show_in_default>
|
118 |
<show_in_website>0</show_in_website>
|
@@ -120,9 +166,8 @@
|
|
120 |
</rewrite_grid>
|
121 |
<rewrite_payflow translate="label">
|
122 |
<label>Payflow Method Status</label>
|
123 |
-
<frontend_type>
|
124 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Payflowpro</frontend_model>
|
125 |
-
<backend_model>eye4fraud_connector/config_backend_data</backend_model>
|
126 |
<sort_order>20</sort_order>
|
127 |
<show_in_default>1</show_in_default>
|
128 |
<show_in_website>0</show_in_website>
|
@@ -130,9 +175,8 @@
|
|
130 |
</rewrite_payflow>
|
131 |
<rewrite_authorize_net translate="label">
|
132 |
<label>Authorize.net Method Status</label>
|
133 |
-
<frontend_type>
|
134 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Authorizenet</frontend_model>
|
135 |
-
<backend_model>eye4fraud_connector/config_backend_data</backend_model>
|
136 |
<sort_order>30</sort_order>
|
137 |
<show_in_default>1</show_in_default>
|
138 |
<show_in_website>0</show_in_website>
|
@@ -140,9 +184,8 @@
|
|
140 |
</rewrite_authorize_net>
|
141 |
<rewrite_paypaluk translate="label">
|
142 |
<label>PayFlow Api Nvp class Status</label>
|
143 |
-
<frontend_type>
|
144 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Paypaluk</frontend_model>
|
145 |
-
<backend_model>eye4fraud_connector/config_backend_data</backend_model>
|
146 |
<sort_order>40</sort_order>
|
147 |
<show_in_default>1</show_in_default>
|
148 |
<show_in_website>0</show_in_website>
|
12 |
<eye4fraud_connector translate="label">
|
13 |
<label>Eye4Fraud Connector Settings</label>
|
14 |
<tab>sales</tab>
|
|
|
15 |
<sort_order>1000</sort_order>
|
16 |
<show_in_default>1</show_in_default>
|
17 |
<show_in_website>1</show_in_website>
|
18 |
<show_in_store>1</show_in_store>
|
19 |
<groups>
|
20 |
+
<general translate="label">
|
21 |
+
<label>General</label>
|
22 |
+
<sort_order>5</sort_order>
|
|
|
23 |
<show_in_default>1</show_in_default>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
33 |
<show_in_website>1</show_in_website>
|
34 |
<show_in_store>0</show_in_store>
|
35 |
</enabled>
|
36 |
+
<update_limit translate="label,comment">
|
37 |
+
<label>Stop to update after, days</label>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>20</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>0</show_in_website>
|
42 |
+
<show_in_store>0</show_in_store>
|
43 |
+
<depends><enabled>1</enabled></depends>
|
44 |
+
<comment>Stop to update non-final status after this period</comment>
|
45 |
+
</update_limit>
|
46 |
+
<update_limit_no_order translate="label,comment">
|
47 |
+
<label>Stop to update not found orders, hours</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>25</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>0</show_in_website>
|
52 |
+
<show_in_store>0</show_in_store>
|
53 |
+
<depends><enabled>1</enabled></depends>
|
54 |
+
<comment>Stop to update not found in Eye4Fraud service orders</comment>
|
55 |
+
</update_limit_no_order>
|
56 |
+
<debug_mode translate="label">
|
57 |
+
<label>Debug Mode</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
60 |
+
<sort_order>40</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>0</show_in_store>
|
64 |
+
</debug_mode>
|
65 |
+
<debug_file translate="label">
|
66 |
+
<label>Debug Log File</label>
|
67 |
+
<frontend_type>label</frontend_type>
|
68 |
+
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Logfile</frontend_model>
|
69 |
+
<sort_order>50</sort_order>
|
70 |
+
<depends><debug_mode>1</debug_mode></depends>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>0</show_in_website>
|
73 |
+
<show_in_store>0</show_in_store>
|
74 |
+
</debug_file>
|
75 |
+
</fields>
|
76 |
+
</general>
|
77 |
+
<api_settings translate="label">
|
78 |
+
<label>API Settings</label>
|
79 |
+
<sort_order>10</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
<fields>
|
84 |
<api_site_name translate="label">
|
85 |
<label>API Site Name</label>
|
86 |
<frontend_type>text</frontend_type>
|
105 |
<show_in_website>1</show_in_website>
|
106 |
<show_in_store>0</show_in_store>
|
107 |
</api_key>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
</fields>
|
109 |
</api_settings>
|
110 |
<cron_settings translate="label,comment">
|
111 |
<label>Cron Settings</label>
|
112 |
<comment>Eye4Fraud status will be cached for orders and updated by cron</comment>
|
|
|
113 |
<sort_order>15</sort_order>
|
114 |
<show_in_default>1</show_in_default>
|
115 |
<show_in_website>1</show_in_website>
|
131 |
<show_in_default>1</show_in_default>
|
132 |
<show_in_website>0</show_in_website>
|
133 |
<show_in_store>0</show_in_store>
|
134 |
+
<depends><enabled>1</enabled></depends>
|
135 |
<comment>Note: cron job is executed each 5 minutes</comment>
|
136 |
</update_interval>
|
137 |
+
<cron_task translate="label">
|
138 |
+
<label>Cron Task Status</label>
|
139 |
+
<frontend_type>label</frontend_type>
|
140 |
+
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Cron</frontend_model>
|
141 |
+
<sort_order>30</sort_order>
|
142 |
+
<depends><enabled>1</enabled></depends>
|
143 |
+
<show_in_default>1</show_in_default>
|
144 |
+
<show_in_website>0</show_in_website>
|
145 |
+
<show_in_store>0</show_in_store>
|
146 |
+
</cron_task>
|
147 |
</fields>
|
148 |
</cron_settings>
|
149 |
<rewrite_status translate="label,comment">
|
150 |
<label>Info for developers</label>
|
151 |
+
<comment>Information for developers to show class rewrite conflicts. The current class will be shown on extensions conflict.</comment>
|
152 |
<frontend_type>text</frontend_type>
|
153 |
<sort_order>50</sort_order>
|
154 |
<show_in_default>1</show_in_default>
|
157 |
<fields>
|
158 |
<rewrite_grid translate="label">
|
159 |
<label>Order Grid Status</label>
|
160 |
+
<frontend_type>label</frontend_type>
|
161 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Grid</frontend_model>
|
|
|
162 |
<sort_order>10</sort_order>
|
163 |
<show_in_default>1</show_in_default>
|
164 |
<show_in_website>0</show_in_website>
|
166 |
</rewrite_grid>
|
167 |
<rewrite_payflow translate="label">
|
168 |
<label>Payflow Method Status</label>
|
169 |
+
<frontend_type>label</frontend_type>
|
170 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Payflowpro</frontend_model>
|
|
|
171 |
<sort_order>20</sort_order>
|
172 |
<show_in_default>1</show_in_default>
|
173 |
<show_in_website>0</show_in_website>
|
175 |
</rewrite_payflow>
|
176 |
<rewrite_authorize_net translate="label">
|
177 |
<label>Authorize.net Method Status</label>
|
178 |
+
<frontend_type>label</frontend_type>
|
179 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Authorizenet</frontend_model>
|
|
|
180 |
<sort_order>30</sort_order>
|
181 |
<show_in_default>1</show_in_default>
|
182 |
<show_in_website>0</show_in_website>
|
184 |
</rewrite_authorize_net>
|
185 |
<rewrite_paypaluk translate="label">
|
186 |
<label>PayFlow Api Nvp class Status</label>
|
187 |
+
<frontend_type>label</frontend_type>
|
188 |
<frontend_model>Eye4Fraud_Connector_Model_Config_Frontend_Paypaluk</frontend_model>
|
|
|
189 |
<sort_order>40</sort_order>
|
190 |
<show_in_default>1</show_in_default>
|
191 |
<show_in_website>0</show_in_website>
|
app/code/local/Eye4Fraud/Connector/sql/eye4fraud_setup/upgrade-1.2.2-1.2.3.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* @var $installer Mage_Core_Model_Resource_Setup */
|
4 |
+
$installer = $this;
|
5 |
+
|
6 |
+
$installer->getConnection()
|
7 |
+
->addColumn($installer->getTable('eye4fraud_connector/status'),
|
8 |
+
'created_at',
|
9 |
+
array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
11 |
+
'nullable' => false,
|
12 |
+
'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT,
|
13 |
+
'comment' => 'Created At'
|
14 |
+
)
|
15 |
+
);
|
16 |
+
|
17 |
+
$installer->endSetup();
|
app/locale/en_US/Eye4Fraud_Connector.csv
CHANGED
@@ -8,7 +8,9 @@
|
|
8 |
"status:F","Fraud"
|
9 |
"status:M","Missed Fraud"
|
10 |
"status:E","Error"
|
11 |
-
"status:
|
|
|
|
|
12 |
"status:ERR","Error"
|
13 |
"status:RER","Error Answer"
|
14 |
"status:IER","Retriever Error"
|
@@ -21,7 +23,8 @@
|
|
21 |
"Update Interval, minutes","Update Interval, minutes"
|
22 |
"Note: cron job is executed each 5 minutes","Note: cron job is executed each 5 minutes"
|
23 |
"Info for developers","Info for developers"
|
24 |
-
"Information for developers to show class rewrite conflicts.
|
25 |
"Order Grid Status","Order Grid Status"
|
26 |
"Payflow Method Status","Payflow Method Status"
|
27 |
"Authorize.net Method Status","Authorize.net Method Status"
|
|
8 |
"status:F","Fraud"
|
9 |
"status:M","Missed Fraud"
|
10 |
"status:E","Error"
|
11 |
+
"status:Q","Queued"
|
12 |
+
"status:N","No Order"
|
13 |
+
"status:W","Waiting Update"
|
14 |
"status:ERR","Error"
|
15 |
"status:RER","Error Answer"
|
16 |
"status:IER","Retriever Error"
|
23 |
"Update Interval, minutes","Update Interval, minutes"
|
24 |
"Note: cron job is executed each 5 minutes","Note: cron job is executed each 5 minutes"
|
25 |
"Info for developers","Info for developers"
|
26 |
+
"Information for developers to show class rewrite conflicts. The current class will be shown on extensions conflict.","Information for developers to show class rewrite conflicts. The current class will be shown on extensions conflict."
|
27 |
"Order Grid Status","Order Grid Status"
|
28 |
"Payflow Method Status","Payflow Method Status"
|
29 |
"Authorize.net Method Status","Authorize.net Method Status"
|
30 |
+
"Cron Task Status","Cron Task Status"
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eye4Fraud_Connector_integration</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
@@ -12,15 +12,15 @@ money-back guarantee on chargebacks.
|
|
12 |

|
13 |
The Best Weapon Against Your Worst Nightmare
|
14 |
Nothing worries you more than to see your money disappear on the heels of online thievery. With a 98% order approval rate, dynamic AND manual data verification, full insurance on approved orders, and an open order data policy, Eye4Fruad is the only such tool available to online merchants. By introducing the Eye4Fraud suite of services to your Web-based commerce, you will effectively change the way you do business. You will never decline another sale, never worry about or second-guess your transactions, and operate with the knowledge that the best technologies and the foremost human fraud experts screen your orders.</description>
|
15 |
-
<notes>-
|
16 |
-
-
|
17 |
-
-
|
18 |
-
-
|
19 |
-
-
|
20 |
<authors><author><name>Shloimy Stauber</name><user>Eye4Fraud</user><email>info@eye4fraud.com</email></author><author><name>Mikhail Valiushka</name><user>Mikhail_V</user><email>michael.valushko@gmail.com</email></author></authors>
|
21 |
-
<date>2016-
|
22 |
-
<time>
|
23 |
-
<contents><target name="magelocal"><dir name="Eye4Fraud"><dir name="Connector"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="6ad4ebb40f64d4f0e50f5be6f89c0176"/></dir></dir></dir><dir name="Helper"><file name="Curl.php" hash="208efcd91bebc5baee5ca3ed3d72fdec"/><file name="Data.php" hash="
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.3.0</min><max>5.6.27</max></php><extension><name>curl</name><min>7.8</min><max>7.51</max></extension></required></dependencies>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eye4Fraud_Connector_integration</name>
|
4 |
+
<version>1.2.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
12 |

|
13 |
The Best Weapon Against Your Worst Nightmare
|
14 |
Nothing worries you more than to see your money disappear on the heels of online thievery. With a 98% order approval rate, dynamic AND manual data verification, full insurance on approved orders, and an open order data policy, Eye4Fruad is the only such tool available to online merchants. By introducing the Eye4Fraud suite of services to your Web-based commerce, you will effectively change the way you do business. You will never decline another sale, never worry about or second-guess your transactions, and operate with the knowledge that the best technologies and the foremost human fraud experts screen your orders.</description>
|
15 |
+
<notes>- Fraud status created when order request is cached
|
16 |
+
- Timeout added for non-final statuses and for orders which isn't sent to eye4fraud, this fix overflow issue for unprocessed orders
|
17 |
+
- Changed internal logic for statuses, now they are saved to DB everytime
|
18 |
+
- Access to logfile added to extension settings
|
19 |
+
- Short info about extension cron task added to extension settings</notes>
|
20 |
<authors><author><name>Shloimy Stauber</name><user>Eye4Fraud</user><email>info@eye4fraud.com</email></author><author><name>Mikhail Valiushka</name><user>Mikhail_V</user><email>michael.valushko@gmail.com</email></author></authors>
|
21 |
+
<date>2016-12-07</date>
|
22 |
+
<time>21:00:34</time>
|
23 |
+
<contents><target name="magelocal"><dir name="Eye4Fraud"><dir name="Connector"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="6ad4ebb40f64d4f0e50f5be6f89c0176"/></dir></dir></dir><dir name="Helper"><file name="Curl.php" hash="208efcd91bebc5baee5ca3ed3d72fdec"/><file name="Data.php" hash="01f7aa5c8076b9978e889b59ef3d67bb"/></dir><dir name="Model"><file name="Authorizenet.php" hash="857460c0b6162045aee7b1f8bc17bbc6"/><dir name="Config"><dir name="Frontend"><file name="Authorizenet.php" hash="4ca4061907fb50c422f41c5df93ed9a5"/><file name="Cron.php" hash="cbe3a4cc98dc7a415b7b9475a2f404c0"/><file name="Grid.php" hash="cfdeea39ffa3416fa499f99e1d62f82b"/><file name="Logfile.php" hash="682017713aa1ce38e299d5a1d023a533"/><file name="Payflowpro.php" hash="b9bad651e0af45b8b70085679a7861cb"/><file name="Paypaluk.php" hash="0584bd4253de063f4c51f3437b71e9cc"/></dir></dir><file name="Observer.php" hash="6e2ebedf7d9b88837e2c941883eaf866"/><file name="Payflowpro.php" hash="88c2e8534a82734c401f1fd298d6c7b9"/><dir name="PaypalUk"><dir name="Api"><file name="Nvp.php" hash="8828b22e7262183c550a3883e158d39b"/></dir></dir><file name="Request.php" hash="76e9cd27ea7b487b5f7ee13588d77a13"/><dir name="Resource"><dir name="Requests"><dir name="Cache"><file name="Collection.php" hash="d095e817aec23bf2d5c1129d9da2c19a"/></dir><file name="Cache.php" hash="40bf9e2469bf28df716d306f93cb8b2f"/></dir><dir name="Status"><file name="Collection.php" hash="799d5292ac63c93ef5c5cac7bd857674"/></dir><file name="Status.php" hash="576719086b42283ffb718a3a3021f584"/></dir><file name="Status.php" hash="60753e4ab529f6e291bae077ca42fce1"/></dir><file name="changes.txt" hash="bad7512fbc39c635cceef15a6fb4a834"/><dir name="controllers"><file name="Eye4fraudController.php" hash="cf87e2ea1a26e7912a2ebe29d481b81d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9968072302312e95e0598bd58d13d5ef"/><file name="config.xml" hash="afef8ea762d2ed1d4487b7b5663e81ad"/><file name="system.xml" hash="60fc3f5609559564cfbaa4e4e6caaecd"/></dir><dir name="sql"><dir name="eye4fraud_setup"><file name="install-1.0.4.php" hash="d92abe981c5a18daed7c5a645294c5f4"/><file name="upgrade-1.0.6-1.0.7.php" hash="a117809d1e0a392e74b9d97594456a2a"/><file name="upgrade-1.1.1-1.1.2.php" hash="2bd28326005ba8d0cd9a3ff3d45fe91a"/><file name="upgrade-1.1.2-1.1.3.php" hash="ee78c256d54063ceb04888ca75af3847"/><file name="upgrade-1.1.3-1.1.4.php" hash="955c6deaaee043409155cf5e5e8cfa11"/><file name="upgrade-1.1.6-1.1.7.php" hash="7aeb9b88b19a463c6f87c3c203d40148"/><file name="upgrade-1.1.7-1.2.0.php" hash="f30f3d4f84a64e42917cd8df9c016b2b"/><file name="upgrade-1.2.2-1.2.3.php" hash="bfa62fed051e4afb7654c3b7b5364708"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eye4Fraud_Connector.xml" hash="444bf3d400ab4017c6e81fa4ad5d1463"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Eye4Fraud_Connector.csv" hash="05cedf16f303d1a775063a52a38f029d"/><dir name="template"><dir name="email"><file name="authorizepopulation.html" hash="62fc1c6c340631ee529e7c486e763cac"/></dir></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.3.0</min><max>5.6.27</max></php><extension><name>curl</name><min>7.8</min><max>7.51</max></extension></required></dependencies>
|
26 |
</package>
|