Konduto - Version 1.7.0

Version Notes

Bugfixes.

Download this release

Release Info

Developer Konduto
Extension Konduto
Version 1.7.0
Comparing to
See all releases


Code changes from version 1.6.2 to 1.7.0

app/code/community/Konduto/Score/Block/Score.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Konduto_Score_Block_Score extends Mage_Core_Block_Template {
4
+
5
+
6
+ }
app/code/community/Konduto/Score/Helper/Order.php CHANGED
@@ -5,13 +5,13 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
5
  public function getOrderData($order, $payment_status, $visitor = null) {
6
  if ($visitor == NULL) { $visitor = $this->getVisitorId(); }
7
  //$odm = Mage::getModel('sales/quote')->load($order->getQuoteId());
8
- $payment = $this->getPaymentDetails($order);
9
- if (!$payment['include']) {
10
- if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
11
- Mage::log('No credit card detected. Will not send for analysis.', null, 'konduto.log');
12
- }
13
- return;
14
- }
15
  $payment["status"] = $payment_status;
16
  unset($payment['include']);
17
  if ($payment_status === "pending") {
@@ -21,13 +21,13 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
21
  $order_id = "Try-".$order->getIncrementId()."-".uniqid();
22
  }
23
  else {
24
- if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
25
- Mage::log('Payment status is not supported:'.$payment_status, null, 'konduto.log');
26
  }
27
  return;
28
  }
29
  $currency = $order->getQuoteCurrencyCode();
30
- $billing = $order->getBillingAddress()->getData();
31
  $shipping = $order->getShippingAddress()->getData();
32
  if ($order->getCustomerId() == '' || $order->getCustomerId() == NULL) { $customer_id = $order->getCustomerEmail(); }
33
  else { $customer_id = $order->getCustomerId(); }
@@ -89,16 +89,16 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
89
  }
90
 
91
  public function fireRequest($data, $oid = null) {
92
- if ((!isset($data)) || (!$data)) {
93
- if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
94
- Mage::log('No data found. Aborting...', null, 'konduto.log');
95
- }
96
- return;
97
  }
98
  $data = json_encode($data);
99
  $header = array();
100
- $header[] = 'Content-type: application/json; charset=utf-8';
101
- $header[] = 'X-Requested-With: Magento v1.6.1';
102
  $mode = Mage::getStoreConfig('scoreoptions/messages/mode');
103
  if ($mode == 1) {
104
  $private = Mage::getStoreConfig('scoreoptions/messages/productionprikey');
@@ -118,8 +118,8 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
118
  CURLOPT_POST => 1,
119
  CURLOPT_POSTFIELDS => $data,
120
  CURLOPT_HTTPHEADER => $header,
121
- CURLOPT_CONNECTTIMEOUT => 30,
122
- CURLOPT_TIMEOUT => 30,
123
  CURLOPT_SSL_VERIFYHOST => $sslVerifyHost,
124
  CURLOPT_SSL_VERIFYPEER => $sslVerifyPeer
125
  ));
@@ -133,8 +133,8 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
133
  Mage::log('request==>' . $data, null, 'konduto.log');
134
  Mage::log('response=>' . $resp, null, 'konduto.log');
135
  }
136
- if (isset($oid)) {
137
- $save = $this->saveData($data, $resp, $oid);
138
  }
139
  }
140
 
@@ -145,9 +145,12 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
145
  $cc_six = substr($ccNumber, 0, 6);
146
  $ret["type"] = "credit";
147
  $ret["include"] = false;
148
- if (($payment->getCcExpMonth()) && ($payment->getCcExpYear())) {
149
- $ret["expiration_date"] = sprintf("%02d", $payment->getCcExpMonth()) . $payment->getCcExpYear();
150
- }
 
 
 
151
  switch ($payment->getMethod()) {
152
  case 'authorizenet':
153
  $ret["include"] = true;
@@ -190,7 +193,7 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
190
  public function getVisitorId($id = NULL) {
191
  if (isset($_COOKIE['_kdt'])) {
192
  $cookie = json_decode($_COOKIE['_kdt'], true);
193
- $id = $cookie['i'];
194
  }
195
  return $id;
196
  }
5
  public function getOrderData($order, $payment_status, $visitor = null) {
6
  if ($visitor == NULL) { $visitor = $this->getVisitorId(); }
7
  //$odm = Mage::getModel('sales/quote')->load($order->getQuoteId());
8
+ $payment = $this->getPaymentDetails($order);
9
+ if (!$payment['include']) {
10
+ if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
11
+ Mage::log('No credit card detected. Will not send for analysis.', null, 'konduto.log');
12
+ }
13
+ return;
14
+ }
15
  $payment["status"] = $payment_status;
16
  unset($payment['include']);
17
  if ($payment_status === "pending") {
21
  $order_id = "Try-".$order->getIncrementId()."-".uniqid();
22
  }
23
  else {
24
+ if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
25
+ Mage::log('Payment status is not supported:'.$payment_status, null, 'konduto.log');
26
  }
27
  return;
28
  }
29
  $currency = $order->getQuoteCurrencyCode();
30
+ $billing = $order->getBillingAddress()->getData();
31
  $shipping = $order->getShippingAddress()->getData();
32
  if ($order->getCustomerId() == '' || $order->getCustomerId() == NULL) { $customer_id = $order->getCustomerEmail(); }
33
  else { $customer_id = $order->getCustomerId(); }
89
  }
90
 
91
  public function fireRequest($data, $oid = null) {
92
+ if ((!isset($data)) || (!$data)) {
93
+ if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
94
+ Mage::log('No data found. Aborting...', null, 'konduto.log');
95
+ }
96
+ return;
97
  }
98
  $data = json_encode($data);
99
  $header = array();
100
+ $header[] = 'Content-type: application/json';
101
+ $header[] = 'X-Requested-With: Magento v1.6.4';
102
  $mode = Mage::getStoreConfig('scoreoptions/messages/mode');
103
  if ($mode == 1) {
104
  $private = Mage::getStoreConfig('scoreoptions/messages/productionprikey');
118
  CURLOPT_POST => 1,
119
  CURLOPT_POSTFIELDS => $data,
120
  CURLOPT_HTTPHEADER => $header,
121
+ CURLOPT_CONNECTTIMEOUT => 5,
122
+ CURLOPT_TIMEOUT => 10,
123
  CURLOPT_SSL_VERIFYHOST => $sslVerifyHost,
124
  CURLOPT_SSL_VERIFYPEER => $sslVerifyPeer
125
  ));
133
  Mage::log('request==>' . $data, null, 'konduto.log');
134
  Mage::log('response=>' . $resp, null, 'konduto.log');
135
  }
136
+ if (isset($oid)) {
137
+ $save = $this->saveData($data, $resp, $oid);
138
  }
139
  }
140
 
145
  $cc_six = substr($ccNumber, 0, 6);
146
  $ret["type"] = "credit";
147
  $ret["include"] = false;
148
+ $expmo = sprintf("%02d", $payment->getCcExpMonth());
149
+ $expyear = $payment->getCcExpYear();
150
+ $expyear = (strlen($expyear) == 2 ? "20" . $expyear : $expyear);
151
+ if (($expmo) && ($expyear)) {
152
+ $ret["expiration_date"] = $expmo . $expyear;
153
+ }
154
  switch ($payment->getMethod()) {
155
  case 'authorizenet':
156
  $ret["include"] = true;
193
  public function getVisitorId($id = NULL) {
194
  if (isset($_COOKIE['_kdt'])) {
195
  $cookie = json_decode($_COOKIE['_kdt'], true);
196
+ $id = $cookie['i'];
197
  }
198
  return $id;
199
  }
app/code/community/Konduto/Score/Model/Observer.php CHANGED
@@ -40,99 +40,32 @@ class Konduto_Score_Model_Observer {
40
  }
41
  }
42
 
43
- public function addManualButton($evt) {
44
- $order_id = Mage::app()->getFrontController()->getRequest()->getParam('order_id');
45
- $score_details = Mage::getModel('score/score')->getCollection()->addFieldToFilter('order_no', $order_id)->getFirstItem();
46
-
47
- if (!$score_details->getRequest() && sizeof($score_details) == 1) {
48
- $block = $evt->getEvent()->getData('block');
49
- if (Mage::getStoreConfig("scoreoptions/messages/activate") && Mage::getStoreConfig("scoreoptions/messages/reviewaction") == 2) {
50
- if (get_class($block) == 'Mage_Adminhtml_Block_Sales_Order_View' && $block->getRequest()->getControllerName() == 'sales_order') {
51
- $block->addButton('konduto', array(
52
- 'label' => Mage::helper('customer')->__('Konduto Analyze'),
53
- 'onclick' => 'setLocation(\'' . $this->getScoreUrl($block) . '\')',
54
- 'class' => 'scalable save'
55
- ), 0);
56
- }
57
- }
58
- }
59
- }
60
-
61
- public function addAlertonInvoice($evt) {
62
- $block = $evt->getEvent()->getData('block');
63
- if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
64
- if (get_class($block) == 'Mage_Adminhtml_Block_Sales_Order_View' && $block->getRequest()->getControllerName() == 'sales_order') {
65
- $ordr_id = $block->getOrder()->getEntityId();
66
- $collection = Mage::getModel('score/score')->getCollection()
67
- ->addFieldToFilter("order_no", $ordr_id);
68
- if (Mage::getStoreConfig('scoreoptions/messages/reviewupscore') != null && Mage::getStoreConfig('scoreoptions/messages/reviewloscore') != null) {
69
- $up_limit = Mage::getStoreConfig('scoreoptions/messages/reviewupscore');
70
- $low_limit = Mage::getStoreConfig('scoreoptions/messages/reviewloscore');
71
- $score = $collection->getFirstItem()->getScore();
72
- if ($score >= $low_limit && $score <= $up_limit) {
73
- $recmmondation = 'REVIEW';
74
- } elseif ($score > $up_limit) {
75
- $recmmondation = 'DECLINE';
76
- } else {
77
- $recmmondation = 'APPROVE';
78
- }
79
- } else {
80
- $recmmondation = $collection->getFirstItem()->getRecommendation();
81
- }
82
-
83
- if ($recmmondation == 'REVIEW' || $recmmondation == 'DECLINE') {
84
- $block->removeButton('order_invoice');
85
- $message = Mage::helper('sales')->__('Are you sure you want to Invoice this order? Konduto Recommends to ' . $recmmondation);
86
- $block->addButton('order_invoice', array(
87
- 'label' => Mage::helper('sales')->__('Invoice'),
88
- 'onclick' => "confirmSetLocation('{$message}','{$block->getInvoiceUrl()}')",
89
- 'class' => 'go'
90
- ), 0);
91
- }
92
- }
93
- }
94
  }
95
-
96
- public function updateOrder($evt) {
97
- $order_id = $evt->getEvent()->getOrder()->getId();
98
- $score_details = Mage::getModel('score/score')->getCollection()->addFieldToFilter('order_no', $order_id)->getFirstItem();
99
- if (sizeof($score_details) >= 1 && $score_details->getRecommendation() != 'APPROVE') {
100
- $mode = Mage::getStoreConfig('scoreoptions/messages/mode');
101
- if ($mode == 1) {
102
- $private = Mage::getStoreConfig('scoreoptions/messages/productionprikey');
103
- } else {
104
- $private = Mage::getStoreConfig('scoreoptions/messages/sandboxprikey');
105
- }
106
- $pwd = $private;
107
- $sslVerify = ($mode == 1 ? true : false);
108
- $header = array();
109
- $header[] = 'Content-type: application/json; charset=utf-8';
110
- $header[] = 'X-Requested-With: Magento';
111
- $data = '{"status": "approved","comments": "Updated via Magento admin at '.gmdate("r").'"}';
112
- $curl = curl_init();
113
- curl_setopt_array($curl, array(
114
- CURLOPT_RETURNTRANSFER => 1,
115
- CURLOPT_URL => 'https://api.konduto.com/v1/orders/' . $order_id,
116
- CURLOPT_USERPWD => $pwd,
117
- CURLOPT_CUSTOMREQUEST => "PUT",
118
- CURLOPT_POSTFIELDS => $data,
119
- CURLOPT_HTTPHEADER => $header,
120
- CURLOPT_CONNECTTIMEOUT => 60,
121
- CURLOPT_TIMEOUT => 60,
122
- CURLOPT_SSL_VERIFYHOST => $sslVerify,
123
- CURLOPT_SSL_VERIFYPEER => $sslVerify
124
- ));
125
- $resp = array();
126
- try {
127
- $resp = curl_exec($curl);
128
- } catch (Exception $ex) {
129
- $resp = 'curlError = ' . curl_error($curl);
130
- }
131
- if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
132
- Mage::log('Order Update Request==>' . $data, NULL, 'konduto.log');
133
- Mage::log('Order Update Response==>' . $resp, null, 'konduto.log');
134
- }
135
- }
136
  }
137
 
138
  protected function getScoreUrl($block) {
40
  }
41
  }
42
 
43
+ public function appendRecommendationColumn(Varien_Event_Observer $evt) {
44
+ $block = $evt->getBlock();
45
+ if (!isset($block)) {
46
+ return $this;
47
+ }
48
+
49
+ if ($block->getType() == 'adminhtml/sales_order_grid') {
50
+ $block->addColumnAfter(
51
+ 'recommendation',
52
+ array(
53
+ 'header' => Mage::helper('sales')->__('Recommendation'),
54
+ 'index' => 'recommendation',
55
+ 'type' => 'text'
56
+ ),
57
+ 'status'
58
+ );
59
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
+
62
+ public function fillRecommendationColumn(Varien_Event_Observer $evt) {
63
+ $resource = Mage::getSingleton('core/resource');
64
+ $tabel_nam = $resource->getTableName('score/score');
65
+ $collection = $evt->getOrderGridCollection();
66
+ $collection->getSelect()->joinLeft(
67
+ $tabel_nam . ' as score', 'main_table.entity_id = score.order_no'
68
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
 
71
  protected function getScoreUrl($block) {
app/code/community/Konduto/Score/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Konduto_Score>
5
- <version>0.1.0</version>
6
  </Konduto_Score>
7
  </modules>
8
  <frontend>
@@ -50,6 +50,26 @@
50
  </admin>
51
  </resources>
52
  </acl>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  <layout>
54
  <updates>
55
  <score>
@@ -108,7 +128,6 @@
108
  </score>
109
  <adminhtml>
110
  <rewrite>
111
- <sales_order_grid>Konduto_Score_Block_Adminhtml_Order_Grid</sales_order_grid>
112
  <sales_order_view_info>Konduto_Score_Block_Sales_Order_View_Score</sales_order_view_info>
113
  </rewrite>
114
  </adminhtml>
2
  <config>
3
  <modules>
4
  <Konduto_Score>
5
+ <version>1.7.0</version>
6
  </Konduto_Score>
7
  </modules>
8
  <frontend>
50
  </admin>
51
  </resources>
52
  </acl>
53
+ <events>
54
+ <core_block_abstract_prepare_layout_before>
55
+ <observers>
56
+ <customgrid_column_append>
57
+ <type>model</type>
58
+ <class>Konduto_Score_Model_Observer</class>
59
+ <method>appendRecommendationColumn</method>
60
+ </customgrid_column_append>
61
+ </observers>
62
+ </core_block_abstract_prepare_layout_before>
63
+ <sales_order_grid_collection_load_before>
64
+ <observers>
65
+ <customgrid_column_append>
66
+ <type>model</type>
67
+ <class>Konduto_Score_Model_Observer</class>
68
+ <method>fillRecommendationColumn</method>
69
+ </customgrid_column_append>
70
+ </observers>
71
+ </sales_order_grid_collection_load_before>
72
+ </events>
73
  <layout>
74
  <updates>
75
  <score>
128
  </score>
129
  <adminhtml>
130
  <rewrite>
 
131
  <sales_order_view_info>Konduto_Score_Block_Sales_Order_View_Score</sales_order_view_info>
132
  </rewrite>
133
  </adminhtml>
app/code/community/Konduto/Score/etc/system.xml CHANGED
@@ -93,7 +93,6 @@
93
  <mode>1</mode>
94
  </depends>
95
  </productionprikey>
96
-
97
  <reviewaction>
98
  <label>Analysis Mode</label>
99
  <frontend_type>select</frontend_type>
@@ -103,24 +102,6 @@
103
  <show_in_website>1</show_in_website>
104
  <show_in_store>1</show_in_store>
105
  </reviewaction>
106
- <reviewupscore>
107
- <label>Decline recommendation prompt</label>
108
- <comment>If score is higher than this, prompt me for approval during invoicing.</comment>
109
- <frontend_type>text</frontend_type>
110
- <sort_order>8</sort_order>
111
- <show_in_default>1</show_in_default>
112
- <show_in_website>1</show_in_website>
113
- <show_in_store>1</show_in_store>
114
- </reviewupscore>
115
- <reviewloscore>
116
- <label>Approve recommendation prompt</label>
117
- <comment>If the score is lower than this, do not prompt me for approval.</comment>
118
- <frontend_type>text</frontend_type>
119
- <sort_order>9</sort_order>
120
- <show_in_default>1</show_in_default>
121
- <show_in_website>1</show_in_website>
122
- <show_in_store>1</show_in_store>
123
- </reviewloscore>
124
  <debug>
125
  <label>Debug</label>
126
  <comment><![CDATA[konduto.log file is created in var/log where you can see details of of request and response.<br> You also need to enable logging from Advance-> Developer-> Log Settings]]></comment>
93
  <mode>1</mode>
94
  </depends>
95
  </productionprikey>
 
96
  <reviewaction>
97
  <label>Analysis Mode</label>
98
  <frontend_type>select</frontend_type>
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>1</show_in_store>
104
  </reviewaction>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  <debug>
106
  <label>Debug</label>
107
  <comment><![CDATA[konduto.log file is created in var/log where you can see details of of request and response.<br> You also need to enable logging from Advance-> Developer-> Log Settings]]></comment>
app/code/community/Konduto/Score/sql/.DS_Store ADDED
Binary file
app/code/community/Konduto/Score/sql/score_setup/mysql4-install-0.1.0.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('score')};
10
- CREATE TABLE {$this->getTable('score')} (
11
- `score_id` int(11) unsigned NOT NULL auto_increment,
12
- `order_no` int(128) NOT NULL,
13
- `request` longtext NOT NULL default '',
14
- `response` longtext NOT NULL default '',
15
- `score` varchar(128) NOT NULL default '',
16
- `recommendation` varchar(128) NOT NULL default '',
17
- `visitor_id` varchar(128) NOT NULL default '',
18
- `created_time` datetime NULL,
19
- `update_time` datetime NULL,
20
- PRIMARY KEY (`score_id`)
21
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
22
-
23
- ");
24
-
25
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Konduto/Score/sql/score_setup/mysql4-install-1.7.0.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $tableScore = $installer->getTable('score');
8
+
9
+ $installer->getConnection()->dropTable($tableScore);
10
+
11
+ $table = $installer->getConnection()
12
+ ->newTable($tableScore)
13
+ ->addColumn('score_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
14
+ 'unsigned' => true,
15
+ 'nullable' => false,
16
+ 'primary' => true,
17
+ 'auto_increment' => true,
18
+ ), 'score_id')
19
+ ->addColumn('order_no', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
20
+ 'nullable' => true,
21
+ ), 'order_no')
22
+ ->addColumn('request', Varien_Db_Ddl_Table::TYPE_LONGVARCHAR, null, array(
23
+ 'nullable' => true,
24
+ ), 'request')
25
+ ->addColumn('response', Varien_Db_Ddl_Table::TYPE_LONGVARCHAR, null, array(
26
+ 'nullable' => true,
27
+ ), 'response')
28
+ ->addColumn('score', Varien_Db_Ddl_Table::TYPE_VARCHAR, 128, array(
29
+ 'nullable' => true,
30
+ ), 'score')
31
+ ->addColumn('recommendation', Varien_Db_Ddl_Table::TYPE_VARCHAR, 128, array(
32
+ 'nullable' => true,
33
+ ), 'recommendation')
34
+ ->addColumn('visitor_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 128, array(
35
+ 'nullable' => true,
36
+ ), 'visitor_id')
37
+ ->addColumn('created_time', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
38
+ 'nullable' => TRUE,
39
+ ), 'created_time')
40
+ ->addColumn('update_time', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
41
+ 'nullable' => TRUE,
42
+ ), 'update_time')
43
+ ->addIndex($installer->getIdxName('score_order_no_idx', array('score_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE), array('score_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE))
44
+ ->setComment('Konduto');
45
+ $installer->getConnection()->createTable($table);
46
+
47
+ $installer->endSetup();
app/code/community/Konduto/Score/sql/score_setup/mysql4-upgrade-0.1.0-1.7.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ CREATE INDEX `score_order_no_idx`
10
+ ON {$this->getTable('score')} (`order_no`);
11
+
12
+ ");
13
+
14
+ $installer->endSetup();
app/design/frontend/base/default/layout/score.xml CHANGED
@@ -2,14 +2,13 @@
2
  <layout version="0.1.0">
3
 
4
  <konduto_js>
5
- <reference name="footer">
6
- <action method="setCacheLifetime"><s>0</s></action>
7
  <block type="core/template" name="scorejs" template="score/score.phtml" before="-"/>
8
  </reference>
9
  </konduto_js>
10
 
11
  <konduto_cms_index_index>
12
- <reference name="head">
13
  <block type="core/text" name="home_kdt">
14
  <action method="setText">
15
  <text>
@@ -21,7 +20,7 @@
21
  </konduto_cms_index_index>
22
 
23
  <konduto_catalog_product_view>
24
- <reference name="head">
25
  <block type="core/text" name="product_kdt">
26
  <action method="setText">
27
  <text>
@@ -34,7 +33,7 @@
34
  </konduto_catalog_product_view>
35
 
36
  <konduto_catalogsearch_result_index>
37
- <reference name="head">
38
  <block type="core/text" name="search_kdt">
39
  <action method="setText">
40
  <text>
@@ -46,7 +45,7 @@
46
  </konduto_catalogsearch_result_index>
47
 
48
  <konduto_catalogsearch_advanced_result>
49
- <reference name="head">
50
  <block type="core/text" name="search_kdt">
51
  <action method="setText">
52
  <text>
@@ -58,7 +57,7 @@
58
  </konduto_catalogsearch_advanced_result>
59
 
60
  <konduto_customer_account_forgotpassword>
61
- <reference name="head">
62
  <block type="core/text" name="password_kdt">
63
  <action method="setText">
64
  <text>
@@ -70,7 +69,7 @@
70
  </konduto_customer_account_forgotpassword>
71
 
72
  <konduto_customer_account_create>
73
- <reference name="head">
74
  <block type="core/text" name="acccreate_kdt">
75
  <action method="setText">
76
  <text>
@@ -82,7 +81,7 @@
82
  </konduto_customer_account_create>
83
 
84
  <konduto_checkout_onepage_index>
85
- <reference name="head">
86
  <block type="core/text" name="checkout_kdt">
87
  <action method="setText">
88
  <text>
@@ -94,7 +93,7 @@
94
  </konduto_checkout_onepage_index>
95
 
96
  <konduto_onestepcheckout_index_index>
97
- <reference name="head">
98
  <block type="core/text" name="checkout_kdt">
99
  <action method="setText">
100
  <text>
@@ -106,7 +105,7 @@
106
  </konduto_onestepcheckout_index_index>
107
 
108
  <konduto_checkout_cart_index>
109
- <reference name="head">
110
  <block type="core/text" name="cart_kdt">
111
  <action method="setText">
112
  <text>
@@ -118,7 +117,7 @@
118
  </konduto_checkout_cart_index>
119
 
120
  <konduto_customer_account_index>
121
- <reference name="head">
122
  <block type="core/text" name="acc_kdt">
123
  <action method="setText">
124
  <text>
@@ -130,7 +129,7 @@
130
  </konduto_customer_account_index>
131
 
132
  <konduto_catalog_category_default>
133
- <reference name="head">
134
  <block type="core/text" name="category_kdt">
135
  <action method="setText">
136
  <text>
@@ -142,7 +141,7 @@
142
  </konduto_catalog_category_default>
143
 
144
  <konduto_catalog_category_view>
145
- <reference name="head">
146
  <block type="core/text" name="category_kdt">
147
  <action method="setText">
148
  <text>
2
  <layout version="0.1.0">
3
 
4
  <konduto_js>
5
+ <reference name="before_body_end" ifconfig="scoreoptions/messages/activate">
 
6
  <block type="core/template" name="scorejs" template="score/score.phtml" before="-"/>
7
  </reference>
8
  </konduto_js>
9
 
10
  <konduto_cms_index_index>
11
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
12
  <block type="core/text" name="home_kdt">
13
  <action method="setText">
14
  <text>
20
  </konduto_cms_index_index>
21
 
22
  <konduto_catalog_product_view>
23
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
24
  <block type="core/text" name="product_kdt">
25
  <action method="setText">
26
  <text>
33
  </konduto_catalog_product_view>
34
 
35
  <konduto_catalogsearch_result_index>
36
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
37
  <block type="core/text" name="search_kdt">
38
  <action method="setText">
39
  <text>
45
  </konduto_catalogsearch_result_index>
46
 
47
  <konduto_catalogsearch_advanced_result>
48
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
49
  <block type="core/text" name="search_kdt">
50
  <action method="setText">
51
  <text>
57
  </konduto_catalogsearch_advanced_result>
58
 
59
  <konduto_customer_account_forgotpassword>
60
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
61
  <block type="core/text" name="password_kdt">
62
  <action method="setText">
63
  <text>
69
  </konduto_customer_account_forgotpassword>
70
 
71
  <konduto_customer_account_create>
72
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
73
  <block type="core/text" name="acccreate_kdt">
74
  <action method="setText">
75
  <text>
81
  </konduto_customer_account_create>
82
 
83
  <konduto_checkout_onepage_index>
84
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
85
  <block type="core/text" name="checkout_kdt">
86
  <action method="setText">
87
  <text>
93
  </konduto_checkout_onepage_index>
94
 
95
  <konduto_onestepcheckout_index_index>
96
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
97
  <block type="core/text" name="checkout_kdt">
98
  <action method="setText">
99
  <text>
105
  </konduto_onestepcheckout_index_index>
106
 
107
  <konduto_checkout_cart_index>
108
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
109
  <block type="core/text" name="cart_kdt">
110
  <action method="setText">
111
  <text>
117
  </konduto_checkout_cart_index>
118
 
119
  <konduto_customer_account_index>
120
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
121
  <block type="core/text" name="acc_kdt">
122
  <action method="setText">
123
  <text>
129
  </konduto_customer_account_index>
130
 
131
  <konduto_catalog_category_default>
132
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
133
  <block type="core/text" name="category_kdt">
134
  <action method="setText">
135
  <text>
141
  </konduto_catalog_category_default>
142
 
143
  <konduto_catalog_category_view>
144
+ <reference name="head" ifconfig="scoreoptions/messages/activate">
145
  <block type="core/text" name="category_kdt">
146
  <action method="setText">
147
  <text>
app/design/frontend/base/default/template/score/score.phtml CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
  $public = '';
3
- if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
 
4
  $mode = Mage::getStoreConfig('scoreoptions/messages/mode');
5
  if ($mode == 1) { $public = Mage::getStoreConfig('scoreoptions/messages/productionpublickey'); }
6
  else { $public = Mage::getStoreConfig('scoreoptions/messages/sandboxpublickey'); }
7
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
8
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
9
- $customerId = $customerData->getId();
10
  }
11
  }
12
  ?>
1
  <?php
2
  $public = '';
3
+ if (!Mage::getStoreConfig("scoreoptions/messages/activate")) return false;
4
+ elseif (Mage::getStoreConfig("scoreoptions/messages/activate")) {
5
  $mode = Mage::getStoreConfig('scoreoptions/messages/mode');
6
  if ($mode == 1) { $public = Mage::getStoreConfig('scoreoptions/messages/productionpublickey'); }
7
  else { $public = Mage::getStoreConfig('scoreoptions/messages/sandboxpublickey'); }
8
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
9
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
10
+ $customerId = $customerData->getId();
11
  }
12
  }
13
  ?>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Konduto</name>
4
- <version>1.6.2</version>
5
  <stability>stable</stability>
6
  <license>OSLv3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Konduto fraud detection service integration</summary>
10
  <description>Konduto is a fraud detection service that helps e-commerce merchants spot fraud with Buying Behavior</description>
11
- <notes>- Added tag to OSC page</notes>
12
  <authors><author><name>Konduto</name><user>konduto</user><email>magentoconnect@konduto.com</email></author></authors>
13
- <date>2015-01-06</date>
14
- <time>20:48:46</time>
15
- <contents><target name="magecommunity"><dir name="Konduto"><dir name="Score"><dir name="Block"><dir name="Adminhtml"><dir name="Order"><file name="Grid.php" hash="7ca27f1f6cfb61b5658ecf6bfdf83466"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Score.php" hash="5690f0e18f102bf2a1747708e81d2d6f"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4eb1e86fb4c5f3833f5d055d594b6a16"/><file name="Order.php" hash="c5f2722bf994660707b18f219d5a3730"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Score"><file name="Collection.php" hash="2dedf14be82d224d6d8f56fe1a4fa5fc"/></dir><file name="Score.php" hash="938cbb8ae489bc9b0c39e75ca0f180f1"/></dir><file name="Observer.php" hash="f5f3548312985f8ce0144b6d938067f0"/><file name="Score.php" hash="d9f8efdb0b45bbb00c0faf62e23c2b26"/><dir name="System"><file name="Review.php" hash="141b400a28bf7f280f2bddf582eb4949"/><file name="Save.php" hash="8e059419faa31fe0f5592651436ff092"/><file name="Select.php" hash="7af3a6cc2f51f3c503385406d381307a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ScoreController.php" hash="f82feac7c2074c32f5254c5c7b915c01"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="df125e243e6163fcd0a4c1401c0e18c6"/><file name="config.xml" hash="d45f3f47b8e4ef25a331fa2c0b67bab4"/><file name="system.xml" hash="9946ce3210bb4b8a3cbe9761ad2604e1"/></dir><dir name="sql"><dir name="score_setup"><file name="mysql4-install-0.1.0.php" hash="81b07a2cfb4bb6910166e1f6cfa9a838"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="score.xml" hash="435c86b572cddcc6f92a683709acb22d"/></dir><dir name="template"><dir name="score"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="26738627adec425585f59334aea405bb"/><file name="score.phtml" hash="d119d621d868c815f705c615bd1b1db2"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="score.xml" hash="aae56257e1c48d7878f0010f1998928d"/></dir><dir name="template"><dir name="score"><file name="product.phtml" hash="70f95845a94de6aee51a7711633bebc5"/><file name="score.phtml" hash="9476dc1f6663a258685849c92b010d1a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Konduto_Score.xml" hash="c549e42d553ccdeeb1e1ff8e7af82194"/></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Konduto_Score.csv" hash="58c42a8ccf3b8c982546f11336cde45b"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Konduto</name>
4
+ <version>1.7.0</version>
5
  <stability>stable</stability>
6
  <license>OSLv3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Konduto fraud detection service integration</summary>
10
  <description>Konduto is a fraud detection service that helps e-commerce merchants spot fraud with Buying Behavior</description>
11
+ <notes>Bugfixes.</notes>
12
  <authors><author><name>Konduto</name><user>konduto</user><email>magentoconnect@konduto.com</email></author></authors>
13
+ <date>2015-07-20</date>
14
+ <time>19:31:01</time>
15
+ <contents><target name="magecommunity"><dir name="Konduto"><dir name="Score"><dir name="Block"><dir name="Adminhtml"><dir name="Order"><file name="Grid.php" hash="7ca27f1f6cfb61b5658ecf6bfdf83466"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Score.php" hash="5690f0e18f102bf2a1747708e81d2d6f"/></dir></dir></dir><file name="Score.php" hash="85747c2a03ba92433cb4873cface6ca6"/></dir><dir name="Helper"><file name="Data.php" hash="4eb1e86fb4c5f3833f5d055d594b6a16"/><file name="Order.php" hash="43c56bc2883167313793c3086aa7fbd7"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Score"><file name="Collection.php" hash="2dedf14be82d224d6d8f56fe1a4fa5fc"/></dir><file name="Score.php" hash="938cbb8ae489bc9b0c39e75ca0f180f1"/></dir><file name="Observer.php" hash="cc6abbdd0db1c9ec3f48c675c15d82c6"/><file name="Score.php" hash="d9f8efdb0b45bbb00c0faf62e23c2b26"/><dir name="System"><file name="Review.php" hash="141b400a28bf7f280f2bddf582eb4949"/><file name="Save.php" hash="8e059419faa31fe0f5592651436ff092"/><file name="Select.php" hash="7af3a6cc2f51f3c503385406d381307a"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ScoreController.php" hash="f82feac7c2074c32f5254c5c7b915c01"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="df125e243e6163fcd0a4c1401c0e18c6"/><file name="config.xml" hash="41f16bc0f11c8b288807b9ca661c1adc"/><file name="system.xml" hash="a46d494d7566035f66c2551bc676eed8"/></dir><dir name="sql"><dir name="score_setup"><file name="mysql4-install-1.7.0.php" hash="6ac3b333d0e6148930d72275a307886c"/><file name="mysql4-upgrade-0.1.0-1.7.0.php" hash="91956a9c620c0e5aeebacf085e48b12f"/></dir><file name=".DS_Store" hash="9a56e641bdafce525911e10c25af04ef"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="score.xml" hash="435c86b572cddcc6f92a683709acb22d"/></dir><dir name="template"><dir name="score"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="26738627adec425585f59334aea405bb"/><file name="score.phtml" hash="d119d621d868c815f705c615bd1b1db2"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="score.xml" hash="1e7976cd63d9217eab655ecd28c50f3d"/></dir><dir name="template"><dir name="score"><file name="product.phtml" hash="70f95845a94de6aee51a7711633bebc5"/><file name="score.phtml" hash="74e80077128c736c6457a6f35dc02ba4"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Konduto_Score.xml" hash="c549e42d553ccdeeb1e1ff8e7af82194"/></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Konduto_Score.csv" hash="58c42a8ccf3b8c982546f11336cde45b"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>