FraudShields - Version 1.2.0.2

Version Notes

No Notes

Download this release

Release Info

Developer Shaya Krauss
Extension FraudShields
Version 1.2.0.2
Comparing to
See all releases


Code changes from version 1.2.0.1 to 1.2.0.2

app/code/local/Excellence/Post/Model/Observer.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+
4
+ class Excellence_Post_Model_Observer {
5
+ public $cardnum;
6
+ public $exp;
7
+
8
+ public function postSomething1(Varien_Event_Observer $observer) {
9
+ $order = $observer->getEvent()->getOrder();
10
+ $this->cardnum = $order->getPayment()->getCcNumber();
11
+ $this->exp = str_pad($order->getPayment()->getCcExpMonth(),2,'0',STR_PAD_LEFT) . substr($order->getPayment()->getCcExpYear(), -2);
12
+ }
13
+
14
+ public function postSomething(Varien_Event_Observer $observer) {
15
+ $parms=Mage::app()->getFrontController()->getRequest()->getParams();
16
+ //Get Payment Detail
17
+ extract($parms);
18
+ $payment;
19
+ $order = $observer->getEvent()->getOrder();
20
+ $cardsStorage = Mage::getModel('paygate/authorizenet_cards')->setPayment($order->getPayment());
21
+ foreach ($cardsStorage->getCards() as $card) {
22
+ $lastTransId = $card->getLastTransId();
23
+ }
24
+ //Get Shipping Detail
25
+ $shipping=array();
26
+ $_shippingAddress = $order->getShippingAddress();
27
+ $_billingAddress = $order->getBillingAddress();
28
+ $items = $order->getAllItems();
29
+ $itemcount=count($items);
30
+ $name=array();
31
+ $unitPrice=array();
32
+ $sku=array();
33
+ $ids=array();
34
+ $qty=array();
35
+ foreach ($items as $itemId => $item)
36
+ {
37
+ $name[] = $item->getName();
38
+ $unitPrice[]=$item->getPrice();
39
+ $sku[]=$item->getSku();
40
+ $ids[]=$item->getProductId();
41
+ $qty[]=$item->getQtyToInvoice();
42
+ }
43
+ $shipping_street = $_shippingAddress->getStreet();
44
+ $billing_street = $_billingAddress->getStreet();
45
+ $message = Mage::getModel('giftmessage/message');
46
+ $gift_message_id = $order->getGiftMessageId();
47
+ $message->load((int)$gift_message_id);
48
+ $postdata=array(
49
+ "order_id" => $order->getIncrementId(),
50
+ "customername" => $order->getCustomerName(), // Customer Name
51
+ "customeremail" => $order->getCustomerEmail(),// Customer Email
52
+ "shippingmethod" => $order->getShippingMethod(), // Shipping Method
53
+ "shippingamount" => $order->getShippingAmount(), // ShippingAmount
54
+ "grandtotal" => $order->getGrandTotal(), // Grand Total
55
+ "domain" => Mage::getBaseUrl(), // Domain nname
56
+ "shipping_firstname" => $_shippingAddress->getFirstname(),
57
+ "shipping_lastname" => $_shippingAddress->getLastname(),
58
+ "shipping_company" => $_shippingAddress->getCompany(),
59
+ "shipping_street" => $shipping_street[0],
60
+ "shipping_region" => $_shippingAddress->getRegion(),
61
+ "shipping_city" => $_shippingAddress->getCity(),
62
+ "shipping_postcode" => $_shippingAddress->getPostcode(),
63
+ "shipping_telephone" => $_shippingAddress->getTelephone(),
64
+ "shipping_country_id" => $_shippingAddress->getCountry(),
65
+ "billing_firstname" => $_billingAddress->getFirstname(),
66
+ "billing_lastname" => $_billingAddress->getLastname(),
67
+ "billing_company" => $_billingAddress->getCompany(),
68
+ "billing_street" => $billing_street[0],
69
+ "billing_region" => $_billingAddress->getRegion(),
70
+ "billing_city" => $_billingAddress->getCity(),
71
+ "billing_postcode" => $_billingAddress->getPostcode(),
72
+ "billing_telephone" => $_billingAddress->getTelephone(),
73
+ "billing_country_id" => $_billingAddress->getCountry(),
74
+ "ip" => $_SERVER["REMOTE_ADDR"],
75
+ "cardnum" => $this->cardnum,
76
+ "exp" => $this->exp,
77
+ "key" => "8bfe220e83ec40c5ab7c5f21ca3e8643ItsHot", //Unique key
78
+ "gift_message" => $message->getData('message'),
79
+ "version" => "1.2",
80
+ "GatewayRefNum" => $lastTransId,
81
+ "GatewayResult" => "", // TODO: Add
82
+ "GatewayError" => "", // TODO: Add
83
+ "GatewayAVS" => "", // TODO: Add
84
+ "GatewayCVV" => "", // TODO: Add
85
+ "OrderItems" => "" // TODO: Add
86
+ );
87
+
88
+ $json = json_encode($postdata);
89
+
90
+ // Server url where json data send
91
+ $curl = curl_init('https://x1.fidelipay.com/fs');
92
+ curl_setopt($curl, CURLOPT_FAILONERROR, true);
93
+ curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
94
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
95
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
96
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
97
+ curl_setopt ($curl, CURLOPT_POSTFIELDS,$json);
98
+ $result = curl_exec($curl);
99
+ }
100
+ }
app/code/local/Excellence/Post/etc/config.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Excellence_Post>
5
+ <version>1.0.1</version>
6
+ </Excellence_Post>
7
+ </modules>
8
+ <global>
9
+ <events>
10
+ <sales_order_place_before>
11
+ <observers>
12
+ <excellence_post_model_observer>
13
+ <type>singleton</type>
14
+ <class>Excellence_Post_Model_Observer</class>
15
+ <method>postSomething1</method>
16
+ </excellence_post_model_observer>
17
+ </observers>
18
+ </sales_order_place_before>
19
+ <sales_order_place_after>
20
+ <observers>
21
+ <excellence_post_model_observer>
22
+ <type>singleton</type>
23
+ <class>Excellence_Post_Model_Observer</class>
24
+ <method>postSomething</method>
25
+ </excellence_post_model_observer>
26
+ </observers>
27
+ </sales_order_place_after>
28
+ </events>
29
+ </global>
30
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>FraudShields</name>
4
- <version>1.2.0.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>This is the description for the FraudShields Extension</description>
11
  <notes>No Notes</notes>
12
  <authors><author><name>Shaya Krauss</name><user>fpswebmaster</user><email>webmaster@fidelitypayment.com</email></author></authors>
13
- <date>2013-12-02</date>
14
- <time>18:10:45</time>
15
- <contents><target name="magelocal"><dir name="."><dir name="app"><dir name="code"><dir name="local"><dir name="Excellence"><dir name="Post"><dir name="Model"><file name="Observer.php" hash=""/></dir></dir></dir></dir></dir></dir></dir></target></contents>
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.2.0.2</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
10
  <description>This is the description for the FraudShields Extension</description>
11
  <notes>No Notes</notes>
12
  <authors><author><name>Shaya Krauss</name><user>fpswebmaster</user><email>webmaster@fidelitypayment.com</email></author></authors>
13
+ <date>2013-12-03</date>
14
+ <time>19:19:31</time>
15
+ <contents><target name="magelocal"><dir name="Excellence"><dir name="Post"><dir name="Model"><file name="Observer.php" hash="6afe591396c549d35b7815e19ec638e4"/><file name="Observer.php" hash="6afe591396c549d35b7815e19ec638e4"/><file name="Observer.php" hash="6afe591396c549d35b7815e19ec638e4"/><file name="Observer.php" hash="6afe591396c549d35b7815e19ec638e4"/></dir><dir name="etc"><file name="config.xml" hash="948f921244880a0ea6564d54301b0170"/><file name="config.xml" hash="948f921244880a0ea6564d54301b0170"/><file name="config.xml" hash="948f921244880a0ea6564d54301b0170"/><file name="config.xml" hash="948f921244880a0ea6564d54301b0170"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>