Compropago_Payment_Extension - Version 1.1.1

Version Notes

## 28/06/2016 v1.1.1
* Feature: App client name capture
* Feature: App client version capture

Download this release

Release Info

Developer Oswaldo Lopez Garcia
Extension Compropago_Payment_Extension
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/community/Compropago/Model/Api.php CHANGED
@@ -46,14 +46,16 @@ class Compropago_Model_Api
46
  $info['url'] = $this->_url;
47
 
48
  $data = array(
49
- 'order_id' => $info['order_id'],
50
  'order_price' => $info['order_price'],
51
  'order_name' => $info['order_name'],
52
- 'image_url' => $info['image_url'],
53
- 'customer_name' => $info['customer_name'],
54
  'customer_email' => $info['customer_email'],
55
  'customer_phone' => $info['customer_phone'],
56
- 'payment_type' => $info['payment_type']
 
 
57
  );
58
 
59
  $ch = curl_init();
46
  $info['url'] = $this->_url;
47
 
48
  $data = array(
49
+ 'order_id' => $info['order_id'],
50
  'order_price' => $info['order_price'],
51
  'order_name' => $info['order_name'],
52
+ 'image_url' => $info['image_url'],
53
+ 'customer_name' => $info['customer_name'],
54
  'customer_email' => $info['customer_email'],
55
  'customer_phone' => $info['customer_phone'],
56
+ 'payment_type' => $info['payment_type'],
57
+ 'app_client_name' => 'magento',
58
+ 'app_client_version' => Mage::getVersion()
59
  );
60
 
61
  $ch = curl_init();
app/code/community/Compropago/controllers/WebhookController.php CHANGED
@@ -5,11 +5,22 @@
5
  * @author waldix (waldix86@gmail.com)
6
  */
7
  class Compropago_WebhookController extends Mage_Core_Controller_Front_Action{
 
 
 
 
8
  protected $_model = null;
9
 
 
 
 
10
  public function _construct() {
11
  $this->_model = Mage::getModel('compropago/Standard');
12
  }
 
 
 
 
13
  public function indexAction(){
14
  $params = $this->getRequest()->getParams();
15
  $body = @file_get_contents('php://input');
@@ -17,6 +28,7 @@ class Compropago_WebhookController extends Mage_Core_Controller_Front_Action{
17
 
18
  if(isset($event_json)){
19
  if ($event_json->{'api_version'} === '1.1') {
 
20
  if ($event_json->{'id'}){
21
  $order = $this->verifyOrder($event_json->{'id'});
22
  $type = $order['type'];
@@ -46,13 +58,19 @@ class Compropago_WebhookController extends Mage_Core_Controller_Front_Action{
46
  } else {
47
  echo 'Order not valid';
48
  }
49
-
50
  }
51
  }
52
  } else {
53
  echo 'Order not valid';
54
  }
55
  }
 
 
 
 
 
 
 
56
  public function changeStatus($order_id, $type){
57
  $_order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
58
  switch ($type) {
@@ -108,6 +126,13 @@ class Compropago_WebhookController extends Mage_Core_Controller_Front_Action{
108
  }
109
  $_order->save();
110
  }
 
 
 
 
 
 
 
111
  public function verifyOrder($id){
112
  $url = 'https://api.compropago.com/v1/charges/';
113
  $url .= $id;
5
  * @author waldix (waldix86@gmail.com)
6
  */
7
  class Compropago_WebhookController extends Mage_Core_Controller_Front_Action{
8
+
9
+ /**
10
+ * @var null
11
+ */
12
  protected $_model = null;
13
 
14
+ /**
15
+ * Constructor
16
+ */
17
  public function _construct() {
18
  $this->_model = Mage::getModel('compropago/Standard');
19
  }
20
+
21
+ /**
22
+ * Recepcion de parametros de la orden
23
+ */
24
  public function indexAction(){
25
  $params = $this->getRequest()->getParams();
26
  $body = @file_get_contents('php://input');
28
 
29
  if(isset($event_json)){
30
  if ($event_json->{'api_version'} === '1.1') {
31
+
32
  if ($event_json->{'id'}){
33
  $order = $this->verifyOrder($event_json->{'id'});
34
  $type = $order['type'];
58
  } else {
59
  echo 'Order not valid';
60
  }
 
61
  }
62
  }
63
  } else {
64
  echo 'Order not valid';
65
  }
66
  }
67
+
68
+ /**
69
+ * Cambio de estatus de la orden
70
+ *
71
+ * @param $order_id
72
+ * @param $type
73
+ */
74
  public function changeStatus($order_id, $type){
75
  $_order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
76
  switch ($type) {
126
  }
127
  $_order->save();
128
  }
129
+
130
+ /**
131
+ * Verificacion de orden recivida.
132
+ *
133
+ * @param $id
134
+ * @return mixed
135
+ */
136
  public function verifyOrder($id){
137
  $url = 'https://api.compropago.com/v1/charges/';
138
  $url .= $id;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Compropago_Payment_Extension</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -20,15 +20,13 @@ The possibility of requesting your funds and receiving them in your bank account
20
  Besides you will be able to: Automatically update your order status both in your online store and in ComproPago&#x2019;s account. &#xD;
21
  &#xD;
22
  Send email notifications for pending orders and reminder notifications to increase conversion rates.</description>
23
- <notes>## 10/06/2016 v1.1.0&#xD;
24
- * Feature: Seleccion de proveedores&#xD;
25
- * Feature: Normalizacion de vista de seleccion de proveedores&#xD;
26
- * Feature: Validacion de proveedor obligatorio&#xD;
27
- * Feature: Captura de telefono de cliente</notes>
28
  <authors><author><name>Oswaldo Lopez Garcia</name><user>waldix</user><email>waldix@compropago.com</email></author><author><name>Eduardo Aguilar</name><user>eduardoay</user><email>eduardo.aguilar@compropago.com</email></author></authors>
29
- <date>2016-06-15</date>
30
- <time>22:54:28</time>
31
- <contents><target name="mageetc"><dir name="modules"><file name="Compropago.xml" hash="884374bb8a46b5ac9a62cd8b9f351401"/></dir></target><target name="magecommunity"><dir name="Compropago"><dir><dir name="Block"><file name="Form.php" hash="3433488444c881f51228924453689c4a"/><file name="OnepageSuccess.php" hash="7873729a10083644d735ce193e2b1752"/></dir><dir name="Helper"><file name="Data.php" hash="5d3d5f4f86f2cec56315a1b02cc3d308"/></dir><dir name="Model"><file name="Api.php" hash="a054a9fbb89867753f2d37561219e827"/><file name="Providers.php" hash="14a80d69659ee43913745a40c59c25cf"/><file name="Standard.php" hash="20e788a3d496d991cc827e8f668681cf"/></dir><dir name="controllers"><file name="WebhookController.php" hash="775c3bffa75a3765ad65d96652356482"/></dir><dir name="etc"><file name="config.xml" hash="26776d50679f9c07924f5ab0a7beeb76"/><file name="system.xml" hash="63d480092fa87465736d905668e3110a"/></dir></dir><file name=".DS_Store" hash="eb03774a462f5cc9f379a3cc14db34f0"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="compropago"><file name="cash.phtml" hash="5d0b597a3f811b22b22b7cb280f9f883"/><file name="onepage_success.phtml" hash="b85d49f5e82ed292da8e0d7c555d0fc4"/></dir></dir><dir name="layout"><file name="compropago.xml" hash="b4c43eb397d0a9ce59b35377ef70e0ed"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="compropago"><file name="compropago.css" hash="c31f0093851df11b1782c68a81e9fa86"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="compropago"><file name="compropago.js" hash="a54eee5266f30f33c3355d0ac770e8f0"/></dir></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Compropago_Payment_Extension</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
20
  Besides you will be able to: Automatically update your order status both in your online store and in ComproPago&#x2019;s account. &#xD;
21
  &#xD;
22
  Send email notifications for pending orders and reminder notifications to increase conversion rates.</description>
23
+ <notes>## 28/06/2016 v1.1.1&#xD;
24
+ * Feature: App client name capture&#xD;
25
+ * Feature: App client version capture</notes>
 
 
26
  <authors><author><name>Oswaldo Lopez Garcia</name><user>waldix</user><email>waldix@compropago.com</email></author><author><name>Eduardo Aguilar</name><user>eduardoay</user><email>eduardo.aguilar@compropago.com</email></author></authors>
27
+ <date>2016-06-28</date>
28
+ <time>16:29:50</time>
29
+ <contents><target name="mageetc"><dir name="modules"><file name="Compropago.xml" hash="884374bb8a46b5ac9a62cd8b9f351401"/></dir></target><target name="magecommunity"><dir name="Compropago"><dir><dir name="Block"><file name="Form.php" hash="3433488444c881f51228924453689c4a"/><file name="OnepageSuccess.php" hash="7873729a10083644d735ce193e2b1752"/></dir><dir name="Helper"><file name="Data.php" hash="5d3d5f4f86f2cec56315a1b02cc3d308"/></dir><dir name="Model"><file name="Api.php" hash="8070b909572fc67102f702c88190fb03"/><file name="Providers.php" hash="14a80d69659ee43913745a40c59c25cf"/><file name="Standard.php" hash="20e788a3d496d991cc827e8f668681cf"/></dir><dir name="controllers"><file name="WebhookController.php" hash="b34aeec38ae45833c8adc57f1e94e624"/></dir><dir name="etc"><file name="config.xml" hash="26776d50679f9c07924f5ab0a7beeb76"/><file name="system.xml" hash="63d480092fa87465736d905668e3110a"/></dir></dir><file name=".DS_Store" hash="eb03774a462f5cc9f379a3cc14db34f0"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="compropago"><file name="cash.phtml" hash="5d0b597a3f811b22b22b7cb280f9f883"/><file name="onepage_success.phtml" hash="b85d49f5e82ed292da8e0d7c555d0fc4"/></dir></dir><dir name="layout"><file name="compropago.xml" hash="b4c43eb397d0a9ce59b35377ef70e0ed"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="compropago"><file name="compropago.css" hash="c31f0093851df11b1782c68a81e9fa86"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="compropago"><file name="compropago.js" hash="a54eee5266f30f33c3355d0ac770e8f0"/></dir></dir></target></contents>
30
  <compatible/>
31
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
32
  </package>