CoinGate_For_Magento - Version 1.0.4

Version Notes

* Remove debug code
* Added status "Mage_Sales_Model_Order::STATE_PENDING_PAYMENT" when CoinGate status is "confirming"

Download this release

Release Info

Developer CoinGate
Extension CoinGate_For_Magento
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/community/Mage/Coingate/Block/Callback.php CHANGED
@@ -5,7 +5,6 @@ class Mage_Coingate_Block_Callback extends Mage_Core_Block_Abstract
5
  protected function _toHtml()
6
  {
7
  $coingate = Mage::getModel('coingate/CoingateFactory');
8
- echo $coingate->validateCallback();
9
 
10
  return $coingate->validateCallback();
11
  }
5
  protected function _toHtml()
6
  {
7
  $coingate = Mage::getModel('coingate/CoingateFactory');
 
8
 
9
  return $coingate->validateCallback();
10
  }
app/code/community/Mage/Coingate/Model/CoingateFactory.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  require_once(Mage::getBaseDir() . '/app/code/community/Mage/Coingate/lib/coingate_merchant.class.php');
4
 
5
- define('COINGATE_MAGENTO_VERSION', '1.0.3');
6
 
7
  class Mage_Coingate_Model_CoingateFactory extends Mage_Payment_Model_Method_Abstract
8
  {
@@ -95,12 +95,21 @@ class Mage_Coingate_Model_CoingateFactory extends Mage_Payment_Model_Method_Abst
95
  }
96
 
97
  if ($coingate_response['status'] == 'paid') {
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  $order->sendNewOrderEmail()
99
- ->setState(Mage_Sales_Model_Order::STATE_PROCESSING, TRUE)
100
- ->save();
101
- } elseif (in_array($coingate_response['status'], array('invalid', 'expired', 'canceled'))) {
102
- $order->sendNewOrderEmail()
103
- ->setState(Mage_Sales_Model_Order::STATE_CANCELED, TRUE)
104
  ->save();
105
  }
106
  } catch (Exception $e) {
2
 
3
  require_once(Mage::getBaseDir() . '/app/code/community/Mage/Coingate/lib/coingate_merchant.class.php');
4
 
5
+ define('COINGATE_MAGENTO_VERSION', '1.0.4');
6
 
7
  class Mage_Coingate_Model_CoingateFactory extends Mage_Payment_Model_Method_Abstract
8
  {
95
  }
96
 
97
  if ($coingate_response['status'] == 'paid') {
98
+ $mage_status = Mage_Sales_Model_Order::STATE_PROCESSING;
99
+ }
100
+ else if ($coingate_response['status'] == 'confirming') {
101
+ $mage_status = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
102
+ }
103
+ else if (in_array($coingate_response['status'], array('invalid', 'expired', 'canceled'))) {
104
+ $mage_status = Mage_Sales_Model_Order::STATE_CANCELED;
105
+ }
106
+ else {
107
+ $mage_status = NULL;
108
+ }
109
+
110
+ if (!is_null($mage_status)) {
111
  $order->sendNewOrderEmail()
112
+ ->setState($mage_status, TRUE)
 
 
 
 
113
  ->save();
114
  }
115
  } catch (Exception $e) {
app/code/community/Mage/Coingate/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mage_Coingate>
5
- <version>1.0.3</version>
6
  </Mage_Coingate>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Mage_Coingate>
5
+ <version>1.0.4</version>
6
  </Mage_Coingate>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CoinGate_For_Magento</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/coingate/magento-plugin/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
@@ -25,12 +25,14 @@ A customer wants to buy the item and pay with bitcoin. He generates an invoice a
25
  &#xD;
26
  After the customer pays the invoice, the merchant receives 19.80 euro (20 euro minus 1%).&#xD;
27
  &#xD;
28
- To be able to use the plugin you have to create an account on &lt;a href="https://coingate.com" target="_blank"&gt;https://coingate.com&lt;/a&gt;</description>
29
- <notes>Added "Sort Order" field.</notes>
 
 
30
  <authors><author><name>CoinGate</name><user>coingate</user><email>info@coingate.com</email></author></authors>
31
- <date>2016-03-03</date>
32
- <time>15:39:31</time>
33
- <contents><target name="magecommunity"><dir name="Mage"><dir name="Coingate"><dir name="Block"><file name="Callback.php" hash="0845222d4c5ce4457aab3eb14282ff8d"/><file name="Form.php" hash="ab93f50ac62fab7b986ccfe4732d63e4"/><file name="Redirect.php" hash="21b349e960636fd441b35d42facaf17d"/></dir><dir name="Model"><file name="CoingateFactory.php" hash="fcb8304d733ae762af40a65781668523"/><file name="ReceiveCurrencies.php" hash="94f7f39c759012b8e75ec8e6846cae5f"/></dir><dir name="controllers"><file name="PayController.php" hash="ffe09d0ff067e5247351990255d0c472"/></dir><dir name="etc"><file name="config.xml" hash="38b4134e86e1f8a617a38eea433c5c03"/><file name="system.xml" hash="7c0eeb2bbd12b9febe32187fcebafd53"/></dir><dir name="lib"><file name="coingate_merchant.class.php" hash="af5eb495a82c48d703f2acd45f07cf8a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Coingate.xml" hash="cc8a4080d714fd0c50eadf91a77be49c"/></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CoinGate_For_Magento</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/coingate/magento-plugin/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
25
  &#xD;
26
  After the customer pays the invoice, the merchant receives 19.80 euro (20 euro minus 1%).&#xD;
27
  &#xD;
28
+ To be able to use the plugin you have to create an account on &lt;a href="https://coingate.com" target="_blank"&gt;https://coingate.com&lt;/a&gt;&#xD;
29
+ </description>
30
+ <notes>* Remove debug code&#xD;
31
+ * Added status "Mage_Sales_Model_Order::STATE_PENDING_PAYMENT" when CoinGate status is "confirming"</notes>
32
  <authors><author><name>CoinGate</name><user>coingate</user><email>info@coingate.com</email></author></authors>
33
+ <date>2016-07-08</date>
34
+ <time>13:59:01</time>
35
+ <contents><target name="magecommunity"><dir name="Mage"><dir name="Coingate"><dir name="Block"><file name="Callback.php" hash="ad228ee9b00f327052a72246fe76b339"/><file name="Form.php" hash="ab93f50ac62fab7b986ccfe4732d63e4"/><file name="Redirect.php" hash="21b349e960636fd441b35d42facaf17d"/></dir><dir name="Model"><file name="CoingateFactory.php" hash="f202fac9b77370078db8a840a0599a1b"/><file name="ReceiveCurrencies.php" hash="94f7f39c759012b8e75ec8e6846cae5f"/></dir><dir name="controllers"><file name="PayController.php" hash="ffe09d0ff067e5247351990255d0c472"/></dir><dir name="etc"><file name="config.xml" hash="34acaad8a76441ebd86778b7413c4ca3"/><file name="system.xml" hash="7c0eeb2bbd12b9febe32187fcebafd53"/></dir><dir name="lib"><file name="coingate_merchant.class.php" hash="af5eb495a82c48d703f2acd45f07cf8a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Coingate.xml" hash="cc8a4080d714fd0c50eadf91a77be49c"/></dir></target></contents>
36
  <compatible/>
37
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
38
  </package>