Version Notes
The first stable release of the FraudShields Extension
Download this release
Release Info
Developer | Shaya Krauss |
Extension | FraudShields |
Version | 1.3.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.1.0 to 1.3.0.0
app/code/local/FraudShields/Post/Model/Observer.php
CHANGED
@@ -1,100 +1,101 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$
|
26 |
-
$
|
27 |
-
$
|
28 |
-
$
|
29 |
-
$
|
30 |
-
$
|
31 |
-
$
|
32 |
-
$
|
33 |
-
$
|
34 |
-
$
|
35 |
-
foreach ($items as $itemId => $item)
|
36 |
-
{
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
$
|
45 |
-
$
|
46 |
-
$
|
47 |
-
$
|
48 |
-
$
|
49 |
-
|
50 |
-
"
|
51 |
-
"
|
52 |
-
"
|
53 |
-
"
|
54 |
-
"
|
55 |
-
"
|
56 |
-
"
|
57 |
-
"
|
58 |
-
"
|
59 |
-
"
|
60 |
-
"
|
61 |
-
"
|
62 |
-
"
|
63 |
-
"
|
64 |
-
"
|
65 |
-
"
|
66 |
-
"
|
67 |
-
"
|
68 |
-
"
|
69 |
-
"
|
70 |
-
"
|
71 |
-
"
|
72 |
-
"
|
73 |
-
"
|
74 |
-
"
|
75 |
-
"
|
76 |
-
"
|
77 |
-
"
|
78 |
-
"
|
79 |
-
"
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"
|
83 |
-
"
|
84 |
-
"
|
85 |
-
"
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
curl_setopt($curl,
|
94 |
-
curl_setopt($curl,
|
95 |
-
curl_setopt($curl,
|
96 |
-
curl_setopt($curl,
|
97 |
-
curl_setopt
|
98 |
-
|
99 |
-
|
|
|
100 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FraudShields_Post_Model_Observer extends Mage_Payment_Block_Info {
|
4 |
+
public $cardnum;
|
5 |
+
public $exp;
|
6 |
+
|
7 |
+
public function FraudShieldsBefore(Varien_Event_Observer $observer) {
|
8 |
+
$order = $observer->getEvent()->getOrder();
|
9 |
+
$this->cardnum = $order->getPayment()->getCcNumber();
|
10 |
+
$this->exp = str_pad($order->getPayment()->getCcExpMonth(),2,'0',STR_PAD_LEFT) . substr($order->getPayment()->getCcExpYear(), -2);
|
11 |
+
}
|
12 |
+
|
13 |
+
public function FraudShieldsAfter(Varien_Event_Observer $observer) {
|
14 |
+
$parms=Mage::app()->getFrontController()->getRequest()->getParams();
|
15 |
+
//Get Payment Detail
|
16 |
+
extract($parms);
|
17 |
+
$payment;
|
18 |
+
$order = $observer->getEvent()->getOrder();
|
19 |
+
$cardsStorage = Mage::getModel('paygate/authorizenet_cards')->setPayment($order->getPayment());
|
20 |
+
foreach ($cardsStorage->getCards() as $card) {
|
21 |
+
$lastTransId = $card->getLastTransId();
|
22 |
+
}
|
23 |
+
//Get Shipping Detail
|
24 |
+
$shipping=array();
|
25 |
+
$_shippingAddress = $order->getShippingAddress();
|
26 |
+
$_billingAddress = $order->getBillingAddress();
|
27 |
+
$items = $order->getAllItems();
|
28 |
+
$itemcount=count($items);
|
29 |
+
$name=array();
|
30 |
+
$unitPrice=array();
|
31 |
+
$sku=array();
|
32 |
+
$ids=array();
|
33 |
+
$qty=array();
|
34 |
+
$OrderItems = array();
|
35 |
+
foreach ($items as $itemId => $item)
|
36 |
+
{
|
37 |
+
$OrderItems[] = array(
|
38 |
+
'name' => $item->getName(),
|
39 |
+
'unitPrice' => $item->getPrice(),
|
40 |
+
'sku' => $item->getSku(),
|
41 |
+
'qty' => $item->getQtyOrdered()
|
42 |
+
);
|
43 |
+
}
|
44 |
+
$shipping_street = $_shippingAddress->getStreet();
|
45 |
+
$billing_street = $_billingAddress->getStreet();
|
46 |
+
$message = Mage::getModel('giftmessage/message');
|
47 |
+
$gift_message_id = $order->getGiftMessageId();
|
48 |
+
$message->load((int)$gift_message_id);
|
49 |
+
$postdata=array(
|
50 |
+
"order_id" => $order->getIncrementId(),
|
51 |
+
"customername" => $order->getCustomerName(), // Customer Name
|
52 |
+
"customeremail" => $order->getCustomerEmail(),// Customer Email
|
53 |
+
"shippingmethod" => $order->getShippingMethod(), // Shipping Method
|
54 |
+
"shippingamount" => $order->getShippingAmount(), // ShippingAmount
|
55 |
+
"grandtotal" => $order->getGrandTotal(), // Grand Total
|
56 |
+
"domain" => Mage::getBaseUrl(), // Domain nname
|
57 |
+
"shipping_firstname" => $_shippingAddress->getFirstname(),
|
58 |
+
"shipping_lastname" => $_shippingAddress->getLastname(),
|
59 |
+
"shipping_company" => $_shippingAddress->getCompany(),
|
60 |
+
"shipping_street" => $shipping_street[0],
|
61 |
+
"shipping_region" => $_shippingAddress->getRegion(),
|
62 |
+
"shipping_city" => $_shippingAddress->getCity(),
|
63 |
+
"shipping_postcode" => $_shippingAddress->getPostcode(),
|
64 |
+
"shipping_telephone" => $_shippingAddress->getTelephone(),
|
65 |
+
"shipping_country_id" => $_shippingAddress->getCountry(),
|
66 |
+
"billing_firstname" => $_billingAddress->getFirstname(),
|
67 |
+
"billing_lastname" => $_billingAddress->getLastname(),
|
68 |
+
"billing_company" => $_billingAddress->getCompany(),
|
69 |
+
"billing_street" => $billing_street[0],
|
70 |
+
"billing_region" => $_billingAddress->getRegion(),
|
71 |
+
"billing_city" => $_billingAddress->getCity(),
|
72 |
+
"billing_postcode" => $_billingAddress->getPostcode(),
|
73 |
+
"billing_telephone" => $_billingAddress->getTelephone(),
|
74 |
+
"billing_country_id" => $_billingAddress->getCountry(),
|
75 |
+
"ip" => $_SERVER["REMOTE_ADDR"],
|
76 |
+
"cardnum" => $this->cardnum,
|
77 |
+
"exp" => $this->exp,
|
78 |
+
"key" => Mage::getStoreConfig('tab1/general/text_field'),
|
79 |
+
"gift_message" => $message->getData('message'),
|
80 |
+
"version" => (string) Mage::getConfig()->getNode()->modules->FraudShields_Post->version,
|
81 |
+
"GatewayRefNum" => $lastTransId,
|
82 |
+
"GatewayResult" => "", // TODO: Add
|
83 |
+
"GatewayError" => "", // TODO: Add
|
84 |
+
"GatewayAVS" => "", // TODO: Add
|
85 |
+
"GatewayCVV" => "", // TODO: Add
|
86 |
+
"OrderItems" => $OrderItems // TODO: Add
|
87 |
+
);
|
88 |
+
|
89 |
+
$json = json_encode($postdata);
|
90 |
+
|
91 |
+
// Server url where json data send
|
92 |
+
$curl = curl_init('https://x1.fidelipay.com/fs');
|
93 |
+
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
94 |
+
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
95 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
96 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
97 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
98 |
+
curl_setopt ($curl, CURLOPT_POSTFIELDS,$json);
|
99 |
+
$result = curl_exec($curl);
|
100 |
+
}
|
101 |
}
|
app/code/local/FraudShields/Post/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<tab1>
|
12 |
+
<title>FraudShields Config</title> <!-- Used in resources tree -->
|
13 |
+
</tab1>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/local/FraudShields/Post/etc/config.xml
CHANGED
@@ -1,30 +1,35 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<FraudShields_Post>
|
5 |
+
<version>1.3.0.0</version>
|
6 |
+
</FraudShields_Post>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<fraudshields_post>
|
11 |
+
<class>FraudShields_Post_Model</class>
|
12 |
+
</fraudshields_post>
|
13 |
+
</models>
|
14 |
+
<events>
|
15 |
+
<sales_order_place_before>
|
16 |
+
<observers>
|
17 |
+
<fraudshields_post>
|
18 |
+
<class>fraudshields_post/observer</class>
|
19 |
+
<method>FraudShieldsBefore</method>
|
20 |
+
<type>singleton</type>
|
21 |
+
</fraudshields_post>
|
22 |
+
</observers>
|
23 |
+
</sales_order_place_before>
|
24 |
+
<sales_order_place_after>
|
25 |
+
<observers>
|
26 |
+
<fraudshields_post>
|
27 |
+
<class>fraudshields_post/observer</class>
|
28 |
+
<method>FraudShieldsAfter</method>
|
29 |
+
<type>singleton</type>
|
30 |
+
</fraudshields_post>
|
31 |
+
</observers>
|
32 |
+
</sales_order_place_after>
|
33 |
+
</events>
|
34 |
+
</global>
|
35 |
</config>
|
app/code/local/FraudShields/Post/etc/system.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<tab1 translate="label" module="adminhtml">
|
5 |
+
<label>FraudShields Configuration</label>
|
6 |
+
<tab>sales</tab>
|
7 |
+
<sort_order>1000</sort_order>
|
8 |
+
<show_in_default>1</show_in_default>
|
9 |
+
<show_in_website>1</show_in_website>
|
10 |
+
<show_in_store>1</show_in_store>
|
11 |
+
<groups>
|
12 |
+
<general translate="label comment">
|
13 |
+
<label>General</label>
|
14 |
+
<sort_order>50</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<expanded>1</expanded>
|
19 |
+
<fields>
|
20 |
+
<text_field translate="label comment">
|
21 |
+
<label>FraudShields Key</label>
|
22 |
+
<comment>Your Personal FraudShields Key Here</comment>
|
23 |
+
<frontend_type>password</frontend_type>
|
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>
|
28 |
+
</text_field>
|
29 |
+
</fields>
|
30 |
+
</general>
|
31 |
+
</groups>
|
32 |
+
</tab1>
|
33 |
+
</sections>
|
34 |
+
</config>
|
app/etc/modules/FraudShields_Post.xml
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
</config>
|
10 |
-
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<FraudShields_Post>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</FraudShields_Post>
|
8 |
+
</modules>
|
9 |
+
</config>
|
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FraudShields</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>FraudShields Extension</summary>
|
10 |
-
<description>This is the
|
11 |
-
|
|
|
|
|
12 |
<authors><author><name>Shaya Krauss</name><user>fpswebmaster</user><email>webmaster@fidelitypayment.com</email></author></authors>
|
13 |
-
<date>2013-12-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="FraudShields"><dir name="Post"><dir name="Model"><file name="Observer.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FraudShields</name>
|
4 |
+
<version>1.3.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>FraudShields Online Fraud Protection Extension</summary>
|
10 |
+
<description>This is the official FraudShields Magento Extension.
|
11 |
+

|
12 |
+
For more info visit http://fraudshields.com/</description>
|
13 |
+
<notes>The first stable release of the FraudShields Extension</notes>
|
14 |
<authors><author><name>Shaya Krauss</name><user>fpswebmaster</user><email>webmaster@fidelitypayment.com</email></author></authors>
|
15 |
+
<date>2013-12-27</date>
|
16 |
+
<time>17:32:50</time>
|
17 |
+
<contents><target name="magelocal"><dir name="FraudShields"><dir name="Post"><dir name="Model"><file name="Observer.php" hash="2c38d8a777f40e90680118da25fcf08d"/></dir><dir name="etc"><file name="config.xml" hash="d437c91c58849dc592ec512de60efb40"/><file name="adminhtml.xml" hash="d677b49801a1a685a51c9d72f1466143"/><file name="system.xml" hash="5377821d52d403032a31a690bbe0f8af"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="FraudShields_Post.xml" hash="ce04ec50e7e1ad4ebbcbec6180c9f925"/></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|