ParcelPro_Carrier - Version 1.0.3

Version Notes

Version 1.0.3
Logging bugfix

Version 1.0.2
Improved logging

Version 1.0.1
Actually use default location for ShipFrom
Some error logging added

Version 1.0.0
New release.

Download this release

Release Info

Developer Parcel Pro, Inc. Joey Chan, Project Lead Jasper Lynn, Project Manager
Extension ParcelPro_Carrier
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/ParcelPro/Carrier/Helper/Parcelpro.php CHANGED
@@ -235,6 +235,10 @@ class ParcelPro_Carrier_Helper_Parcelpro extends Mage_Core_Helper_Abstract
235
  $data = curl_exec ($ch);
236
  list($header,$data) = explode("\r\n\r\n",$data,2);
237
  $header = explode("\r\n",$header);
 
 
 
 
238
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
239
  curl_close ($ch);
240
  if($http_status == '400'){
235
  $data = curl_exec ($ch);
236
  list($header,$data) = explode("\r\n\r\n",$data,2);
237
  $header = explode("\r\n",$header);
238
+ while(explode(" ",$header[0])[1]=='100'){
239
+ list($header,$data) = explode("\r\n\r\n",$data,2);
240
+ $header = explode("\r\n",$header);
241
+ }
242
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
243
  curl_close ($ch);
244
  if($http_status == '400'){
app/code/community/ParcelPro/Carrier/Helper/Parcelpro.php~ CHANGED
@@ -233,7 +233,13 @@ class ParcelPro_Carrier_Helper_Parcelpro extends Mage_Core_Helper_Abstract
233
  curl_setopt($ch, CURLOPT_HEADER, true);
234
 
235
  $data = curl_exec ($ch);
 
 
 
236
  curl_close ($ch);
 
 
 
237
  if($data){
238
  if($isPost){
239
  $result = json_decode($data);
233
  curl_setopt($ch, CURLOPT_HEADER, true);
234
 
235
  $data = curl_exec ($ch);
236
+ list($header,$data) = explode("\r\n\r\n",$data,2);
237
+ $header = explode("\r\n",$header);
238
+ $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
239
  curl_close ($ch);
240
+ if($http_status == '400'){
241
+ Mage::log("Query failed:".explode(" ",$header[0])[2],null,'ppimagento.log');
242
+ }
243
  if($data){
244
  if($isPost){
245
  $result = json_decode($data);
app/code/community/ParcelPro/Carrier/Model/.Carrier.php.swp ADDED
Binary file
app/code/community/ParcelPro/Carrier/Model/Carrier.php CHANGED
@@ -1217,6 +1217,10 @@ class ParcelPro_Carrier_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstra
1217
  $data = curl_exec ($ch);
1218
  list($header,$data) = explode("\r\n\r\n",$data,2);
1219
  $header = explode("\r\n",$header);
 
 
 
 
1220
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
1221
  curl_close ($ch);
1222
  if($http_status == '400'){
@@ -1233,7 +1237,10 @@ class ParcelPro_Carrier_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstra
1233
  }else{
1234
  $result = json_decode($data);
1235
  }
1236
- return $result;
 
 
 
1237
  }else{
1238
  return null;
1239
  }
1217
  $data = curl_exec ($ch);
1218
  list($header,$data) = explode("\r\n\r\n",$data,2);
1219
  $header = explode("\r\n",$header);
1220
+ while(explode(" ",$header[0])[1]=='100'){
1221
+ list($header,$data) = explode("\r\n\r\n",$data,2);
1222
+ $header = explode("\r\n",$header);
1223
+ }
1224
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
1225
  curl_close ($ch);
1226
  if($http_status == '400'){
1237
  }else{
1238
  $result = json_decode($data);
1239
  }
1240
+ if($result)
1241
+ return $result;
1242
+ else
1243
+ Mage::log("Invalid JSON:".$data,null,'ppimagento.log');
1244
  }else{
1245
  return null;
1246
  }
package.xml CHANGED
@@ -1,14 +1,17 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ParcelPro_Carrier</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="https://www.mozilla.org/MPL/2.0/">MPL 2.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Parcel Pro for Magento is a web-based Insured Shipping solution that integrates with your Magento online store, adding Parcel Pro as one of your shipping options. It allows you to set the price of shipping and insurance coverage quickly and easily.</summary>
10
  <description>Parcel Pro for Magento is a web-based Insured Shipping solution that integrates with your Magento online store. It adds Parcel Pro as one of your shipping options, allowing you to set the price of shipping and insurance coverage easily. You must have a Magento store. By having Parcel Pro for Magento installed into your Magento store, you&#x2019;ll have a powerful new option for your customers to choose from when selecting Insured Shipping. With solid integration with your favorite carriers, Parcel Pro for Magento lets your customers check out in a breeze, with the costs of shipping and insurance embedded into your price.</description>
11
- <notes>Version 1.0.2&#xD;
 
 
 
12
  Improved logging&#xD;
13
  &#xD;
14
  Version 1.0.1&#xD;
@@ -18,9 +21,9 @@ Some error logging added&#xD;
18
  Version 1.0.0&#xD;
19
  New release.</notes>
20
  <authors><author><name>Parcel Pro, Inc.</name><user>ParcelProInc</user><email>techsupport@parcelpro.com</email></author></authors>
21
- <date>2014-09-23</date>
22
- <time>21:47:04</time>
23
- <contents><target name="magecommunity"><dir name="ParcelPro"><dir name="Carrier"><dir name="Block"><dir name="Adminhtml"><dir name="Button"><dir name="Refresh"><file name="Cms.php" hash="4e17c2e2488321dec06785af3b3c3706"/></dir></dir></dir></dir><dir name="Helper"><file name="Parcelpro.php" hash="9694e1ad02c00e31df2c6435e3b84e7f"/><file name="Parcelpro.php~" hash="3a81bf4729e365f752b04bcf6a4031f1"/></dir><dir name="Model"><file name="Carrier.php" hash="4997bdd0cc7cb2a15d3f83419dfd3a52"/><file name="Carrier.php~" hash="184781b8dbc7552cfa2bd86c22bae184"/><file name="Config.php" hash="1a524a99e831bcbad22ffd50316aec44"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="60720e05a974b362891d4dba01694132"/></dir><file name="Config.php" hash="ac407fcd7973e28342bc99a24fad7b4a"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="4c6b2c661d616ccce831185d30cc340e"/></dir></dir><dir name="Source"><file name="Carriers.php" hash="fbae840c7a2bb07d36f61aab7cf4d960"/><file name="Dropoff.php" hash="ab1c1c54e22ed3f1c628cd2f34b50ea8"/><file name="Fedexmethod.php" hash="1966f6b0e4cb1f5a8cbb8be5a2b38981"/><file name="Freemethod.php" hash="2f590b14abae6718abdd8ab1ebbca2b8"/><file name="Packaging.php" hash="85e5e9416c4ba68bedd12558edafe384"/><file name="Unitofmeasure.php" hash="4048107787504d7aef1b662de777e93d"/><file name="Upsmethod.php" hash="4eed70c1e0f051622251377dd2ffe050"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RefreshController.php" hash="01dc45dd06e8af8968cce7fbaa554cb9"/></dir><file name="IndexController.php" hash="dd116c50612320505894e151b43a8fcc"/></dir><dir name="etc"><file name="config.xml" hash="2e9655e356b5609e5b50f90c94bb79df"/><file name="system.xml" hash="25e4b2b1e7c61b4bf55d5015d5cab0df"/></dir><dir name="sql"><dir name="carrier_setup"><file name="mysql4-install-1.0.0.php" hash="42faff48ed0752ba42739316ac02e890"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ParcelPro_Carrier.xml" hash=""/></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ParcelPro_Carrier</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="https://www.mozilla.org/MPL/2.0/">MPL 2.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Parcel Pro for Magento is a web-based Insured Shipping solution that integrates with your Magento online store, adding Parcel Pro as one of your shipping options. It allows you to set the price of shipping and insurance coverage quickly and easily.</summary>
10
  <description>Parcel Pro for Magento is a web-based Insured Shipping solution that integrates with your Magento online store. It adds Parcel Pro as one of your shipping options, allowing you to set the price of shipping and insurance coverage easily. You must have a Magento store. By having Parcel Pro for Magento installed into your Magento store, you&#x2019;ll have a powerful new option for your customers to choose from when selecting Insured Shipping. With solid integration with your favorite carriers, Parcel Pro for Magento lets your customers check out in a breeze, with the costs of shipping and insurance embedded into your price.</description>
11
+ <notes>Version 1.0.3&#xD;
12
+ Logging bugfix&#xD;
13
+ &#xD;
14
+ Version 1.0.2&#xD;
15
  Improved logging&#xD;
16
  &#xD;
17
  Version 1.0.1&#xD;
21
  Version 1.0.0&#xD;
22
  New release.</notes>
23
  <authors><author><name>Parcel Pro, Inc.</name><user>ParcelProInc</user><email>techsupport@parcelpro.com</email></author></authors>
24
+ <date>2014-09-25</date>
25
+ <time>18:03:41</time>
26
+ <contents><target name="magecommunity"><dir name="ParcelPro"><dir name="Carrier"><dir name="Block"><dir name="Adminhtml"><dir name="Button"><dir name="Refresh"><file name="Cms.php" hash="4e17c2e2488321dec06785af3b3c3706"/></dir></dir></dir></dir><dir name="Helper"><file name="Parcelpro.php" hash="8255ac15c499f88b84c311c63f31f12c"/><file name="Parcelpro.php~" hash="9694e1ad02c00e31df2c6435e3b84e7f"/></dir><dir name="Model"><file name="Carrier.php" hash="bf7aca1ffd989636c688562ff5af81f9"/><file name="Carrier.php~" hash="184781b8dbc7552cfa2bd86c22bae184"/><file name="Config.php" hash="1a524a99e831bcbad22ffd50316aec44"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="60720e05a974b362891d4dba01694132"/></dir><file name="Config.php" hash="ac407fcd7973e28342bc99a24fad7b4a"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="4c6b2c661d616ccce831185d30cc340e"/></dir></dir><dir name="Source"><file name="Carriers.php" hash="fbae840c7a2bb07d36f61aab7cf4d960"/><file name="Dropoff.php" hash="ab1c1c54e22ed3f1c628cd2f34b50ea8"/><file name="Fedexmethod.php" hash="1966f6b0e4cb1f5a8cbb8be5a2b38981"/><file name="Freemethod.php" hash="2f590b14abae6718abdd8ab1ebbca2b8"/><file name="Packaging.php" hash="85e5e9416c4ba68bedd12558edafe384"/><file name="Unitofmeasure.php" hash="4048107787504d7aef1b662de777e93d"/><file name="Upsmethod.php" hash="4eed70c1e0f051622251377dd2ffe050"/></dir><file name=".Carrier.php.swp" hash="6da128bcdced2a5388c0d622065584be"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="RefreshController.php" hash="01dc45dd06e8af8968cce7fbaa554cb9"/></dir><file name="IndexController.php" hash="dd116c50612320505894e151b43a8fcc"/></dir><dir name="etc"><file name="config.xml" hash="2e9655e356b5609e5b50f90c94bb79df"/><file name="system.xml" hash="25e4b2b1e7c61b4bf55d5015d5cab0df"/></dir><dir name="sql"><dir name="carrier_setup"><file name="mysql4-install-1.0.0.php" hash="42faff48ed0752ba42739316ac02e890"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="ParcelPro_Carrier.xml" hash=""/></dir></target></contents>
27
  <compatible/>
28
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
29
  </package>