Version Notes
- Fix bug with Boleto payments
Download this release
Release Info
Developer | Konduto |
Extension | Konduto |
Version | 1.5.4 |
Comparing to | |
See all releases |
Code changes from version 1.5.3 to 1.5.4
app/code/community/Konduto/Score/Helper/Order.php
CHANGED
@@ -8,8 +8,13 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
8 |
$order_id = "Try-".$order->getIncrementId()."-".uniqid();
|
9 |
$currency = $odm->getQuoteCurrencyCode();
|
10 |
$payment = $this->getPaymentDetails($order);
|
11 |
-
if (!$payment['include']) {
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
unset($payment['include']);
|
14 |
$billing = $order->getBillingAddress()->getData();
|
15 |
$shipping = $order->getShippingAddress()->getData();
|
@@ -74,6 +79,14 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
74 |
|
75 |
public function setOrderPayment($order) {
|
76 |
$data = unserialize(Mage::getSingleton('core/session')->getScoreData());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
$data['id'] = $order->getIncrementId();
|
78 |
$data['payment'][0]['status'] = "pending";
|
79 |
$data['analyze'] = true;
|
@@ -83,6 +96,14 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
83 |
|
84 |
public function fireRequest() {
|
85 |
$data = unserialize(Mage::getSingleton('core/session')->getScoreData());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
if (isset($data['oid'])) {
|
87 |
$oid = $data['oid'];
|
88 |
unset($data['oid']);
|
@@ -90,7 +111,7 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
90 |
$data = json_encode($data);
|
91 |
$header = array();
|
92 |
$header[] = 'Content-type: application/json; charset=utf-8';
|
93 |
-
$header[] = 'X-Requested-With: Magento v1.5.
|
94 |
$mode = Mage::getStoreConfig('scoreoptions/messages/mode');
|
95 |
if ($mode == 1) {
|
96 |
$private = Mage::getStoreConfig('scoreoptions/messages/productionprikey');
|
@@ -124,8 +145,7 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
124 |
}
|
125 |
|
126 |
if (isset($oid)) {
|
127 |
-
$save = $this->saveData($data, $resp, $oid);
|
128 |
-
Mage::getSingleton('core/session')->unsScoreAttempt();
|
129 |
}
|
130 |
}
|
131 |
|
@@ -135,6 +155,8 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
135 |
$ccNumber = is_numeric($cc) ? $cc : Mage::helper('core')->decrypt($cc);
|
136 |
$cc_six = substr($ccNumber, 0, 6);
|
137 |
$ret["type"] = "credit";
|
|
|
|
|
138 |
if (($payment->getCcExpMonth()) && ($payment->getCcExpYear())) {
|
139 |
$ret["expiration_date"] = sprintf("%02d", $payment->getCcExpMonth()) . $payment->getCcExpYear();
|
140 |
}
|
@@ -177,9 +199,12 @@ class Konduto_Score_Helper_Order extends Mage_Core_Helper_Abstract {
|
|
177 |
return $ret;
|
178 |
}
|
179 |
|
180 |
-
public function getVisitorId() {
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
183 |
}
|
184 |
|
185 |
public function saveData($data, $resp, $id) {
|
8 |
$order_id = "Try-".$order->getIncrementId()."-".uniqid();
|
9 |
$currency = $odm->getQuoteCurrencyCode();
|
10 |
$payment = $this->getPaymentDetails($order);
|
11 |
+
if (!$payment['include']) {
|
12 |
+
Mage::getSingleton('core/session')->unsScorePrepared();
|
13 |
+
if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
|
14 |
+
Mage::log('No credit card detected. Will not send for analysis.', null, 'konduto.log');
|
15 |
+
}
|
16 |
+
return;
|
17 |
+
}
|
18 |
unset($payment['include']);
|
19 |
$billing = $order->getBillingAddress()->getData();
|
20 |
$shipping = $order->getShippingAddress()->getData();
|
79 |
|
80 |
public function setOrderPayment($order) {
|
81 |
$data = unserialize(Mage::getSingleton('core/session')->getScoreData());
|
82 |
+
if ((!isset($data)) || (!$data)) {
|
83 |
+
Mage::getSingleton('core/session')->unsScorePrepared();
|
84 |
+
Mage::getSingleton('core/session')->unsScoreData();
|
85 |
+
if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
|
86 |
+
Mage::log('No serialized data found. Aborting...', null, 'konduto.log');
|
87 |
+
}
|
88 |
+
return;
|
89 |
+
}
|
90 |
$data['id'] = $order->getIncrementId();
|
91 |
$data['payment'][0]['status'] = "pending";
|
92 |
$data['analyze'] = true;
|
96 |
|
97 |
public function fireRequest() {
|
98 |
$data = unserialize(Mage::getSingleton('core/session')->getScoreData());
|
99 |
+
if ((!isset($data)) || (!$data)) {
|
100 |
+
Mage::getSingleton('core/session')->unsScorePrepared();
|
101 |
+
Mage::getSingleton('core/session')->unsScoreData();
|
102 |
+
if (Mage::getStoreConfig("scoreoptions/messages/debug")) {
|
103 |
+
Mage::log('No serialized data found. Aborting...', null, 'konduto.log');
|
104 |
+
}
|
105 |
+
return;
|
106 |
+
}
|
107 |
if (isset($data['oid'])) {
|
108 |
$oid = $data['oid'];
|
109 |
unset($data['oid']);
|
111 |
$data = json_encode($data);
|
112 |
$header = array();
|
113 |
$header[] = 'Content-type: application/json; charset=utf-8';
|
114 |
+
$header[] = 'X-Requested-With: Magento v1.5.4';
|
115 |
$mode = Mage::getStoreConfig('scoreoptions/messages/mode');
|
116 |
if ($mode == 1) {
|
117 |
$private = Mage::getStoreConfig('scoreoptions/messages/productionprikey');
|
145 |
}
|
146 |
|
147 |
if (isset($oid)) {
|
148 |
+
$save = $this->saveData($data, $resp, $oid);
|
|
|
149 |
}
|
150 |
}
|
151 |
|
155 |
$ccNumber = is_numeric($cc) ? $cc : Mage::helper('core')->decrypt($cc);
|
156 |
$cc_six = substr($ccNumber, 0, 6);
|
157 |
$ret["type"] = "credit";
|
158 |
+
$ret["include"] = false;
|
159 |
+
$ret['status'] = "declined";
|
160 |
if (($payment->getCcExpMonth()) && ($payment->getCcExpYear())) {
|
161 |
$ret["expiration_date"] = sprintf("%02d", $payment->getCcExpMonth()) . $payment->getCcExpYear();
|
162 |
}
|
199 |
return $ret;
|
200 |
}
|
201 |
|
202 |
+
public function getVisitorId($id = NULL) {
|
203 |
+
if (isset($_COOKIE['_kdt'])) {
|
204 |
+
$cookie = json_decode($_COOKIE['_kdt'], true);
|
205 |
+
$id = $cookie['i'];
|
206 |
+
}
|
207 |
+
return $id;
|
208 |
}
|
209 |
|
210 |
public function saveData($data, $resp, $id) {
|
app/code/community/Konduto/Score/Model/Observer.php
CHANGED
@@ -24,12 +24,14 @@ class Konduto_Score_Model_Observer {
|
|
24 |
}
|
25 |
|
26 |
public function setScorePayment(Varien_Event_Observer $evt) {
|
|
|
27 |
$helper = Mage::helper('score/order');
|
28 |
$order = $evt->getEvent()->getOrder();
|
29 |
if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
|
30 |
$response = $helper->setOrderPayment($order);
|
31 |
}
|
32 |
return;
|
|
|
33 |
}
|
34 |
|
35 |
public function sendScoreRequest(Varien_Event_Observer $evt) {
|
@@ -38,7 +40,8 @@ class Konduto_Score_Model_Observer {
|
|
38 |
if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
|
39 |
$response = $helper->fireRequest();
|
40 |
}
|
41 |
-
Mage::getSingleton('core/session')->unsScorePrepared();
|
|
|
42 |
return;
|
43 |
}
|
44 |
}
|
24 |
}
|
25 |
|
26 |
public function setScorePayment(Varien_Event_Observer $evt) {
|
27 |
+
if (Mage::getSingleton('core/session')->getScorePrepared()) {
|
28 |
$helper = Mage::helper('score/order');
|
29 |
$order = $evt->getEvent()->getOrder();
|
30 |
if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
|
31 |
$response = $helper->setOrderPayment($order);
|
32 |
}
|
33 |
return;
|
34 |
+
}
|
35 |
}
|
36 |
|
37 |
public function sendScoreRequest(Varien_Event_Observer $evt) {
|
40 |
if (Mage::getStoreConfig("scoreoptions/messages/activate")) {
|
41 |
$response = $helper->fireRequest();
|
42 |
}
|
43 |
+
Mage::getSingleton('core/session')->unsScorePrepared();
|
44 |
+
Mage::getSingleton('core/session')->unsScoreData();
|
45 |
return;
|
46 |
}
|
47 |
}
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Konduto</name>
|
4 |
-
<version>1.5.
|
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>- Fix bug
|
12 |
<authors><author><name>Konduto</name><user>konduto</user><email>magentoconnect@konduto.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<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="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6</min><max>1.9.0.1</max></package></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Konduto</name>
|
4 |
+
<version>1.5.4</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>- Fix bug with Boleto payments</notes>
|
12 |
<authors><author><name>Konduto</name><user>konduto</user><email>magentoconnect@konduto.com</email></author></authors>
|
13 |
+
<date>2014-12-04</date>
|
14 |
+
<time>18:28:42</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="2e08126eb4590457212a68da742c8046"/></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="3dac0f3af399d616b7e65a1a730e616a"/><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="61acd8795dfda6f798c259d3cd1529bb"/><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="29dd16ae1e2303ad342d318ce60da80a"/></dir><dir name="template"><dir name="score"><file name="product.phtml" hash="70f95845a94de6aee51a7711633bebc5"/><file name="score.phtml" hash="16f9fbc2c3fb185da563c5ba24dd558a"/></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><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.0.1</max></package></required></dependencies>
|
18 |
</package>
|