Version Notes
Added blacklist button
Download this release
Release Info
Developer | Hexasoft |
Extension | Hexasoft_FraudLabsPro |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
app/code/local/Hexasoft/FraudLabsPro/Block/Sales/Order/Fraudlabsproresult.php
CHANGED
@@ -9,14 +9,15 @@ class Hexasoft_FraudLabsPro_Block_Sales_Order_Fraudlabsproresult extends Mage_Ad
|
|
9 |
|
10 |
$data = unserialize($order->getfraudlabspro_response());
|
11 |
|
12 |
-
if(isset($_GET['approve']) || isset($_GET['
|
13 |
$data['fraudlabspro_status'] = (isset($_GET['approve'])) ? 'APPROVE' : 'REJECT';
|
|
|
14 |
$apiKey = (isset($_GET['apiKey'])) ? $_GET['apiKey'] : '';
|
15 |
$flpId = (isset($_GET['flpId'])) ? $_GET['flpId'] : '';
|
16 |
|
17 |
|
18 |
for($i=0; $i<3; $i++){
|
19 |
-
$response = $this->_get('https://api.fraudlabspro.com/v1/order/feedback?key=' . rawurlencode($apiKey) . '&action=' . $
|
20 |
|
21 |
if(is_null($result = json_decode($response, true)) === FALSE) break;
|
22 |
}
|
@@ -153,7 +154,8 @@ class Hexasoft_FraudLabsPro_Block_Sales_Order_Fraudlabsproresult extends Mage_Ad
|
|
153 |
|
154 |
<div style="text-align:center;padding:10px">
|
155 |
<input type="submit" name="approve" value="Approve Order" />
|
156 |
-
<input type="submit" name="
|
|
|
157 |
</div>
|
158 |
</form>
|
159 |
</td>
|
9 |
|
10 |
$data = unserialize($order->getfraudlabspro_response());
|
11 |
|
12 |
+
if(isset($_GET['approve']) || isset($_GET['reject']) || isset($_GET['reject-blacklist'])){
|
13 |
$data['fraudlabspro_status'] = (isset($_GET['approve'])) ? 'APPROVE' : 'REJECT';
|
14 |
+
$action = (isset($_GET['approve'])) ? 'APPROVE' : ((isset($_GET['reject'])) ? 'REJECT' : 'REJECT_BLACKLIST');
|
15 |
$apiKey = (isset($_GET['apiKey'])) ? $_GET['apiKey'] : '';
|
16 |
$flpId = (isset($_GET['flpId'])) ? $_GET['flpId'] : '';
|
17 |
|
18 |
|
19 |
for($i=0; $i<3; $i++){
|
20 |
+
$response = $this->_get('https://api.fraudlabspro.com/v1/order/feedback?key=' . rawurlencode($apiKey) . '&action=' . $action . '&id=' . rawurlencode($flpId) . '&format=json');
|
21 |
|
22 |
if(is_null($result = json_decode($response, true)) === FALSE) break;
|
23 |
}
|
154 |
|
155 |
<div style="text-align:center;padding:10px">
|
156 |
<input type="submit" name="approve" value="Approve Order" />
|
157 |
+
<input type="submit" name="reject" value="Reject Order" />
|
158 |
+
<input type="submit" name="reject-blacklist" value="Blacklist Order" />
|
159 |
</div>
|
160 |
</form>
|
161 |
</td>
|
app/code/local/Hexasoft/FraudLabsPro/Controller/Observer.php
CHANGED
@@ -61,12 +61,24 @@ class Hexasoft_FraudLabsPro_Controller_Observer{
|
|
61 |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
62 |
}
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
$queries = array(
|
65 |
'format' => 'json',
|
66 |
'key' => $apiKey,
|
67 |
'ip' => $ip,
|
68 |
'first_name' => $order->getCustomerFirstname(),
|
69 |
'last_name' => $order->getCustomerLastname(),
|
|
|
70 |
'bill_city' => $billingAddress->getCity(),
|
71 |
'bill_state' => $billingAddress->getRegion(),
|
72 |
'bill_country' => $billingAddress->getCountryId(),
|
@@ -80,9 +92,10 @@ class Hexasoft_FraudLabsPro_Controller_Observer{
|
|
80 |
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
81 |
'user_order_id' => $orderId,
|
82 |
'magento_order_id' => $order->getEntityId(),
|
|
|
83 |
'flp_checksum' => Mage::getModel('core/cookie')->get('flp_checksum'),
|
84 |
'source' => 'magento',
|
85 |
-
'source_version' => '1.2.
|
86 |
);
|
87 |
|
88 |
$shippingAddress = $order->getShippingAddress();
|
61 |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
62 |
}
|
63 |
|
64 |
+
$payment_mode = $order->getPayment()->getMethod();
|
65 |
+
if($payment_mode === 'ccsave'){
|
66 |
+
$paymentMode = 'creditcard';
|
67 |
+
}elseif($payment_mode === 'cashondelivery'){
|
68 |
+
$paymentMode = 'cod';
|
69 |
+
}elseif($payment_mode === 'paypal_standard' || $payment_mode === 'paypal_express'){
|
70 |
+
$paymentMode = 'paypal';
|
71 |
+
}else{
|
72 |
+
$paymentMode = $payment_mode;
|
73 |
+
}
|
74 |
+
|
75 |
$queries = array(
|
76 |
'format' => 'json',
|
77 |
'key' => $apiKey,
|
78 |
'ip' => $ip,
|
79 |
'first_name' => $order->getCustomerFirstname(),
|
80 |
'last_name' => $order->getCustomerLastname(),
|
81 |
+
'bill_addr' => trim($billingAddress->getStreet(1) . ' ' . $billingAddress->getStreet(2)),
|
82 |
'bill_city' => $billingAddress->getCity(),
|
83 |
'bill_state' => $billingAddress->getRegion(),
|
84 |
'bill_country' => $billingAddress->getCountryId(),
|
92 |
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
93 |
'user_order_id' => $orderId,
|
94 |
'magento_order_id' => $order->getEntityId(),
|
95 |
+
'payment_mode' => $paymentMode,
|
96 |
'flp_checksum' => Mage::getModel('core/cookie')->get('flp_checksum'),
|
97 |
'source' => 'magento',
|
98 |
+
'source_version' => '1.2.2',
|
99 |
);
|
100 |
|
101 |
$shippingAddress = $order->getShippingAddress();
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hexasoft_FraudLabsPro</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU Lesser General Public License (LGPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension screens online transactions for frauds.</summary>
|
10 |
<description>FraudLabs Pro service screens online transactions for frauds. It increases e-commerce merchant profits by reduces chargeback, improves operation efficiency and provides business intelligence.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Hexasoft</name><user>hexasoft</user><email>tech@hexasoft.com.my</email></author></authors>
|
13 |
-
<date>2017-03
|
14 |
-
<time>07:
|
15 |
-
<contents><target name="magelocal"><dir name="Hexasoft"><dir name="FraudLabsPro"><dir name="Block"><file name="Agent.php" hash="4bdc83087e13d73c5aad938e13514255"/><dir name="Sales"><dir name="Order"><file name="Fraudlabsproresult.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Hexasoft_FraudLabsPro</name>
|
4 |
+
<version>1.2.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU Lesser General Public License (LGPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension screens online transactions for frauds.</summary>
|
10 |
<description>FraudLabs Pro service screens online transactions for frauds. It increases e-commerce merchant profits by reduces chargeback, improves operation efficiency and provides business intelligence.</description>
|
11 |
+
<notes>Added blacklist button</notes>
|
12 |
<authors><author><name>Hexasoft</name><user>hexasoft</user><email>tech@hexasoft.com.my</email></author></authors>
|
13 |
+
<date>2017-05-03</date>
|
14 |
+
<time>07:54:29</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Hexasoft"><dir name="FraudLabsPro"><dir name="Block"><file name="Agent.php" hash="4bdc83087e13d73c5aad938e13514255"/><dir name="Sales"><dir name="Order"><file name="Fraudlabsproresult.php" hash="08f826f66a55d039747c6ba54d94513a"/><file name="Grid.php" hash="154790c49632c35af5e301c33a1e3188"/><dir name="Grid"><dir name="Renderer"><file name="Risk.php" hash="19c8ca6a7656fee2e66b904dc97079a0"/></dir></dir></dir></dir></dir><dir name="Controller"><file name="Observer.php" hash="2ca0aff3e0f9f2e5e35027a395f624cd"/></dir><dir name="controllers"><file name="IndexController.php" hash="2bc99063ff21e0a4484e2955e78ccf46"/></dir><dir name="etc"><file name="adminhtml.xml" hash="38ccfabe77e18a8f8d9050359d44d13e"/><file name="config.xml" hash="a2d8b01249aeb5de4906a14790a86feb"/><file name="system.xml" hash="fbed11ab9291bc1f95112559562df9c7"/></dir><dir name="Helper"><file name="Data.php" hash="948a251b0d5415653b1efce1af279b28"/></dir><dir name="sql"><dir name="fraudlabspro_setup"><file name="mysql4-install-1.0.0.php" hash="be13e48218b5120641393e68df201d8b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fraudlabspro.xml" hash="43ae7917d3084744031b90d33f515f87"/></dir><dir name="template"><dir name="fraudlabspro"><dir name="sales"><dir name="order"><dir name="view"><dir name="tab"><file name="info.phtml" hash="25a46ae56e812c120f2125ad32f4bb1c"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="fraudlabspro_agent.xml" hash="d5a98ac1e05315bc3bc4b5f4aef948d2"/></dir><dir name="template"><dir name="fraudlabspro"><file name="agent.phtml" hash="51c365bd36dcad836a573798d2df14ff"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hexasoft_FraudLabsPro.xml" hash="e8bb308243797bda5769209a8b360577"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|