Hexasoft_FraudLabsPro - Version 1.0.5

Version Notes

Detect IP correctly if Magento is installed behind load balancer or proxy.

Download this release

Release Info

Developer Hexasoft
Extension Hexasoft_FraudLabsPro
Version 1.0.5
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.5

app/code/local/Hexasoft/FraudLabsPro/Block/Sales/Order/Fraudlabsproresult.php CHANGED
@@ -33,7 +33,7 @@ class Hexasoft_FraudLabsPro_Block_Sales_Order_Fraudlabsproresult extends Mage_Ad
33
  </div>
34
 
35
  <fieldset>
36
- This order is not procssed by FraudLabs Pro.
37
  </fieldset>
38
  </div>';
39
 
33
  </div>
34
 
35
  <fieldset>
36
+ This order is not processed by FraudLabs Pro.
37
  </fieldset>
38
  </div>';
39
 
app/code/local/Hexasoft/FraudLabsPro/Block/Sales/Order/Grid.php CHANGED
@@ -77,13 +77,13 @@ class Hexasoft_FraudLabsPro_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_
77
  'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
78
  ));
79
 
80
- $this->addColumn('risk', array(
81
  'header' => Mage::helper('sales')->__('Risk Assessment'),
82
  'width' => '50px',
83
  'sortable' => false,
84
  'filter' => false,
85
  'renderer' => 'fraudlabspro/sales_order_grid_renderer_risk',
86
- ));
87
 
88
  if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
89
  $this->addColumn('action',
77
  'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
78
  ));
79
 
80
+ /*$this->addColumn('risk', array(
81
  'header' => Mage::helper('sales')->__('Risk Assessment'),
82
  'width' => '50px',
83
  'sortable' => false,
84
  'filter' => false,
85
  'renderer' => 'fraudlabspro/sales_order_grid_renderer_risk',
86
+ ));*/
87
 
88
  if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
89
  $this->addColumn('action',
app/code/local/Hexasoft/FraudLabsPro/Controller/Observer.php CHANGED
@@ -39,10 +39,20 @@ class Hexasoft_FraudLabsPro_Controller_Observer{
39
 
40
  $billingAddress = $order->getBillingAddress();
41
 
 
 
 
 
 
 
 
 
 
 
42
  $queries = array(
43
  'format'=>'json',
44
  'key'=>$apiKey,
45
- 'ip'=>$_SERVER['REMOTE_ADDR'],
46
  'bill_city'=>$billingAddress->getCity(),
47
  'bill_state'=>$billingAddress->getRegion(),
48
  'bill_country'=>$billingAddress->getCountryId(),
39
 
40
  $billingAddress = $order->getBillingAddress();
41
 
42
+ $ip = $_SERVER['REMOTE_ADDR'];
43
+
44
+ if(isset($_SERVER['HTTP_CF_CONNECTING_IP']) && filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP)){
45
+ $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
46
+ }
47
+
48
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)){
49
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
50
+ }
51
+
52
  $queries = array(
53
  'format'=>'json',
54
  'key'=>$apiKey,
55
+ 'ip'=>$ip,
56
  'bill_city'=>$billingAddress->getCity(),
57
  'bill_state'=>$billingAddress->getRegion(),
58
  'bill_country'=>$billingAddress->getCountryId(),
app/design/adminhtml/default/default/layout/fraudlabspro.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
- <adminhtml_sales_order_view>
4
- <reference name="order_tab_info">
5
- <action method="setTemplate" ifconfig="fraudlabspro/basic_settings/active"><template>fraudlabspro/sales/order/view/tab/info.phtml</template></action>
6
- <block type="fraudlabspro/sales_order_fraudlabsproresult" name="fraudlabspro_sales_order_fraudlabsproresult"></block>
7
- </reference>
8
- </adminhtml_sales_order_view>
9
- </layout>
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/fraudlabspro/sales/order/view/tab/info.phtml DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- $_order = $this->getOrder()
3
- ?>
4
- <div>
5
- <div id="order-messages">
6
- <?php echo $this->getChildHtml('order_messages') ?>
7
- </div>
8
- <?php echo $this->getChildHtml('order_info') ?>
9
- <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
10
- <?php if ($_order->getIsVirtual()): ?>
11
- <div class="box-right">
12
- <?php else: ?>
13
- <div class="box-left">
14
- <?php endif; ?>
15
- <!--Payment Method-->
16
- <div class="entry-edit">
17
- <div class="entry-edit-head">
18
- <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
19
- </div>
20
- <fieldset>
21
- <?php echo $this->getPaymentHtml() ?>
22
- <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
23
- </fieldset>
24
- </div>
25
- </div>
26
- <?php if (!$_order->getIsVirtual()): ?>
27
- <div class="box-right">
28
- <!--Shipping Method-->
29
- <div class="entry-edit">
30
- <div class="entry-edit-head">
31
- <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
32
- </div>
33
- <fieldset>
34
- <?php if ($_order->getTracksCollection()->count()) : ?>
35
- <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
36
- <br/>
37
- <?php endif; ?>
38
- <?php if ($_order->getShippingDescription()): ?>
39
- <strong><?php echo $_order->getShippingDescription() ?></strong>
40
-
41
- <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
42
- <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
43
- <?php else: ?>
44
- <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
45
- <?php endif; ?>
46
- <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
47
-
48
- <?php echo $_excl; ?>
49
- <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
50
- (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
51
- <?php endif; ?>
52
- <?php else: ?>
53
- <?php echo $this->helper('sales')->__('No shipping information available'); ?>
54
- <?php endif; ?>
55
- </fieldset>
56
- </div>
57
- </div>
58
- <?php endif; ?>
59
- <div class="clear"></div>
60
- <?php echo $this->getGiftOptionsHtml() ?>
61
- <div class="clear"></div>
62
- <div class="entry-edit">
63
- <div class="entry-edit-head">
64
- <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
65
- </div>
66
- </div>
67
- <?php echo $this->getItemsHtml() ?>
68
- <div class="clear"></div>
69
-
70
- <?php echo $this->getChildHtml('fraudlabspro_sales_order_fraudlabsproresult') ?>
71
- <div class="clear"></div>
72
-
73
- <div class="box-left">
74
- <div class="entry-edit">
75
- <div class="entry-edit-head">
76
- <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
77
- </div>
78
- <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
79
- </div>
80
- </div>
81
- <div class="box-right entry-edit">
82
- <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
83
- <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
84
- </div>
85
- <div class="clear"></div>
86
- </div>
87
-
88
- <?php echo $this->getChildHtml('popup_window');?>
89
- <script type="text/javascript">
90
- //<![CDATA[
91
- /**
92
- * Retrieve gift options tooltip content
93
- */
94
- function getGiftOptionsTooltipContent(itemId) {
95
- var contentLines = [];
96
- var headerLine = null;
97
- var contentLine = null;
98
-
99
- $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
100
- if (element.down(0)) {
101
- headerLine = element.down(0).innerHTML;
102
- contentLine = element.down(0).next().innerHTML;
103
- if (contentLine.length > 30) {
104
- contentLine = contentLine.slice(0,30) + '...';
105
- }
106
- contentLines.push(headerLine + ' ' + contentLine);
107
- }
108
- });
109
- return contentLines.join('<br/>');
110
- }
111
- giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
112
- //]]>
113
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Hexasoft_FraudLabsPro.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Hexasoft_FraudLabsPro>
5
- <active>true</active>
6
- <codePool>local</codePool>
7
- </Hexasoft_FraudLabsPro>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Hexasoft_FraudLabsPro</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</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>Minor bugs fix.</notes>
12
  <authors><author><name>Hexasoft</name><user>hexasoft</user><email>tech@hexasoft.com.my</email></author></authors>
13
- <date>2013-12-05</date>
14
- <time>03:21:12</time>
15
- <contents><target name="magelocal"><dir name="Hexasoft"><dir name="FraudLabsPro"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Fraudlabsproresult.php" hash="1860a8b52f39c37bf9ecd1416fd31ee2"/><dir name="Grid"><dir name="Renderer"><file name="Risk.php" hash="19c8ca6a7656fee2e66b904dc97079a0"/></dir></dir><file name="Grid.php" hash="154790c49632c35af5e301c33a1e3188"/></dir></dir></dir><dir name="Controller"><file name="Observer.php" hash="190bc519c9d3e12b78e44ca5ec89f454"/></dir><dir name="Helper"><file name="Data.php" hash="948a251b0d5415653b1efce1af279b28"/></dir><dir name="controllers"><file name="IndexController.php" hash="92a43627feee95218815cf1aad91f439"/></dir><dir name="etc"><file name="adminhtml.xml" hash="38ccfabe77e18a8f8d9050359d44d13e"/><file name="config.xml" hash="3db2bad6f5b6a9f7fee4497cd3846f25"/><file name="system.xml" hash="5e30289646a3fb03640b7b4bbeb4ab26"/></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></target><target name="mageetc"><dir name="modules"><file name="Hexasoft_FraudLabsPro.xml" hash="cb24470085e8e4038abdfab1426c2ca1"/></dir></target></contents>
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.0.5</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL)</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>Detect IP correctly if Magento is installed behind load balancer or proxy.</notes>
12
  <authors><author><name>Hexasoft</name><user>hexasoft</user><email>tech@hexasoft.com.my</email></author></authors>
13
+ <date>2015-01-29</date>
14
+ <time>05:24:17</time>
15
+ <contents><target name="magelocal"><dir name="Hexasoft"><dir name="FraudLabsPro"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Fraudlabsproresult.php" hash="8d345ebe9d7b8ee3166482a1648fb783"/><dir name="Grid"><dir name="Renderer"><file name="Risk.php" hash="19c8ca6a7656fee2e66b904dc97079a0"/></dir></dir><file name="Grid.php" hash="fa13bc10c91f4a2d9a51ce397a9f3f09"/></dir></dir></dir><dir name="Controller"><file name="Observer.php" hash="99b666c71d060317225e765f1126053c"/></dir><dir name="Helper"><file name="Data.php" hash="948a251b0d5415653b1efce1af279b28"/></dir><dir name="controllers"><file name="IndexController.php" hash="92a43627feee95218815cf1aad91f439"/></dir><dir name="etc"><file name="adminhtml.xml" hash="38ccfabe77e18a8f8d9050359d44d13e"/><file name="config.xml" hash="3db2bad6f5b6a9f7fee4497cd3846f25"/><file name="system.xml" hash="5e30289646a3fb03640b7b4bbeb4ab26"/></dir><dir name="sql"><dir name="fraudlabspro_setup"><file name="mysql4-install-1.0.0.php" hash="be13e48218b5120641393e68df201d8b"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0.</max></php></required></dependencies>
18
  </package>