Yellow_Pay - Version 0.1.6

Version Notes

Fix IPN error on some statuses

Download this release

Release Info

Developer James Piechota
Extension Yellow_Pay
Version 0.1.6
Comparing to
See all releases


Code changes from version 0.1.5 to 0.1.6

app/code/local/Yellow/Bitcoin/Model/Bitcoin.php CHANGED
@@ -299,6 +299,7 @@ Class Yellow_Bitcoin_Model_Bitcoin extends Mage_Payment_Model_Method_Abstract {
299
  try {
300
  $response = $http_client->request();
301
  if ($response->getStatus() == "200") {
 
302
  $body = $response->getBody();
303
  $data = json_decode($body, true);
304
  /* save the invoice in the database */
299
  try {
300
  $response = $http_client->request();
301
  if ($response->getStatus() == "200") {
302
+ $this->log("Response: " . $response);
303
  $body = $response->getBody();
304
  $data = json_decode($body, true);
305
  /* save the invoice in the database */
app/code/local/Yellow/Bitcoin/controllers/IndexController.php CHANGED
@@ -74,10 +74,13 @@ class Yellow_Bitcoin_IndexController extends Mage_Core_Controller_Front_Action {
74
  $this->log("----------- skipped the IPN request proccessing ---------------------");
75
  return ;
76
  }
77
- if (!$order || $order->getPayment()->getMethodInstance()->getCode() <> "bitcoin" || $order->getState() <> Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
78
- $this->log("either this order is not paid via Yellow , or it had unallowed state ");
79
- $this->log("----------- skipped the IPN request proccessing ---------------------");
80
- return $this->_forward("no-route");
 
 
 
81
  }
82
  $this->log(" invoice status : {$body["status"]}");
83
  switch ($body['status']) {
74
  $this->log("----------- skipped the IPN request proccessing ---------------------");
75
  return ;
76
  }
77
+ if($order->getPayment() instanceof Yellow_Bitcoin_Model_Bitcoin){
78
+ $payment = $order->getPayment()->getMethodInstance();
79
+ if (!$order || $payment->getCode() <> "bitcoin" || $order->getState() <> Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW) {
80
+ $this->log("either this order is not paid via Yellow , or it had unallowed state ");
81
+ $this->log("----------- skipped the IPN request proccessing ---------------------");
82
+ return $this->_forward("no-route");
83
+ }
84
  }
85
  $this->log(" invoice status : {$body["status"]}");
86
  switch ($body['status']) {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Yellow_Pay</name>
4
- <version>0.1.5</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/YellowPay/yellow-magento/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
@@ -30,11 +30,11 @@ Bitcoin payment is received and the customer is redirected to an order confirmat
30
  &#xD;
31
  6.&#xD;
32
  Yellow converts the received Bitcoin payment into a national currency (like AED) and transfers it to the merchant&#x2019;s bank account</description>
33
- <notes>Remove $0.30 USD stub</notes>
34
  <authors><author><name>James Piechota</name><user>YellowPay</user><email>james@yellowpay.co</email></author><author><name>Tawfek Daghistani</name><user>tawfekov</user><email>tawfekov@gmail.com</email></author></authors>
35
- <date>2014-09-30</date>
36
- <time>22:49:39</time>
37
- <contents><target name="mageetc"><dir name="modules"><file name="Yellow_Bitcoin.xml" hash="b994ecfa72adf5cac1168178b7dd233c"/></dir></target><target name="magelocal"><dir name="Yellow"><dir name="Bitcoin"><dir name="Block"><dir name="Form"><file name="Bitcoin.php" hash="9f2f3403e2578263b8c73aa495b0b473"/></dir><file name="Index.php" hash="0a2ac65b25a7c31aa457b4688b8c28ac"/><dir name="Info"><file name="Bitcoin.php" hash="7c4f19e8b6cecc559e4df0a215eba6c9"/></dir><file name="Status.php" hash="e437b9f4b6c9349f96520a220228ee4e"/><file name="Widget.php" hash="7be6cd4ce33257dcb9c754b1da6852a6"/></dir><dir name="Helper"><file name="Data.php" hash="53c324df464a427bc974ccb30b9b2b74"/></dir><dir name="Model"><file name="Bitcoin.php" hash="e0735a5fe0dea75cf3b98d572d0b6b87"/><file name="Http.php" hash="301e3a15684059765766403072db1615"/><file name="Ipn.php" hash="c0243c3c80c8bc94604f9b79c569bd6f"/><dir name="Resource"><dir name="Ipn"><file name="Collection.php" hash="d4a1c628a1c815a9a9cc8db6fe84a27d"/></dir><file name="Ipn.php" hash="cb1c60decd1fcc786dbaa30e0bc4314d"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="763f473bc22a23bc320ccb327dabe134"/></dir><dir name="etc"><file name="config.xml" hash="0c0b116a7afbf509f951dcb7cfdc624e"/><file name="system.xml" hash="1a1b2bd102795f244bb8331a5d419c45"/></dir><dir name="sql"><dir name="bitcoin_setup"><file name="mysql4-install-0.1.0.php" hash="c0ca52e99ed9379d1e417d6fbc409e83"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="029263662ecc7b7dfe8e76cfa907b38b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bitcoin"><dir name="form"><file name="bitcoin.phtml" hash="ef1c94b1705cf6a003efe60ffa370662"/></dir><file name="index.phtml" hash="22b757c8eae6298b157dfe59495e0345"/><dir name="info"><file name="bitcoin.phtml" hash="297b5f325aa90c0e8d9df673b5f42654"/></dir><file name="status.phtml" hash="4d7753c3efdcad9a2974b89ec636aa4c"/><file name="widget.phtml" hash="8e6c6f48c7c34a1bddf8edff68022500"/></dir></dir><dir name="layout"><file name="bitcoin.xml" hash="71f89164224ff02c8afc1ebad86ed6ee"/></dir></dir></dir></dir></target></contents>
38
  <compatible/>
39
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
40
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Yellow_Pay</name>
4
+ <version>0.1.6</version>
5
  <stability>stable</stability>
6
  <license uri="https://github.com/YellowPay/yellow-magento/blob/master/LICENSE.md">MITL</license>
7
  <channel>community</channel>
30
  &#xD;
31
  6.&#xD;
32
  Yellow converts the received Bitcoin payment into a national currency (like AED) and transfers it to the merchant&#x2019;s bank account</description>
33
+ <notes>Fix IPN error on some statuses</notes>
34
  <authors><author><name>James Piechota</name><user>YellowPay</user><email>james@yellowpay.co</email></author><author><name>Tawfek Daghistani</name><user>tawfekov</user><email>tawfekov@gmail.com</email></author></authors>
35
+ <date>2014-10-13</date>
36
+ <time>17:28:55</time>
37
+ <contents><target name="mageetc"><dir name="modules"><file name="Yellow_Bitcoin.xml" hash="b994ecfa72adf5cac1168178b7dd233c"/></dir></target><target name="magelocal"><dir name="Yellow"><dir name="Bitcoin"><dir name="Block"><dir name="Form"><file name="Bitcoin.php" hash="9f2f3403e2578263b8c73aa495b0b473"/></dir><file name="Index.php" hash="0a2ac65b25a7c31aa457b4688b8c28ac"/><dir name="Info"><file name="Bitcoin.php" hash="7c4f19e8b6cecc559e4df0a215eba6c9"/></dir><file name="Status.php" hash="e437b9f4b6c9349f96520a220228ee4e"/><file name="Widget.php" hash="7be6cd4ce33257dcb9c754b1da6852a6"/></dir><dir name="Helper"><file name="Data.php" hash="53c324df464a427bc974ccb30b9b2b74"/></dir><dir name="Model"><file name="Bitcoin.php" hash="d15d724b03aa7dce33cd7ad65d276557"/><file name="Http.php" hash="301e3a15684059765766403072db1615"/><file name="Ipn.php" hash="c0243c3c80c8bc94604f9b79c569bd6f"/><dir name="Resource"><dir name="Ipn"><file name="Collection.php" hash="d4a1c628a1c815a9a9cc8db6fe84a27d"/></dir><file name="Ipn.php" hash="cb1c60decd1fcc786dbaa30e0bc4314d"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="00b98e5b0f134fb16f8fcda6de63db06"/></dir><dir name="etc"><file name="config.xml" hash="0c0b116a7afbf509f951dcb7cfdc624e"/><file name="system.xml" hash="1a1b2bd102795f244bb8331a5d419c45"/></dir><dir name="sql"><dir name="bitcoin_setup"><file name="mysql4-install-0.1.0.php" hash="c0ca52e99ed9379d1e417d6fbc409e83"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="029263662ecc7b7dfe8e76cfa907b38b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bitcoin"><dir name="form"><file name="bitcoin.phtml" hash="ef1c94b1705cf6a003efe60ffa370662"/></dir><file name="index.phtml" hash="22b757c8eae6298b157dfe59495e0345"/><dir name="info"><file name="bitcoin.phtml" hash="297b5f325aa90c0e8d9df673b5f42654"/></dir><file name="status.phtml" hash="4d7753c3efdcad9a2974b89ec636aa4c"/><file name="widget.phtml" hash="8e6c6f48c7c34a1bddf8edff68022500"/></dir></dir><dir name="layout"><file name="bitcoin.xml" hash="71f89164224ff02c8afc1ebad86ed6ee"/></dir></dir></dir></dir></target></contents>
38
  <compatible/>
39
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
40
  </package>