Version Notes
Shippit Magento Integration module, using the Shippit v3 API.
Allows for retrieving shipping quotes during checkout and sending orders to Shippit.
Also adds Australian States and Territories to the available region options and Authority to Leave and Delivery Comments to the checkout process.
Download this release
Release Info
Developer | Matthew Muscat |
Extension | Shippit_Shippit |
Version | 4.6.3 |
Comparing to | |
See all releases |
Code changes from version 4.5.5 to 4.6.3
- app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order/Grid.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order/Items.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Renderer/Shipping/Methods.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Renderer/Shippit/ServiceClass.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Sync/Order/ShippingMethodMapping.php +1 -1
- app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Fieldset/Version.php +1 -1
- app/code/community/Shippit/Shippit/Block/Checkout/Cart/Shipping.php +1 -1
- app/code/community/Shippit/Shippit/Block/Checkout/Shipping/AuthorityToLeave.php +1 -1
- app/code/community/Shippit/Shippit/Block/Checkout/Shipping/DeliveryInstructions.php +1 -1
- app/code/community/Shippit/Shippit/Exception.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Api.php +2 -12
- app/code/community/Shippit/Shippit/Helper/Bugsnag.php +0 -127
- app/code/community/Shippit/Shippit/Helper/Carrier.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Checkout.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Data.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Sync/Item.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Sync/Order.php +1 -1
- app/code/community/Shippit/Shippit/Helper/Sync/Shipping.php +1 -1
- app/code/community/Shippit/Shippit/Model/Api/Order.php +1 -1
- app/code/community/Shippit/Shippit/Model/Logger.php +1 -41
- app/code/community/Shippit/Shippit/Model/Observer/Adminhtml/Sales/Order.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/Order/Sync.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/Quote/AuthorityToLeave.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/Quote/DeliveryInstructions.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/Shipping/Tracking.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/Shippit.php +1 -1
- app/code/community/Shippit/Shippit/Model/Observer/System/Config.php +72 -32
- app/code/community/Shippit/Shippit/Model/Request/Api/Order.php +2 -2
- app/code/community/Shippit/Shippit/Model/Request/Api/Shipment.php +1 -1
- app/code/community/Shippit/Shippit/Model/Request/Sync/Order.php +2 -2
- app/code/community/Shippit/Shippit/Model/Resource/Setup.php +1 -1
- app/code/community/Shippit/Shippit/Model/Resource/Sync/Order.php +1 -1
- app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Collection.php +1 -1
- app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Item.php +1 -1
- app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Item/Collection.php +1 -1
- app/code/community/Shippit/Shippit/Model/Shipping/Carrier/Shippit.php +1 -1
- app/code/community/Shippit/Shippit/Model/Shippit.php +1 -1
- app/code/community/Shippit/Shippit/Model/Sync/Order.php +1 -1
- app/code/community/Shippit/Shippit/Model/Sync/Order/Config.php +1 -1
- app/code/community/Shippit/Shippit/Model/Sync/Order/Item.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Attributes.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Attributes/Location.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Products.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Unit/Dimensions.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Unit/Weight.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Order/Status/Processing.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shipping/Methods.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Environment.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Margin.php +2 -2
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/MaxTimeslots.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Methods.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Order/Status.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Sync/Mode.php +1 -1
- app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Sync/SendAllOrders.php +1 -1
- app/code/community/Shippit/Shippit/controllers/Adminhtml/Shippit/Order/SyncController.php +24 -5
- app/code/community/Shippit/Shippit/controllers/Adminhtml/Shippit/OrderController.php +13 -1
- app/code/community/Shippit/Shippit/controllers/OrderController.php +36 -3
- app/code/community/Shippit/Shippit/data/shippit_setup/data-install-4.0.0.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.1.0-4.1.1.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.1.6-4.1.7.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.2.3-4.2.4.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.3.2-4.3.3.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.4.0-4.5.0.php +1 -1
- app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.5.3-4.5.4.php +1 -1
- app/code/community/Shippit/Shippit/etc/adminhtml.xml +1 -1
- app/code/community/Shippit/Shippit/etc/config.xml +2 -2
- app/code/community/Shippit/Shippit/etc/system.xml +43 -42
- app/code/community/Shippit/Shippit/sql/shippit_setup/install-4.0.0.php +1 -1
- app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.0.9-4.1.0.php +1 -1
- app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.1.0-4.1.1.php +1 -1
- app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.2.5-4.2.6.php +1 -1
- app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.2.6-4.3.0.php +1 -1
- app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.4.0-4.5.0.php +1 -1
- app/design/adminhtml/default/default/layout/shippit.xml +1 -1
- app/design/frontend/base/default/layout/shippit.xml +1 -1
- app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method.phtml +3 -1
- app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method/authoritytoleave.phtml +1 -1
- app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method/deliveryinstructions.phtml +1 -1
- app/design/frontend/base/default/template/shippit/email/order/shipment/track.phtml +1 -1
- lib/shippit-bugsnag/Autoload.php +0 -15
- lib/shippit-bugsnag/Client.php +0 -657
- lib/shippit-bugsnag/Configuration.php +0 -145
- lib/shippit-bugsnag/Diagnostics.php +0 -86
- lib/shippit-bugsnag/Error.php +0 -415
- lib/shippit-bugsnag/ErrorTypes.php +0 -146
- lib/shippit-bugsnag/Notification.php +0 -321
- lib/shippit-bugsnag/Request.php +0 -136
- lib/shippit-bugsnag/Stacktrace.php +0 -209
- package.xml +4 -4
app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order/Grid.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/Sales/Order/Items.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Renderer/Shipping/Methods.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Renderer/Shippit/ServiceClass.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Field/Sync/Order/ShippingMethodMapping.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Adminhtml/System/Config/Form/Fieldset/Version.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Checkout/Cart/Shipping.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Checkout/Shipping/AuthorityToLeave.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Block/Checkout/Shipping/DeliveryInstructions.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Exception.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Api.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -109,14 +109,6 @@ class Shippit_Shippit_Helper_Api extends Mage_Core_Helper_Abstract
|
|
109 |
|
110 |
protected function prepareMatadata($uri, $requestData, $apiResponse = null)
|
111 |
{
|
112 |
-
if ($this->logger->bugsnag) {
|
113 |
-
// get the core meta data
|
114 |
-
$metaData = Mage::helper('shippit/bugsnag')->getMetaData();
|
115 |
-
}
|
116 |
-
else {
|
117 |
-
$metaData = array();
|
118 |
-
}
|
119 |
-
|
120 |
// add the request meta data
|
121 |
$requestMetaData = array(
|
122 |
'api_request' => array(
|
@@ -130,9 +122,7 @@ class Shippit_Shippit_Helper_Api extends Mage_Core_Helper_Abstract
|
|
130 |
$requestMetaData['api_request']['response_body'] = json_decode($apiResponse->getBody());
|
131 |
}
|
132 |
|
133 |
-
$
|
134 |
-
|
135 |
-
$this->logger->setMetaData($metaData);
|
136 |
}
|
137 |
|
138 |
public function getQuote(Varien_Object $requestData)
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
109 |
|
110 |
protected function prepareMatadata($uri, $requestData, $apiResponse = null)
|
111 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
// add the request meta data
|
113 |
$requestMetaData = array(
|
114 |
'api_request' => array(
|
122 |
$requestMetaData['api_request']['response_body'] = json_decode($apiResponse->getBody());
|
123 |
}
|
124 |
|
125 |
+
$this->logger->setMetaData($requestMetaData);
|
|
|
|
|
126 |
}
|
127 |
|
128 |
public function getQuote(Varien_Object $requestData)
|
app/code/community/Shippit/Shippit/Helper/Bugsnag.php
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Shippit Pty Ltd
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the terms
|
8 |
-
* that is available through the world-wide-web at this URL:
|
9 |
-
* http://www.shippit.com/terms
|
10 |
-
*
|
11 |
-
* @category Shippit
|
12 |
-
* @copyright Copyright (c) 2016 by Shippit Pty Ltd (http://www.shippit.com)
|
13 |
-
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
-
* @license http://www.shippit.com/terms
|
15 |
-
*/
|
16 |
-
|
17 |
-
class Shippit_Shippit_Helper_Bugsnag extends Mage_Core_Helper_Abstract
|
18 |
-
{
|
19 |
-
private $severites = 'fatal,error';
|
20 |
-
private $client = false;
|
21 |
-
private $shippitBugsnagApiKey = 'b2873ea2ae95a3c9f2cb63ca1557abb5';
|
22 |
-
|
23 |
-
public function init()
|
24 |
-
{
|
25 |
-
if (!$this->client) {
|
26 |
-
// Allow override of bugsnag key
|
27 |
-
// this can be your own bugsnag api key, or an empty string
|
28 |
-
// to disable bugsnag logging if required
|
29 |
-
$apiKey = Mage::getStoreConfig('shippit/bugsnag/api_key');
|
30 |
-
|
31 |
-
// If no api key is provided, use the shippit bugsnag api key
|
32 |
-
if (is_null($apiKey)) {
|
33 |
-
$apiKey = $this->shippitBugsnagApiKey;
|
34 |
-
}
|
35 |
-
// Otherwise, if the api key is an empty value,
|
36 |
-
// don't run bugsnag and return early
|
37 |
-
elseif (empty($apiKey)) {
|
38 |
-
return $this->client;
|
39 |
-
}
|
40 |
-
|
41 |
-
if (file_exists(Mage::getBaseDir('lib') . '/shippit-bugsnag/Autoload.php')) {
|
42 |
-
require_once(Mage::getBaseDir('lib') . '/shippit-bugsnag/Autoload.php');
|
43 |
-
}
|
44 |
-
else {
|
45 |
-
Mage::log('Shippit Bugsnag Error', 'Couldn\'t activate Bugsnag Error Monitoring due to missing Bugsnag PHP library!', null, 'shippit.log');
|
46 |
-
|
47 |
-
return false;
|
48 |
-
}
|
49 |
-
|
50 |
-
$this->client = new Bugsnag_Client($apiKey);
|
51 |
-
$this->client->setReleaseStage($this->getReleaseStage())
|
52 |
-
->setErrorReportingLevel($this->getErrorReportingLevel())
|
53 |
-
->setMetaData($this->getMetaData());
|
54 |
-
|
55 |
-
$this->client->setNotifier($this->getNotiferData());
|
56 |
-
}
|
57 |
-
|
58 |
-
return $this->client;
|
59 |
-
}
|
60 |
-
|
61 |
-
public function getReleaseStage()
|
62 |
-
{
|
63 |
-
return Mage::getIsDeveloperMode() ? "development" : "production";
|
64 |
-
}
|
65 |
-
|
66 |
-
public function getMetaData()
|
67 |
-
{
|
68 |
-
$metaData = array();
|
69 |
-
|
70 |
-
$metaData['magento'] = array(
|
71 |
-
'edition' => $this->getEdition(),
|
72 |
-
'version' => Mage::getVersion(),
|
73 |
-
);
|
74 |
-
$metaData['module'] = $this->getModuleInfo();
|
75 |
-
$metaData['store'] = array(
|
76 |
-
'url' => Mage::getBaseUrl(),
|
77 |
-
'store' => Mage::getStoreConfig('general/store_information/name'),
|
78 |
-
'contact_number' => Mage::getStoreConfig('general/store_information/phone'),
|
79 |
-
);
|
80 |
-
|
81 |
-
return $metaData;
|
82 |
-
}
|
83 |
-
|
84 |
-
public function getModuleInfo()
|
85 |
-
{
|
86 |
-
return array(
|
87 |
-
'name' => 'Shippit_Shippit',
|
88 |
-
'version' => Mage::helper('shippit')->getModuleVersion(),
|
89 |
-
);
|
90 |
-
}
|
91 |
-
|
92 |
-
public function getNotiferData()
|
93 |
-
{
|
94 |
-
return $this->getModuleInfo();
|
95 |
-
}
|
96 |
-
|
97 |
-
private function getErrorReportingLevel()
|
98 |
-
{
|
99 |
-
if (empty($this->severites)) {
|
100 |
-
$severites = "fatal,error";
|
101 |
-
}
|
102 |
-
else {
|
103 |
-
$severites = $this->severites;
|
104 |
-
}
|
105 |
-
|
106 |
-
$level = 0;
|
107 |
-
$severities = explode(",", $severites);
|
108 |
-
|
109 |
-
foreach ($severities as $severity) {
|
110 |
-
$level |= Bugsnag_ErrorTypes::getLevelsForSeverity($severity);
|
111 |
-
}
|
112 |
-
|
113 |
-
return $level;
|
114 |
-
}
|
115 |
-
|
116 |
-
private function getEdition()
|
117 |
-
{
|
118 |
-
$mage = new Mage;
|
119 |
-
|
120 |
-
if (method_exists($mage, 'getEdition')) {
|
121 |
-
return Mage::getEdition();
|
122 |
-
}
|
123 |
-
else {
|
124 |
-
return 'Unknown';
|
125 |
-
}
|
126 |
-
}
|
127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Shippit/Shippit/Helper/Carrier.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Checkout.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Data.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Sync/Item.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Sync/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Helper/Sync/Shipping.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Api/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Logger.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -18,15 +18,12 @@ class Shippit_Shippit_Model_Logger
|
|
18 |
{
|
19 |
protected $helper;
|
20 |
protected $debugMode;
|
21 |
-
|
22 |
-
public $bugsnag = false;
|
23 |
protected $metaData = array();
|
24 |
|
25 |
public function __construct()
|
26 |
{
|
27 |
$this->helper = Mage::helper('shippit');
|
28 |
$this->debugMode = $this->helper->isDebugActive();
|
29 |
-
$this->bugsnag = Mage::helper('shippit/bugsnag')->init();
|
30 |
}
|
31 |
|
32 |
public function log($errorType, $message, $level = Zend_Log::DEBUG)
|
@@ -34,8 +31,6 @@ class Shippit_Shippit_Model_Logger
|
|
34 |
// if debug mode is disabled, only log when the level is above notice
|
35 |
if (!$this->debugMode && $level <= Zend_Log::NOTICE
|
36 |
|| $this->debugMode) {
|
37 |
-
$this->bugsnagLog($errorType, $message, $level);
|
38 |
-
|
39 |
Mage::log($errorType . "\n" . $message, $level, 'shippit.log');
|
40 |
|
41 |
if (!empty($this->metaData)) {
|
@@ -46,43 +41,8 @@ class Shippit_Shippit_Model_Logger
|
|
46 |
return $this;
|
47 |
}
|
48 |
|
49 |
-
public function bugsnagLog($errorType, $message, $level = Zend_Log::DEBUG)
|
50 |
-
{
|
51 |
-
if (!$this->bugsnag) {
|
52 |
-
return $this;
|
53 |
-
}
|
54 |
-
|
55 |
-
$this->bugsnag->notifyError($errorType, $message, $this->metaData, $this->_getBugsnagErrorLevel($level));
|
56 |
-
|
57 |
-
return $this;
|
58 |
-
}
|
59 |
-
|
60 |
-
public function bugsnagException($exception)
|
61 |
-
{
|
62 |
-
if (!$this->bugsnag) {
|
63 |
-
return $this;
|
64 |
-
}
|
65 |
-
|
66 |
-
return $this->bugsnag->notifyException($exception, $this->metaData);
|
67 |
-
}
|
68 |
-
|
69 |
-
public function _getBugsnagErrorLevel($level)
|
70 |
-
{
|
71 |
-
if ($level <= 3) {
|
72 |
-
return 'error';
|
73 |
-
}
|
74 |
-
elseif ($level == 4) {
|
75 |
-
return 'warning';
|
76 |
-
}
|
77 |
-
else {
|
78 |
-
return 'info';
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
public function logException($e, $level = Zend_Log::ERR)
|
83 |
{
|
84 |
-
$this->bugsnagException($e);
|
85 |
-
|
86 |
Mage::log($e->getMessage(), $level, 'shippit.log');
|
87 |
|
88 |
if (!empty($this->metaData)) {
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
18 |
{
|
19 |
protected $helper;
|
20 |
protected $debugMode;
|
|
|
|
|
21 |
protected $metaData = array();
|
22 |
|
23 |
public function __construct()
|
24 |
{
|
25 |
$this->helper = Mage::helper('shippit');
|
26 |
$this->debugMode = $this->helper->isDebugActive();
|
|
|
27 |
}
|
28 |
|
29 |
public function log($errorType, $message, $level = Zend_Log::DEBUG)
|
31 |
// if debug mode is disabled, only log when the level is above notice
|
32 |
if (!$this->debugMode && $level <= Zend_Log::NOTICE
|
33 |
|| $this->debugMode) {
|
|
|
|
|
34 |
Mage::log($errorType . "\n" . $message, $level, 'shippit.log');
|
35 |
|
36 |
if (!empty($this->metaData)) {
|
41 |
return $this;
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
public function logException($e, $level = Zend_Log::ERR)
|
45 |
{
|
|
|
|
|
46 |
Mage::log($e->getMessage(), $level, 'shippit.log');
|
47 |
|
48 |
if (!empty($this->metaData)) {
|
app/code/community/Shippit/Shippit/Model/Observer/Adminhtml/Sales/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/Order/Sync.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/Quote/AuthorityToLeave.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/Quote/DeliveryInstructions.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/Shipping/Tracking.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/Shippit.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Observer/System/Config.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -29,43 +29,55 @@ class Shippit_Shippit_Model_Observer_System_Config
|
|
29 |
|
30 |
public function checkApiKey(Varien_Event_Observer $observer)
|
31 |
{
|
32 |
-
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
}
|
37 |
|
38 |
-
|
39 |
-
$
|
40 |
|
41 |
-
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
else {
|
50 |
-
Mage::getSingleton('adminhtml/session')->
|
51 |
-
$this->helper->__('Shippit API
|
52 |
);
|
|
|
|
|
53 |
}
|
54 |
}
|
55 |
-
|
56 |
-
Mage::getSingleton('adminhtml/session')->
|
57 |
-
$this->helper->__('Shippit API
|
58 |
);
|
|
|
59 |
|
60 |
-
|
|
|
61 |
}
|
62 |
-
}
|
63 |
-
catch (Exception $e) {
|
64 |
-
Mage::getSingleton('adminhtml/session')->addError('Shippit API error: An error occured while communicating with the Shippit API');
|
65 |
-
}
|
66 |
|
67 |
-
|
68 |
-
$
|
69 |
}
|
70 |
}
|
71 |
|
@@ -73,11 +85,22 @@ class Shippit_Shippit_Model_Observer_System_Config
|
|
73 |
{
|
74 |
try {
|
75 |
$apiKey = $this->helper->getApiKey();
|
|
|
76 |
|
77 |
-
$
|
78 |
-
'
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
$requestData = new Varien_Object;
|
83 |
$requestData->setWebhookUrl($webhookUrl);
|
@@ -85,21 +108,38 @@ class Shippit_Shippit_Model_Observer_System_Config
|
|
85 |
|
86 |
if (property_exists($merchant, 'error')) {
|
87 |
Mage::getSingleton('adminhtml/session')->addError(
|
88 |
-
$this->helper->__('Shippit Webhook Registration Error: An error occured while registering the webhook with Shippit' . $merchant->error)
|
89 |
);
|
90 |
}
|
91 |
else {
|
92 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
93 |
-
$this->helper->__('Shippit Webhook Registered: ' . $webhookUrl)
|
94 |
);
|
95 |
}
|
96 |
}
|
97 |
catch (Exception $e) {
|
98 |
Mage::getSingleton('adminhtml/session')->addError(
|
99 |
-
$this->helper->__('Shippit Webhook Registration Error: An unknown error occured while registering the webhook with Shippit ' . $e->getMessage())
|
100 |
);
|
101 |
}
|
102 |
|
103 |
return;
|
104 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
29 |
|
30 |
public function checkApiKey(Varien_Event_Observer $observer)
|
31 |
{
|
32 |
+
// get emulation model
|
33 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
34 |
|
35 |
+
$configApiKeys = Mage::getModel('core/config_data')->getCollection()
|
36 |
+
->addFieldToFilter('path', 'shippit/general/api_key');
|
|
|
37 |
|
38 |
+
foreach ($configApiKeys as $configApiKey) {
|
39 |
+
$storeId = $this->getStoreIdFromScope($configApiKey->getScope(), $configApiKey->getScopeId());
|
40 |
|
41 |
+
// Start Store Emulation
|
42 |
+
$environment = $appEmulation->startEnvironmentEmulation($storeId);
|
43 |
|
44 |
+
try {
|
45 |
+
$apiKeyValid = false;
|
46 |
+
|
47 |
+
$merchant = $this->api->getMerchant();
|
48 |
+
|
49 |
+
if (property_exists($merchant, 'error')) {
|
50 |
+
if ($merchant->error == 'invalid_merchant_account') {
|
51 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
52 |
+
$this->helper->__('Shippit configuration error - Please check the API Key for store "%s"', Mage::app()->getStore()->getName())
|
53 |
+
);
|
54 |
+
}
|
55 |
+
else {
|
56 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
57 |
+
$this->helper->__('Shippit API error for store "%s" - ' . $merchant->error, Mage::app()->getStore()->getName())
|
58 |
+
);
|
59 |
+
}
|
60 |
}
|
61 |
else {
|
62 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
63 |
+
$this->helper->__('Shippit API Key Validated for store "%s"', Mage::app()->getStore()->getName())
|
64 |
);
|
65 |
+
|
66 |
+
$apiKeyValid = true;
|
67 |
}
|
68 |
}
|
69 |
+
catch (Exception $e) {
|
70 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
71 |
+
$this->helper->__('Shippit API error: An error occured while communicating with the Shippit API for store "%s"', Mage::app()->getStore()->getName())
|
72 |
);
|
73 |
+
}
|
74 |
|
75 |
+
if ($apiKeyValid && $this->syncShippingHelper->isActive()) {
|
76 |
+
$this->registerWebhook();
|
77 |
}
|
|
|
|
|
|
|
|
|
78 |
|
79 |
+
// Stop Store Emulation
|
80 |
+
$appEmulation->stopEnvironmentEmulation($environment);
|
81 |
}
|
82 |
}
|
83 |
|
85 |
{
|
86 |
try {
|
87 |
$apiKey = $this->helper->getApiKey();
|
88 |
+
$store = Mage::app()->getStore();
|
89 |
|
90 |
+
if ($store->getId() == Mage_Core_Model_App::ADMIN_STORE_ID) {
|
91 |
+
$webhookUrl = Mage::getUrl('shippit/order/update/', array(
|
92 |
+
'api_key' => $apiKey,
|
93 |
+
'_secure' => true,
|
94 |
+
));
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
$webhookUrl = Mage::getUrl('shippit/order/update/', array(
|
98 |
+
'api_key' => $apiKey,
|
99 |
+
'_store' => $store->getCode(),
|
100 |
+
'_store_to_url' => true,
|
101 |
+
'_secure' => true,
|
102 |
+
));
|
103 |
+
}
|
104 |
|
105 |
$requestData = new Varien_Object;
|
106 |
$requestData->setWebhookUrl($webhookUrl);
|
108 |
|
109 |
if (property_exists($merchant, 'error')) {
|
110 |
Mage::getSingleton('adminhtml/session')->addError(
|
111 |
+
$this->helper->__('Shippit Webhook Registration Error: An error occured while registering the webhook with Shippit for store "%s" - ' . $merchant->error, Mage::app()->getStore()->getName())
|
112 |
);
|
113 |
}
|
114 |
else {
|
115 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
116 |
+
$this->helper->__('Shippit Webhook Registered for store "%s": ' . $webhookUrl, Mage::app()->getStore()->getName())
|
117 |
);
|
118 |
}
|
119 |
}
|
120 |
catch (Exception $e) {
|
121 |
Mage::getSingleton('adminhtml/session')->addError(
|
122 |
+
$this->helper->__('Shippit Webhook Registration Error: An unknown error occured while registering the webhook with Shippit for store "%s" ' . $e->getMessage(), Mage::app()->getStore()->getName())
|
123 |
);
|
124 |
}
|
125 |
|
126 |
return;
|
127 |
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Returns the Store Id given the scope/scopeId
|
131 |
+
*/
|
132 |
+
public function getStoreIdFromScope($scope, $scopeId)
|
133 |
+
{
|
134 |
+
$storeId = Mage_Core_Model_App::ADMIN_STORE_ID;
|
135 |
+
|
136 |
+
if ($scope === 'websites') {
|
137 |
+
$storeId = Mage::app()->getWebsite($scopeId)->getDefaultGroup()->getDefaultStoreId();
|
138 |
+
}
|
139 |
+
elseif ($scope === 'stores') {
|
140 |
+
$storeId = $scopeId;
|
141 |
+
}
|
142 |
+
|
143 |
+
return $storeId;
|
144 |
+
}
|
145 |
}
|
app/code/community/Shippit/Shippit/Model/Request/Api/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -653,7 +653,7 @@ class Shippit_Shippit_Model_Request_Api_Order extends Varien_Object
|
|
653 |
);
|
654 |
|
655 |
// for dimensions, ensure the item has values for all dimensions
|
656 |
-
if (!empty(
|
657 |
$newParcel = array_merge(
|
658 |
$newParcel,
|
659 |
array(
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
653 |
);
|
654 |
|
655 |
// for dimensions, ensure the item has values for all dimensions
|
656 |
+
if (!empty($length) && !empty($width) && !empty($depth)) {
|
657 |
$newParcel = array_merge(
|
658 |
$newParcel,
|
659 |
array(
|
app/code/community/Shippit/Shippit/Model/Request/Api/Shipment.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Request/Sync/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -258,7 +258,7 @@ class Shippit_Shippit_Model_Request_Sync_Order extends Varien_Object
|
|
258 |
);
|
259 |
|
260 |
// for dimensions, ensure the item has values for all dimensions
|
261 |
-
if (!empty(
|
262 |
$newItem = array_merge(
|
263 |
$newItem,
|
264 |
array(
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
258 |
);
|
259 |
|
260 |
// for dimensions, ensure the item has values for all dimensions
|
261 |
+
if (!empty($length) && !empty($width) && !empty($depth)) {
|
262 |
$newItem = array_merge(
|
263 |
$newItem,
|
264 |
array(
|
app/code/community/Shippit/Shippit/Model/Resource/Setup.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Resource/Sync/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Collection.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Item.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Resource/Sync/Order/Item/Collection.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Shipping/Carrier/Shippit.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Shippit.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Sync/Order.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Sync/Order/Config.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/Sync/Order/Item.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Attributes.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Attributes/Location.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Products.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Unit/Dimensions.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Catalog/Unit/Weight.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Order/Status/Processing.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shipping/Methods.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Environment.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Margin.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -36,7 +36,7 @@ class Shippit_Shippit_Model_System_Config_Source_Shippit_Margin
|
|
36 |
'value' => self::FIXED
|
37 |
)
|
38 |
);
|
39 |
-
|
40 |
return $optionsArray;
|
41 |
}
|
42 |
}
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
36 |
'value' => self::FIXED
|
37 |
)
|
38 |
);
|
39 |
+
|
40 |
return $optionsArray;
|
41 |
}
|
42 |
}
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/MaxTimeslots.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Methods.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Order/Status.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Sync/Mode.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/Model/System/Config/Source/Shippit/Sync/SendAllOrders.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/controllers/Adminhtml/Shippit/Order/SyncController.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -28,6 +28,7 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
28 |
}
|
29 |
|
30 |
$order = Mage::getModel('sales/order')->load($orderId);
|
|
|
31 |
|
32 |
if (!$order) {
|
33 |
$this->_getSession()->addError($this->__('The order could not be found'));
|
@@ -36,6 +37,12 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
36 |
return;
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
try {
|
40 |
Mage::dispatchEvent(
|
41 |
'shippit_add_order',
|
@@ -53,8 +60,6 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
53 |
'order_id' => $orderId
|
54 |
)
|
55 |
);
|
56 |
-
|
57 |
-
return;
|
58 |
}
|
59 |
catch (Exception $e) {
|
60 |
$this->_getSession()->addError($this->__('An error occured while send the order to Shippit') . ' - ' . $e->getMessage());
|
@@ -65,9 +70,12 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
65 |
'order_id' => $orderId
|
66 |
)
|
67 |
);
|
68 |
-
|
69 |
-
return;
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
public function massSendAction()
|
@@ -87,8 +95,16 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
87 |
->addAttributeToSelect('shipping_method')
|
88 |
->addAttributeToFilter('entity_id', array('in' => $orderIds));
|
89 |
|
|
|
|
|
|
|
90 |
try {
|
91 |
foreach ($orders as $order) {
|
|
|
|
|
|
|
|
|
|
|
92 |
Mage::dispatchEvent(
|
93 |
'shippit_add_order',
|
94 |
array(
|
@@ -96,6 +112,9 @@ class Shippit_Shippit_Adminhtml_Shippit_Order_SyncController extends Mage_Adminh
|
|
96 |
'shipping_method' => $order->getShippingMethod()
|
97 |
)
|
98 |
);
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
$this->_getSession()->addSuccess($this->__('The orders have been scheduled to sync with Shippit'));
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
28 |
}
|
29 |
|
30 |
$order = Mage::getModel('sales/order')->load($orderId);
|
31 |
+
$storeId = $order->getStoreId();
|
32 |
|
33 |
if (!$order) {
|
34 |
$this->_getSession()->addError($this->__('The order could not be found'));
|
37 |
return;
|
38 |
}
|
39 |
|
40 |
+
// get emulation model
|
41 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
42 |
+
|
43 |
+
// Start Store Emulation
|
44 |
+
$environment = $appEmulation->startEnvironmentEmulation($storeId);
|
45 |
+
|
46 |
try {
|
47 |
Mage::dispatchEvent(
|
48 |
'shippit_add_order',
|
60 |
'order_id' => $orderId
|
61 |
)
|
62 |
);
|
|
|
|
|
63 |
}
|
64 |
catch (Exception $e) {
|
65 |
$this->_getSession()->addError($this->__('An error occured while send the order to Shippit') . ' - ' . $e->getMessage());
|
70 |
'order_id' => $orderId
|
71 |
)
|
72 |
);
|
|
|
|
|
73 |
}
|
74 |
+
|
75 |
+
// Stop Store Emulation
|
76 |
+
$appEmulation->stopEnvironmentEmulation($environment);
|
77 |
+
|
78 |
+
return;
|
79 |
}
|
80 |
|
81 |
public function massSendAction()
|
95 |
->addAttributeToSelect('shipping_method')
|
96 |
->addAttributeToFilter('entity_id', array('in' => $orderIds));
|
97 |
|
98 |
+
// get emulation model
|
99 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
100 |
+
|
101 |
try {
|
102 |
foreach ($orders as $order) {
|
103 |
+
$storeId = $order->getStoreId();
|
104 |
+
|
105 |
+
// Start Store Emulation
|
106 |
+
$environment = $appEmulation->startEnvironmentEmulation($storeId);
|
107 |
+
|
108 |
Mage::dispatchEvent(
|
109 |
'shippit_add_order',
|
110 |
array(
|
112 |
'shipping_method' => $order->getShippingMethod()
|
113 |
)
|
114 |
);
|
115 |
+
|
116 |
+
// Stop Store Emulation
|
117 |
+
$appEmulation->stopEnvironmentEmulation($environment);
|
118 |
}
|
119 |
|
120 |
$this->_getSession()->addSuccess($this->__('The orders have been scheduled to sync with Shippit'));
|
app/code/community/Shippit/Shippit/controllers/Adminhtml/Shippit/OrderController.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -87,8 +87,20 @@ class Shippit_Shippit_Adminhtml_Shippit_OrderController extends Mage_Adminhtml_C
|
|
87 |
->save();
|
88 |
}
|
89 |
|
|
|
|
|
|
|
90 |
foreach ($syncOrders as $syncOrder) {
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
$apiOrder->sync($syncOrder, true);
|
|
|
|
|
|
|
92 |
}
|
93 |
|
94 |
$this->_redirect('*/*/index');
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
87 |
->save();
|
88 |
}
|
89 |
|
90 |
+
// get emulation model
|
91 |
+
$appEmulation = Mage::getSingleton('core/app_emulation');
|
92 |
+
|
93 |
foreach ($syncOrders as $syncOrder) {
|
94 |
+
$storeId = $syncOrder->getOrder()->getStoreId();
|
95 |
+
|
96 |
+
// Start Store Emulation
|
97 |
+
$environment = $appEmulation->startEnvironmentEmulation($storeId);
|
98 |
+
|
99 |
+
// Sync the order
|
100 |
$apiOrder->sync($syncOrder, true);
|
101 |
+
|
102 |
+
// Stop Store Emulation
|
103 |
+
$appEmulation->stopEnvironmentEmulation($environment);
|
104 |
}
|
105 |
|
106 |
$this->_redirect('*/*/index');
|
app/code/community/Shippit/Shippit/controllers/OrderController.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
@@ -22,7 +22,8 @@ class Shippit_Shippit_OrderController extends Mage_Core_Controller_Front_Action
|
|
22 |
const ERROR_BAD_REQUEST = 'An invalid request was recieved';
|
23 |
const ERROR_ORDER_MISSING = 'The order id requested was not found';
|
24 |
const ERROR_ORDER_STATUS = 'The order id requested has an status that is not available for shipping';
|
25 |
-
const NOTICE_SHIPMENT_STATUS = 'Ignoring the order status update, as we only respond to ready_for_pickup state';
|
|
|
26 |
const ERROR_SHIPMENT_FAILED = 'The shipment record was not able to be created at this time, please try again.';
|
27 |
const SUCCESS_SHIPMENT_CREATED = 'The shipment record was created successfully.';
|
28 |
|
@@ -51,12 +52,19 @@ class Shippit_Shippit_OrderController extends Mage_Core_Controller_Front_Action
|
|
51 |
|
52 |
$this->_logRequest($request);
|
53 |
|
|
|
|
|
54 |
if (!$this->_checkRequest($request)) {
|
55 |
return;
|
56 |
}
|
57 |
|
58 |
// attempt to retrieve request data values for the shipment
|
59 |
$order = $this->_getOrder($request);
|
|
|
|
|
|
|
|
|
|
|
60 |
$products = $this->_getProducts($request);
|
61 |
$courierName = $this->_getCourierName($request);
|
62 |
$trackingNumber = $this->_getTrackingNumber($request);
|
@@ -164,7 +172,13 @@ class Shippit_Shippit_OrderController extends Mage_Core_Controller_Front_Action
|
|
164 |
return false;
|
165 |
}
|
166 |
|
167 |
-
if (!isset($request['current_state'])
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
$response = $this->_prepareResponse(
|
169 |
true,
|
170 |
self::NOTICE_SHIPMENT_STATUS
|
@@ -189,6 +203,25 @@ class Shippit_Shippit_OrderController extends Mage_Core_Controller_Front_Action
|
|
189 |
return true;
|
190 |
}
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
protected function _checkOrder($order)
|
193 |
{
|
194 |
if (!$order->getId()) {
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
22 |
const ERROR_BAD_REQUEST = 'An invalid request was recieved';
|
23 |
const ERROR_ORDER_MISSING = 'The order id requested was not found';
|
24 |
const ERROR_ORDER_STATUS = 'The order id requested has an status that is not available for shipping';
|
25 |
+
const NOTICE_SHIPMENT_STATUS = 'Ignoring the order status update, as we only respond to ready_for_pickup, in_transit state';
|
26 |
+
const NOTICE_SHIPMENT_STATUS_INTRANSIT_PARTIAL = 'Ignoring the order status update, as we only respond to in_transit when the order has not yet had any shipments';
|
27 |
const ERROR_SHIPMENT_FAILED = 'The shipment record was not able to be created at this time, please try again.';
|
28 |
const SUCCESS_SHIPMENT_CREATED = 'The shipment record was created successfully.';
|
29 |
|
52 |
|
53 |
$this->_logRequest($request);
|
54 |
|
55 |
+
// Allow in transit requests to make it through, as we
|
56 |
+
// complete further checks in "checkRequestInTransit"
|
57 |
if (!$this->_checkRequest($request)) {
|
58 |
return;
|
59 |
}
|
60 |
|
61 |
// attempt to retrieve request data values for the shipment
|
62 |
$order = $this->_getOrder($request);
|
63 |
+
|
64 |
+
if (!$this->_checkRequestOrderInTransit($request, $order)) {
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
|
68 |
$products = $this->_getProducts($request);
|
69 |
$courierName = $this->_getCourierName($request);
|
70 |
$trackingNumber = $this->_getTrackingNumber($request);
|
172 |
return false;
|
173 |
}
|
174 |
|
175 |
+
if (!isset($request['current_state'])
|
176 |
+
|| empty($request['current_state'])
|
177 |
+
|| (
|
178 |
+
$request['current_state'] != 'ready_for_pickup'
|
179 |
+
&& $request['current_state'] != 'in_transit'
|
180 |
+
)
|
181 |
+
) {
|
182 |
$response = $this->_prepareResponse(
|
183 |
true,
|
184 |
self::NOTICE_SHIPMENT_STATUS
|
203 |
return true;
|
204 |
}
|
205 |
|
206 |
+
protected function _checkRequestOrderInTransit($request, $order)
|
207 |
+
{
|
208 |
+
// Don't allow requests that are "in_transit"
|
209 |
+
// to be accepted when an order has 1 or more shipments
|
210 |
+
if ($request['current_state'] == 'in_transit'
|
211 |
+
&& $order->hasShipments()) {
|
212 |
+
$response = $this->_prepareResponse(
|
213 |
+
true,
|
214 |
+
self::NOTICE_SHIPMENT_STATUS_INTRANSIT_PARTIAL
|
215 |
+
);
|
216 |
+
|
217 |
+
$this->getResponse()->setBody($response);
|
218 |
+
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
return true;
|
223 |
+
}
|
224 |
+
|
225 |
protected function _checkOrder($order)
|
226 |
{
|
227 |
if (!$order->getId()) {
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-install-4.0.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.1.0-4.1.1.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.1.6-4.1.7.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.2.3-4.2.4.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.3.2-4.3.3.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.4.0-4.5.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/data/shippit_setup/data-upgrade-4.5.3-4.5.4.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/etc/adminhtml.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
app/code/community/Shippit/Shippit/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
@@ -18,7 +18,7 @@
|
|
18 |
<config>
|
19 |
<modules>
|
20 |
<Shippit_Shippit>
|
21 |
-
<version>4.
|
22 |
</Shippit_Shippit>
|
23 |
</modules>
|
24 |
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
18 |
<config>
|
19 |
<modules>
|
20 |
<Shippit_Shippit>
|
21 |
+
<version>4.6.3</version>
|
22 |
</Shippit_Shippit>
|
23 |
</modules>
|
24 |
|
app/code/community/Shippit/Shippit/etc/system.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
@@ -49,7 +49,7 @@
|
|
49 |
<sort_order>10</sort_order>
|
50 |
<show_in_default>1</show_in_default>
|
51 |
<show_in_website>1</show_in_website>
|
52 |
-
<show_in_store>
|
53 |
</active>
|
54 |
<api_key translate="label">
|
55 |
<label>API Key</label>
|
@@ -57,7 +57,7 @@
|
|
57 |
<sort_order>20</sort_order>
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
-
<show_in_store>
|
61 |
</api_key>
|
62 |
<environment translate="label">
|
63 |
<label>Environment</label>
|
@@ -66,7 +66,7 @@
|
|
66 |
<sort_order>30</sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
<show_in_website>1</show_in_website>
|
69 |
-
<show_in_store>
|
70 |
</environment>
|
71 |
<debug_active translate="label">
|
72 |
<label>Debug Mode</label>
|
@@ -75,7 +75,7 @@
|
|
75 |
<sort_order>40</sort_order>
|
76 |
<show_in_default>1</show_in_default>
|
77 |
<show_in_website>1</show_in_website>
|
78 |
-
<show_in_store>
|
79 |
</debug_active>
|
80 |
</fields>
|
81 |
</general>
|
@@ -94,7 +94,7 @@
|
|
94 |
<sort_order>10</sort_order>
|
95 |
<show_in_default>1</show_in_default>
|
96 |
<show_in_website>1</show_in_website>
|
97 |
-
<show_in_store>
|
98 |
</authority_to_leave_active>
|
99 |
<delivery_instructions_active>
|
100 |
<label>Display Delivery Instructions</label>
|
@@ -103,7 +103,7 @@
|
|
103 |
<sort_order>20</sort_order>
|
104 |
<show_in_default>1</show_in_default>
|
105 |
<show_in_website>1</show_in_website>
|
106 |
-
<show_in_store>
|
107 |
</delivery_instructions_active>
|
108 |
</fields>
|
109 |
</checkout>
|
@@ -122,7 +122,7 @@
|
|
122 |
<sort_order>10</sort_order>
|
123 |
<show_in_default>1</show_in_default>
|
124 |
<show_in_website>1</show_in_website>
|
125 |
-
<show_in_store>
|
126 |
</active>
|
127 |
<manual_sync_active translate="label comment">
|
128 |
<label>Manual Sync Enabled</label>
|
@@ -131,7 +131,7 @@
|
|
131 |
<sort_order>20</sort_order>
|
132 |
<show_in_default>1</show_in_default>
|
133 |
<show_in_website>1</show_in_website>
|
134 |
-
<show_in_store>
|
135 |
<comment>Add a button on the order view and a mass action on the order grid to enable a manual sync of orders with Shippit</comment>
|
136 |
</manual_sync_active>
|
137 |
<filter_order_status_active>
|
@@ -141,7 +141,7 @@
|
|
141 |
<sort_order>30</sort_order>
|
142 |
<show_in_default>1</show_in_default>
|
143 |
<show_in_website>1</show_in_website>
|
144 |
-
<show_in_store>
|
145 |
<comment>By default, all orders in the "processing" state are automatically synced with shippit. Enable this option to specify the order statuses to be synced automatically.</comment>
|
146 |
</filter_order_status_active>
|
147 |
<filter_order_status>
|
@@ -158,13 +158,14 @@
|
|
158 |
<comment>The order statuses to be synced automatically</comment>
|
159 |
</filter_order_status>
|
160 |
<mode translate="label">
|
161 |
-
<label>Mode</label>
|
162 |
<frontend_type>select</frontend_type>
|
163 |
<source_model>shippit/system_config_source_shippit_sync_mode</source_model>
|
164 |
<sort_order>50</sort_order>
|
165 |
<show_in_default>1</show_in_default>
|
166 |
<show_in_website>1</show_in_website>
|
167 |
-
<show_in_store>
|
|
|
168 |
</mode>
|
169 |
<send_all_orders translate="label comment">
|
170 |
<label>Send All Orders to Shippit</label>
|
@@ -173,8 +174,8 @@
|
|
173 |
<sort_order>60</sort_order>
|
174 |
<show_in_default>1</show_in_default>
|
175 |
<show_in_website>1</show_in_website>
|
176 |
-
<show_in_store>
|
177 |
-
<comment>By Default, only orders
|
178 |
</send_all_orders>
|
179 |
<shipping_method_mapping translate="label comment">
|
180 |
<label>Shipping Method Mapping</label>
|
@@ -191,7 +192,7 @@
|
|
191 |
|
192 |
<sync_item translate="label" module="shippit">
|
193 |
<label>Items Sync</label>
|
194 |
-
<sort_order>
|
195 |
<show_in_default>1</show_in_default>
|
196 |
<show_in_website>1</show_in_website>
|
197 |
<show_in_store>1</show_in_store>
|
@@ -203,7 +204,7 @@
|
|
203 |
<sort_order>10</sort_order>
|
204 |
<show_in_default>1</show_in_default>
|
205 |
<show_in_website>1</show_in_website>
|
206 |
-
<show_in_store>
|
207 |
<comment>The unit of measurement used for the product weight</comment>
|
208 |
</product_unit_weight>
|
209 |
<product_dimension_active translate="label comment">
|
@@ -213,7 +214,7 @@
|
|
213 |
<sort_order>20</sort_order>
|
214 |
<show_in_default>1</show_in_default>
|
215 |
<show_in_website>1</show_in_website>
|
216 |
-
<show_in_store>
|
217 |
<comment>Send the product package dimensions to Shippit</comment>
|
218 |
</product_dimension_active>
|
219 |
<product_unit_dimension translate="label comment">
|
@@ -223,7 +224,7 @@
|
|
223 |
<sort_order>30</sort_order>
|
224 |
<show_in_default>1</show_in_default>
|
225 |
<show_in_website>1</show_in_website>
|
226 |
-
<show_in_store>
|
227 |
<comment>The unit of measurement used for the product dimensions</comment>
|
228 |
<depends>
|
229 |
<product_dimension_active>1</product_dimension_active>
|
@@ -237,7 +238,7 @@
|
|
237 |
<sort_order>40</sort_order>
|
238 |
<show_in_default>1</show_in_default>
|
239 |
<show_in_website>1</show_in_website>
|
240 |
-
<show_in_store>
|
241 |
<comment>The Product Attribute to be used for length data</comment>
|
242 |
<depends>
|
243 |
<product_dimension_active>1</product_dimension_active>
|
@@ -251,7 +252,7 @@
|
|
251 |
<sort_order>50</sort_order>
|
252 |
<show_in_default>1</show_in_default>
|
253 |
<show_in_website>1</show_in_website>
|
254 |
-
<show_in_store>
|
255 |
<comment>The Product Attribute to be used for width data</comment>
|
256 |
<depends>
|
257 |
<product_dimension_active>1</product_dimension_active>
|
@@ -265,7 +266,7 @@
|
|
265 |
<sort_order>60</sort_order>
|
266 |
<show_in_default>1</show_in_default>
|
267 |
<show_in_website>1</show_in_website>
|
268 |
-
<show_in_store>
|
269 |
<comment>The Product Attribute to be used for depth data</comment>
|
270 |
<depends>
|
271 |
<product_dimension_active>1</product_dimension_active>
|
@@ -278,7 +279,7 @@
|
|
278 |
<sort_order>70</sort_order>
|
279 |
<show_in_default>1</show_in_default>
|
280 |
<show_in_website>1</show_in_website>
|
281 |
-
<show_in_store>
|
282 |
<comment>Send the product stock location to Shippit</comment>
|
283 |
</product_location_active>
|
284 |
<product_location_attribute_code translate="label comment">
|
@@ -288,7 +289,7 @@
|
|
288 |
<sort_order>80</sort_order>
|
289 |
<show_in_default>1</show_in_default>
|
290 |
<show_in_website>1</show_in_website>
|
291 |
-
<show_in_store>
|
292 |
<comment>The Product Attribute to be used for location information on Shippit Pick Slips</comment>
|
293 |
<depends>
|
294 |
<product_location_active>1</product_location_active>
|
@@ -299,7 +300,7 @@
|
|
299 |
|
300 |
<sync_shipping>
|
301 |
<label>Shipping Sync</label>
|
302 |
-
<sort_order>
|
303 |
<show_in_default>1</show_in_default>
|
304 |
<show_in_website>1</show_in_website>
|
305 |
<show_in_store>1</show_in_store>
|
@@ -311,7 +312,7 @@
|
|
311 |
<sort_order>10</sort_order>
|
312 |
<show_in_default>1</show_in_default>
|
313 |
<show_in_website>1</show_in_website>
|
314 |
-
<show_in_store>
|
315 |
</active>
|
316 |
<update_template_active>
|
317 |
<label>Update Shipping Template</label>
|
@@ -320,7 +321,7 @@
|
|
320 |
<sort_order>20</sort_order>
|
321 |
<show_in_default>1</show_in_default>
|
322 |
<show_in_website>1</show_in_website>
|
323 |
-
<show_in_store>
|
324 |
<comments>Updates the shipping template to include the tracking link to Shippit</comments>
|
325 |
</update_template_active>
|
326 |
</fields>
|
@@ -344,7 +345,7 @@
|
|
344 |
<sort_order>10</sort_order>
|
345 |
<show_in_default>1</show_in_default>
|
346 |
<show_in_website>1</show_in_website>
|
347 |
-
<show_in_store>
|
348 |
</active>
|
349 |
<title translate="label">
|
350 |
<label>Title</label>
|
@@ -352,7 +353,7 @@
|
|
352 |
<sort_order>70</sort_order>
|
353 |
<show_in_default>1</show_in_default>
|
354 |
<show_in_website>1</show_in_website>
|
355 |
-
<show_in_store>
|
356 |
</title>
|
357 |
<allowed_methods translate="label">
|
358 |
<label>Allowed Methods</label>
|
@@ -361,7 +362,7 @@
|
|
361 |
<sort_order>80</sort_order>
|
362 |
<show_in_default>1</show_in_default>
|
363 |
<show_in_website>1</show_in_website>
|
364 |
-
<show_in_store>
|
365 |
<can_be_empty>1</can_be_empty>
|
366 |
</allowed_methods>
|
367 |
<margin translate="label">
|
@@ -371,7 +372,7 @@
|
|
371 |
<sort_order>90</sort_order>
|
372 |
<show_in_default>1</show_in_default>
|
373 |
<show_in_website>1</show_in_website>
|
374 |
-
<show_in_store>
|
375 |
<comment>Add a margin to the quote</comment>
|
376 |
</margin>
|
377 |
<margin_amount>
|
@@ -380,7 +381,7 @@
|
|
380 |
<sort_order>100</sort_order>
|
381 |
<show_in_default>1</show_in_default>
|
382 |
<show_in_website>1</show_in_website>
|
383 |
-
<show_in_store>
|
384 |
<comment>Enter the margin amount to be applied</comment>
|
385 |
</margin_amount>
|
386 |
<max_timeslots translate="label">
|
@@ -390,7 +391,7 @@
|
|
390 |
<sort_order>110</sort_order>
|
391 |
<show_in_default>1</show_in_default>
|
392 |
<show_in_website>1</show_in_website>
|
393 |
-
<show_in_store>
|
394 |
</max_timeslots>
|
395 |
<enabled_product_active translate="label comment">
|
396 |
<label>Filter by Enabled Products</label>
|
@@ -399,7 +400,7 @@
|
|
399 |
<sort_order>120</sort_order>
|
400 |
<show_in_default>1</show_in_default>
|
401 |
<show_in_website>1</show_in_website>
|
402 |
-
<show_in_store>
|
403 |
<comment>Filter by products for items that are available for shipping via Shippit.</comment>
|
404 |
</enabled_product_active>
|
405 |
<enabled_product_ids translate="label comment">
|
@@ -409,7 +410,7 @@
|
|
409 |
<sort_order>130</sort_order>
|
410 |
<show_in_default>1</show_in_default>
|
411 |
<show_in_website>1</show_in_website>
|
412 |
-
<show_in_store>
|
413 |
<can_be_empty>1</can_be_empty>
|
414 |
<comment>Select the Products for which you want this method to be available.</comment>
|
415 |
<depends>
|
@@ -423,7 +424,7 @@
|
|
423 |
<sort_order>140</sort_order>
|
424 |
<show_in_default>1</show_in_default>
|
425 |
<show_in_website>1</show_in_website>
|
426 |
-
<show_in_store>
|
427 |
<comment>Filter by product attribute for items that are available for shipping via Shippit.</comment>
|
428 |
</enabled_product_attribute_active>
|
429 |
<enabled_product_attribute_code translate="label comment">
|
@@ -433,7 +434,7 @@
|
|
433 |
<sort_order>150</sort_order>
|
434 |
<show_in_default>1</show_in_default>
|
435 |
<show_in_website>1</show_in_website>
|
436 |
-
<show_in_store>
|
437 |
<comment>Select the attribute code to filter by</comment>
|
438 |
<depends>
|
439 |
<enabled_product_attribute_active>1</enabled_product_attribute_active>
|
@@ -445,8 +446,8 @@
|
|
445 |
<sort_order>160</sort_order>
|
446 |
<show_in_default>1</show_in_default>
|
447 |
<show_in_website>1</show_in_website>
|
448 |
-
<show_in_store>
|
449 |
-
<comment>Enter the attribute value to filter by.
|
450 |
<depends>
|
451 |
<enabled_product_attribute_active>1</enabled_product_attribute_active>
|
452 |
</depends>
|
@@ -459,7 +460,7 @@
|
|
459 |
<sort_order>170</sort_order>
|
460 |
<show_in_default>1</show_in_default>
|
461 |
<show_in_website>1</show_in_website>
|
462 |
-
<show_in_store>
|
463 |
</sallowspecific>
|
464 |
<specificcountry translate="label">
|
465 |
<label>Ship to Specific Countries</label>
|
@@ -468,7 +469,7 @@
|
|
468 |
<source_model>adminhtml/system_config_source_country</source_model>
|
469 |
<show_in_default>1</show_in_default>
|
470 |
<show_in_website>1</show_in_website>
|
471 |
-
<show_in_store>
|
472 |
<can_be_empty>1</can_be_empty>
|
473 |
</specificcountry>
|
474 |
<showmethod translate="label">
|
@@ -479,7 +480,7 @@
|
|
479 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
480 |
<show_in_default>1</show_in_default>
|
481 |
<show_in_website>1</show_in_website>
|
482 |
-
<show_in_store>
|
483 |
</showmethod>
|
484 |
<sort_order translate="label">
|
485 |
<label>Sort Order</label>
|
@@ -487,7 +488,7 @@
|
|
487 |
<sort_order>200</sort_order>
|
488 |
<show_in_default>1</show_in_default>
|
489 |
<show_in_website>1</show_in_website>
|
490 |
-
<show_in_store>
|
491 |
</sort_order>
|
492 |
</fields>
|
493 |
</shippit>
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
49 |
<sort_order>10</sort_order>
|
50 |
<show_in_default>1</show_in_default>
|
51 |
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
</active>
|
54 |
<api_key translate="label">
|
55 |
<label>API Key</label>
|
57 |
<sort_order>20</sort_order>
|
58 |
<show_in_default>1</show_in_default>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>1</show_in_store>
|
61 |
</api_key>
|
62 |
<environment translate="label">
|
63 |
<label>Environment</label>
|
66 |
<sort_order>30</sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
</environment>
|
71 |
<debug_active translate="label">
|
72 |
<label>Debug Mode</label>
|
75 |
<sort_order>40</sort_order>
|
76 |
<show_in_default>1</show_in_default>
|
77 |
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>1</show_in_store>
|
79 |
</debug_active>
|
80 |
</fields>
|
81 |
</general>
|
94 |
<sort_order>10</sort_order>
|
95 |
<show_in_default>1</show_in_default>
|
96 |
<show_in_website>1</show_in_website>
|
97 |
+
<show_in_store>1</show_in_store>
|
98 |
</authority_to_leave_active>
|
99 |
<delivery_instructions_active>
|
100 |
<label>Display Delivery Instructions</label>
|
103 |
<sort_order>20</sort_order>
|
104 |
<show_in_default>1</show_in_default>
|
105 |
<show_in_website>1</show_in_website>
|
106 |
+
<show_in_store>1</show_in_store>
|
107 |
</delivery_instructions_active>
|
108 |
</fields>
|
109 |
</checkout>
|
122 |
<sort_order>10</sort_order>
|
123 |
<show_in_default>1</show_in_default>
|
124 |
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>1</show_in_store>
|
126 |
</active>
|
127 |
<manual_sync_active translate="label comment">
|
128 |
<label>Manual Sync Enabled</label>
|
131 |
<sort_order>20</sort_order>
|
132 |
<show_in_default>1</show_in_default>
|
133 |
<show_in_website>1</show_in_website>
|
134 |
+
<show_in_store>1</show_in_store>
|
135 |
<comment>Add a button on the order view and a mass action on the order grid to enable a manual sync of orders with Shippit</comment>
|
136 |
</manual_sync_active>
|
137 |
<filter_order_status_active>
|
141 |
<sort_order>30</sort_order>
|
142 |
<show_in_default>1</show_in_default>
|
143 |
<show_in_website>1</show_in_website>
|
144 |
+
<show_in_store>1</show_in_store>
|
145 |
<comment>By default, all orders in the "processing" state are automatically synced with shippit. Enable this option to specify the order statuses to be synced automatically.</comment>
|
146 |
</filter_order_status_active>
|
147 |
<filter_order_status>
|
158 |
<comment>The order statuses to be synced automatically</comment>
|
159 |
</filter_order_status>
|
160 |
<mode translate="label">
|
161 |
+
<label>Sync Mode</label>
|
162 |
<frontend_type>select</frontend_type>
|
163 |
<source_model>shippit/system_config_source_shippit_sync_mode</source_model>
|
164 |
<sort_order>50</sort_order>
|
165 |
<show_in_default>1</show_in_default>
|
166 |
<show_in_website>1</show_in_website>
|
167 |
+
<show_in_store>1</show_in_store>
|
168 |
+
<comment><![CDATA[The mode in which orders are synced with Shippit.<br><strong>Realtime:</strong> Syncs new orders (that are marked as paid) immediately.<br><strong>Scheduled:</strong> Syncs new orders using the Magento Scheduler (Cron) every 5 minutes<br><strong>Custom:</strong> For custom integrations, this mode prevents orders from automatically being triggered for sync, but is otherwise eqivilant to the Scheduled mode.]]></comment>
|
169 |
</mode>
|
170 |
<send_all_orders translate="label comment">
|
171 |
<label>Send All Orders to Shippit</label>
|
174 |
<sort_order>60</sort_order>
|
175 |
<show_in_default>1</show_in_default>
|
176 |
<show_in_website>1</show_in_website>
|
177 |
+
<show_in_store>1</show_in_store>
|
178 |
+
<comment>By Default, only orders that utilise a Shipping Live Quote Shipping Method, or a Shipping Method that is mapped (see Shipping Method Mapping below), are sent to Shippit</comment>
|
179 |
</send_all_orders>
|
180 |
<shipping_method_mapping translate="label comment">
|
181 |
<label>Shipping Method Mapping</label>
|
192 |
|
193 |
<sync_item translate="label" module="shippit">
|
194 |
<label>Items Sync</label>
|
195 |
+
<sort_order>50</sort_order>
|
196 |
<show_in_default>1</show_in_default>
|
197 |
<show_in_website>1</show_in_website>
|
198 |
<show_in_store>1</show_in_store>
|
204 |
<sort_order>10</sort_order>
|
205 |
<show_in_default>1</show_in_default>
|
206 |
<show_in_website>1</show_in_website>
|
207 |
+
<show_in_store>1</show_in_store>
|
208 |
<comment>The unit of measurement used for the product weight</comment>
|
209 |
</product_unit_weight>
|
210 |
<product_dimension_active translate="label comment">
|
214 |
<sort_order>20</sort_order>
|
215 |
<show_in_default>1</show_in_default>
|
216 |
<show_in_website>1</show_in_website>
|
217 |
+
<show_in_store>1</show_in_store>
|
218 |
<comment>Send the product package dimensions to Shippit</comment>
|
219 |
</product_dimension_active>
|
220 |
<product_unit_dimension translate="label comment">
|
224 |
<sort_order>30</sort_order>
|
225 |
<show_in_default>1</show_in_default>
|
226 |
<show_in_website>1</show_in_website>
|
227 |
+
<show_in_store>1</show_in_store>
|
228 |
<comment>The unit of measurement used for the product dimensions</comment>
|
229 |
<depends>
|
230 |
<product_dimension_active>1</product_dimension_active>
|
238 |
<sort_order>40</sort_order>
|
239 |
<show_in_default>1</show_in_default>
|
240 |
<show_in_website>1</show_in_website>
|
241 |
+
<show_in_store>1</show_in_store>
|
242 |
<comment>The Product Attribute to be used for length data</comment>
|
243 |
<depends>
|
244 |
<product_dimension_active>1</product_dimension_active>
|
252 |
<sort_order>50</sort_order>
|
253 |
<show_in_default>1</show_in_default>
|
254 |
<show_in_website>1</show_in_website>
|
255 |
+
<show_in_store>1</show_in_store>
|
256 |
<comment>The Product Attribute to be used for width data</comment>
|
257 |
<depends>
|
258 |
<product_dimension_active>1</product_dimension_active>
|
266 |
<sort_order>60</sort_order>
|
267 |
<show_in_default>1</show_in_default>
|
268 |
<show_in_website>1</show_in_website>
|
269 |
+
<show_in_store>1</show_in_store>
|
270 |
<comment>The Product Attribute to be used for depth data</comment>
|
271 |
<depends>
|
272 |
<product_dimension_active>1</product_dimension_active>
|
279 |
<sort_order>70</sort_order>
|
280 |
<show_in_default>1</show_in_default>
|
281 |
<show_in_website>1</show_in_website>
|
282 |
+
<show_in_store>1</show_in_store>
|
283 |
<comment>Send the product stock location to Shippit</comment>
|
284 |
</product_location_active>
|
285 |
<product_location_attribute_code translate="label comment">
|
289 |
<sort_order>80</sort_order>
|
290 |
<show_in_default>1</show_in_default>
|
291 |
<show_in_website>1</show_in_website>
|
292 |
+
<show_in_store>1</show_in_store>
|
293 |
<comment>The Product Attribute to be used for location information on Shippit Pick Slips</comment>
|
294 |
<depends>
|
295 |
<product_location_active>1</product_location_active>
|
300 |
|
301 |
<sync_shipping>
|
302 |
<label>Shipping Sync</label>
|
303 |
+
<sort_order>60</sort_order>
|
304 |
<show_in_default>1</show_in_default>
|
305 |
<show_in_website>1</show_in_website>
|
306 |
<show_in_store>1</show_in_store>
|
312 |
<sort_order>10</sort_order>
|
313 |
<show_in_default>1</show_in_default>
|
314 |
<show_in_website>1</show_in_website>
|
315 |
+
<show_in_store>1</show_in_store>
|
316 |
</active>
|
317 |
<update_template_active>
|
318 |
<label>Update Shipping Template</label>
|
321 |
<sort_order>20</sort_order>
|
322 |
<show_in_default>1</show_in_default>
|
323 |
<show_in_website>1</show_in_website>
|
324 |
+
<show_in_store>1</show_in_store>
|
325 |
<comments>Updates the shipping template to include the tracking link to Shippit</comments>
|
326 |
</update_template_active>
|
327 |
</fields>
|
345 |
<sort_order>10</sort_order>
|
346 |
<show_in_default>1</show_in_default>
|
347 |
<show_in_website>1</show_in_website>
|
348 |
+
<show_in_store>1</show_in_store>
|
349 |
</active>
|
350 |
<title translate="label">
|
351 |
<label>Title</label>
|
353 |
<sort_order>70</sort_order>
|
354 |
<show_in_default>1</show_in_default>
|
355 |
<show_in_website>1</show_in_website>
|
356 |
+
<show_in_store>1</show_in_store>
|
357 |
</title>
|
358 |
<allowed_methods translate="label">
|
359 |
<label>Allowed Methods</label>
|
362 |
<sort_order>80</sort_order>
|
363 |
<show_in_default>1</show_in_default>
|
364 |
<show_in_website>1</show_in_website>
|
365 |
+
<show_in_store>1</show_in_store>
|
366 |
<can_be_empty>1</can_be_empty>
|
367 |
</allowed_methods>
|
368 |
<margin translate="label">
|
372 |
<sort_order>90</sort_order>
|
373 |
<show_in_default>1</show_in_default>
|
374 |
<show_in_website>1</show_in_website>
|
375 |
+
<show_in_store>1</show_in_store>
|
376 |
<comment>Add a margin to the quote</comment>
|
377 |
</margin>
|
378 |
<margin_amount>
|
381 |
<sort_order>100</sort_order>
|
382 |
<show_in_default>1</show_in_default>
|
383 |
<show_in_website>1</show_in_website>
|
384 |
+
<show_in_store>1</show_in_store>
|
385 |
<comment>Enter the margin amount to be applied</comment>
|
386 |
</margin_amount>
|
387 |
<max_timeslots translate="label">
|
391 |
<sort_order>110</sort_order>
|
392 |
<show_in_default>1</show_in_default>
|
393 |
<show_in_website>1</show_in_website>
|
394 |
+
<show_in_store>1</show_in_store>
|
395 |
</max_timeslots>
|
396 |
<enabled_product_active translate="label comment">
|
397 |
<label>Filter by Enabled Products</label>
|
400 |
<sort_order>120</sort_order>
|
401 |
<show_in_default>1</show_in_default>
|
402 |
<show_in_website>1</show_in_website>
|
403 |
+
<show_in_store>1</show_in_store>
|
404 |
<comment>Filter by products for items that are available for shipping via Shippit.</comment>
|
405 |
</enabled_product_active>
|
406 |
<enabled_product_ids translate="label comment">
|
410 |
<sort_order>130</sort_order>
|
411 |
<show_in_default>1</show_in_default>
|
412 |
<show_in_website>1</show_in_website>
|
413 |
+
<show_in_store>1</show_in_store>
|
414 |
<can_be_empty>1</can_be_empty>
|
415 |
<comment>Select the Products for which you want this method to be available.</comment>
|
416 |
<depends>
|
424 |
<sort_order>140</sort_order>
|
425 |
<show_in_default>1</show_in_default>
|
426 |
<show_in_website>1</show_in_website>
|
427 |
+
<show_in_store>1</show_in_store>
|
428 |
<comment>Filter by product attribute for items that are available for shipping via Shippit.</comment>
|
429 |
</enabled_product_attribute_active>
|
430 |
<enabled_product_attribute_code translate="label comment">
|
434 |
<sort_order>150</sort_order>
|
435 |
<show_in_default>1</show_in_default>
|
436 |
<show_in_website>1</show_in_website>
|
437 |
+
<show_in_store>1</show_in_store>
|
438 |
<comment>Select the attribute code to filter by</comment>
|
439 |
<depends>
|
440 |
<enabled_product_attribute_active>1</enabled_product_attribute_active>
|
446 |
<sort_order>160</sort_order>
|
447 |
<show_in_default>1</show_in_default>
|
448 |
<show_in_website>1</show_in_website>
|
449 |
+
<show_in_store>1</show_in_store>
|
450 |
+
<comment>Enter the attribute value to filter by. The * character indicates a wildcard.</comment>
|
451 |
<depends>
|
452 |
<enabled_product_attribute_active>1</enabled_product_attribute_active>
|
453 |
</depends>
|
460 |
<sort_order>170</sort_order>
|
461 |
<show_in_default>1</show_in_default>
|
462 |
<show_in_website>1</show_in_website>
|
463 |
+
<show_in_store>1</show_in_store>
|
464 |
</sallowspecific>
|
465 |
<specificcountry translate="label">
|
466 |
<label>Ship to Specific Countries</label>
|
469 |
<source_model>adminhtml/system_config_source_country</source_model>
|
470 |
<show_in_default>1</show_in_default>
|
471 |
<show_in_website>1</show_in_website>
|
472 |
+
<show_in_store>1</show_in_store>
|
473 |
<can_be_empty>1</can_be_empty>
|
474 |
</specificcountry>
|
475 |
<showmethod translate="label">
|
480 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
481 |
<show_in_default>1</show_in_default>
|
482 |
<show_in_website>1</show_in_website>
|
483 |
+
<show_in_store>1</show_in_store>
|
484 |
</showmethod>
|
485 |
<sort_order translate="label">
|
486 |
<label>Sort Order</label>
|
488 |
<sort_order>200</sort_order>
|
489 |
<show_in_default>1</show_in_default>
|
490 |
<show_in_website>1</show_in_website>
|
491 |
+
<show_in_store>1</show_in_store>
|
492 |
</sort_order>
|
493 |
</fields>
|
494 |
</shippit>
|
app/code/community/Shippit/Shippit/sql/shippit_setup/install-4.0.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.0.9-4.1.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.1.0-4.1.1.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.2.5-4.2.6.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.2.6-4.3.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/code/community/Shippit/Shippit/sql/shippit_setup/upgrade-4.4.0-4.5.0.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/design/adminhtml/default/default/layout/shippit.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
app/design/frontend/base/default/layout/shippit.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
-
* @copyright Copyright (c)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
10 |
* http://www.shippit.com/terms
|
11 |
*
|
12 |
* @category Shippit
|
13 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
14 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
15 |
* @license http://www.shippit.com/terms
|
16 |
*/
|
app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method.phtml
CHANGED
@@ -9,12 +9,14 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
16 |
?>
|
17 |
<form id="co-shipping-method-form" action="">
|
|
|
|
|
18 |
<div id="checkout-shipping-method-load">
|
19 |
<!-- Content loaded dynamically -->
|
20 |
</div>
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
16 |
?>
|
17 |
<form id="co-shipping-method-form" action="">
|
18 |
+
<?php echo $this->getBlockHtml('formkey') ?>
|
19 |
+
|
20 |
<div id="checkout-shipping-method-load">
|
21 |
<!-- Content loaded dynamically -->
|
22 |
</div>
|
app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method/authoritytoleave.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/design/frontend/base/default/template/shippit/checkout/onepage/shipping_method/deliveryinstructions.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
app/design/frontend/base/default/template/shippit/email/order/shipment/track.phtml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
-
* @copyright Copyright (c)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
9 |
* http://www.shippit.com/terms
|
10 |
*
|
11 |
* @category Shippit
|
12 |
+
* @copyright Copyright (c) Shippit Pty Ltd (http://www.shippit.com)
|
13 |
* @author Matthew Muscat <matthew@mamis.com.au>
|
14 |
* @license http://www.shippit.com/terms
|
15 |
*/
|
lib/shippit-bugsnag/Autoload.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// We used to have an autoloader, but it caused problems in some
|
4 |
-
// environments. So now we manually load the entire library upfront.
|
5 |
-
//
|
6 |
-
// The file is still called Autoload so that existing integration
|
7 |
-
// instructions continue to work.
|
8 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Client.php';
|
9 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Configuration.php';
|
10 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Diagnostics.php';
|
11 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Error.php';
|
12 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'ErrorTypes.php';
|
13 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Notification.php';
|
14 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Request.php';
|
15 |
-
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'Stacktrace.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Client.php
DELETED
@@ -1,657 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Client
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* The config instance.
|
7 |
-
*
|
8 |
-
* @var Bugsnag_Configuration
|
9 |
-
*/
|
10 |
-
private $config;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* The diagnostics instance.
|
14 |
-
*
|
15 |
-
* @var Bugsnag_Diagnostics
|
16 |
-
*/
|
17 |
-
private $diagnostics;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* The notification instance.
|
21 |
-
*
|
22 |
-
* @var Bugsnag_Notification|null
|
23 |
-
*/
|
24 |
-
private $notification;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Create a new client instance.
|
28 |
-
*
|
29 |
-
* @param string $apiKey your Bugsnag API key
|
30 |
-
*
|
31 |
-
* @throws Exception
|
32 |
-
*
|
33 |
-
* @return void
|
34 |
-
*/
|
35 |
-
public function __construct($apiKey)
|
36 |
-
{
|
37 |
-
// Check API key has been passed
|
38 |
-
if (!is_string($apiKey)) {
|
39 |
-
throw new Exception('Bugsnag Error: Invalid API key');
|
40 |
-
}
|
41 |
-
|
42 |
-
// Create a configuration object
|
43 |
-
$this->config = new Bugsnag_Configuration();
|
44 |
-
$this->config->apiKey = $apiKey;
|
45 |
-
|
46 |
-
// Build a Diagnostics object
|
47 |
-
$this->diagnostics = new Bugsnag_Diagnostics($this->config);
|
48 |
-
|
49 |
-
// Register a shutdown function to check for fatal errors
|
50 |
-
// and flush any buffered errors
|
51 |
-
register_shutdown_function(array($this, 'shutdownHandler'));
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Set your release stage, eg "production" or "development".
|
56 |
-
*
|
57 |
-
* @param string $releaseStage the app's current release stage
|
58 |
-
*
|
59 |
-
* @return $this
|
60 |
-
*/
|
61 |
-
public function setReleaseStage($releaseStage)
|
62 |
-
{
|
63 |
-
$this->config->releaseStage = $releaseStage;
|
64 |
-
|
65 |
-
return $this;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Set your app's semantic version, eg "1.2.3".
|
70 |
-
*
|
71 |
-
* @param string $appVersion the app's version
|
72 |
-
*
|
73 |
-
* @return $this
|
74 |
-
*/
|
75 |
-
public function setAppVersion($appVersion)
|
76 |
-
{
|
77 |
-
$this->config->appVersion = $appVersion;
|
78 |
-
|
79 |
-
return $this;
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Set the host name.
|
84 |
-
*
|
85 |
-
* @param string $hostname the host name
|
86 |
-
*
|
87 |
-
* @return $this
|
88 |
-
*/
|
89 |
-
public function setHostname($hostname)
|
90 |
-
{
|
91 |
-
$this->config->hostname = $hostname;
|
92 |
-
|
93 |
-
return $this;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Set which release stages should be allowed to notify Bugsnag.
|
98 |
-
*
|
99 |
-
* Eg array('production', 'development').
|
100 |
-
*
|
101 |
-
* @param array $notifyReleaseStages array of release stages to notify for
|
102 |
-
*
|
103 |
-
* @return $this
|
104 |
-
*/
|
105 |
-
public function setNotifyReleaseStages(array $notifyReleaseStages)
|
106 |
-
{
|
107 |
-
$this->config->notifyReleaseStages = $notifyReleaseStages;
|
108 |
-
|
109 |
-
return $this;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Set which Bugsnag endpoint to send errors to.
|
114 |
-
*
|
115 |
-
* @param string $endpoint endpoint URL
|
116 |
-
*
|
117 |
-
* @return $this
|
118 |
-
*/
|
119 |
-
public function setEndpoint($endpoint)
|
120 |
-
{
|
121 |
-
$this->config->endpoint = $endpoint;
|
122 |
-
|
123 |
-
return $this;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Enable debug mode to help diagnose problems.
|
128 |
-
*
|
129 |
-
* @param bool $debug whether to enable debug mode
|
130 |
-
*
|
131 |
-
* @return $this
|
132 |
-
*/
|
133 |
-
public function setDebug($debug)
|
134 |
-
{
|
135 |
-
$this->config->debug = $debug;
|
136 |
-
|
137 |
-
return $this;
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Set whether or not to use SSL when notifying bugsnag.
|
142 |
-
*
|
143 |
-
* @param bool $useSSL whether to use SSL
|
144 |
-
*
|
145 |
-
* @return $this
|
146 |
-
*
|
147 |
-
* @deprecated since version 2.5. Pass full URLs to setEndpoint.
|
148 |
-
*/
|
149 |
-
public function setUseSSL($useSSL)
|
150 |
-
{
|
151 |
-
$this->config->useSSL = $useSSL;
|
152 |
-
|
153 |
-
return $this;
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Set the desired timeout for cURL connection when notifying bugsnag.
|
158 |
-
*
|
159 |
-
* @param int $timeout the desired timeout in seconds
|
160 |
-
*
|
161 |
-
* @return $this
|
162 |
-
*/
|
163 |
-
public function setTimeout($timeout)
|
164 |
-
{
|
165 |
-
$this->config->timeout = $timeout;
|
166 |
-
|
167 |
-
return $this;
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Set the absolute path to the root of your application.
|
172 |
-
*
|
173 |
-
* We use this to help with error grouping and to highlight "in project"
|
174 |
-
* stacktrace lines.
|
175 |
-
*
|
176 |
-
* @param string $projectRoot the root path for your application
|
177 |
-
*
|
178 |
-
* @return $this
|
179 |
-
*/
|
180 |
-
public function setProjectRoot($projectRoot)
|
181 |
-
{
|
182 |
-
$this->config->setProjectRoot($projectRoot);
|
183 |
-
|
184 |
-
return $this;
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Set the absolute split path.
|
189 |
-
*
|
190 |
-
* This is the path that should be stripped from the beginning of any
|
191 |
-
* stacktrace file line. This helps to normalise filenames for grouping
|
192 |
-
* and reduces the noise in stack traces.
|
193 |
-
*
|
194 |
-
* @param string $stripPath the path to strip from filenames
|
195 |
-
*
|
196 |
-
* @return $this
|
197 |
-
*/
|
198 |
-
public function setStripPath($stripPath)
|
199 |
-
{
|
200 |
-
$this->config->setStripPath($stripPath);
|
201 |
-
|
202 |
-
return $this;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Set the a regular expression for matching filenames in stacktrace lines.
|
207 |
-
*
|
208 |
-
* @param string $projectRootRegex regex matching paths belong to your project
|
209 |
-
*
|
210 |
-
* @return $this
|
211 |
-
*/
|
212 |
-
public function setProjectRootRegex($projectRootRegex)
|
213 |
-
{
|
214 |
-
$this->config->projectRootRegex = $projectRootRegex;
|
215 |
-
|
216 |
-
return $this;
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Set the strings to filter out from metaData arrays before sending then.
|
221 |
-
*
|
222 |
-
* Eg. array('password', 'credit_card').
|
223 |
-
*
|
224 |
-
* @param array $filters an array of metaData filters
|
225 |
-
*
|
226 |
-
* @return $this
|
227 |
-
*/
|
228 |
-
public function setFilters(array $filters)
|
229 |
-
{
|
230 |
-
$this->config->filters = $filters;
|
231 |
-
|
232 |
-
return $this;
|
233 |
-
}
|
234 |
-
|
235 |
-
/**
|
236 |
-
* Set information about the current user of your app, including id, name and email.
|
237 |
-
*
|
238 |
-
* @param array $user an array of user information. Eg:
|
239 |
-
* array(
|
240 |
-
* 'name' => 'Bob Hoskins',
|
241 |
-
* 'email' => 'bob@hoskins.com'
|
242 |
-
* )
|
243 |
-
*
|
244 |
-
* @return $this
|
245 |
-
*/
|
246 |
-
public function setUser(array $user)
|
247 |
-
{
|
248 |
-
$this->config->user = $user;
|
249 |
-
|
250 |
-
return $this;
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* @param $userId
|
255 |
-
*
|
256 |
-
* @return $this
|
257 |
-
*
|
258 |
-
* @deprecated since version 2.1. Use setUser instead.
|
259 |
-
*/
|
260 |
-
public function setUserId($userId)
|
261 |
-
{
|
262 |
-
if (!is_array($this->config->user)) {
|
263 |
-
$this->config->user = array();
|
264 |
-
}
|
265 |
-
|
266 |
-
$this->config->user['id'] = $userId;
|
267 |
-
|
268 |
-
return $this;
|
269 |
-
}
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Set a context representing the current type of request, or location in code.
|
273 |
-
*
|
274 |
-
* @param string $context the current context
|
275 |
-
*
|
276 |
-
* @return $this
|
277 |
-
*/
|
278 |
-
public function setContext($context)
|
279 |
-
{
|
280 |
-
$this->config->context = $context;
|
281 |
-
|
282 |
-
return $this;
|
283 |
-
}
|
284 |
-
|
285 |
-
/**
|
286 |
-
* Set the type of application executing the code.
|
287 |
-
*
|
288 |
-
* This is usually used to represent if you are running plain PHP code
|
289 |
-
* "php", via a framework, eg "laravel", or executing through delayed
|
290 |
-
* worker code, eg "resque".
|
291 |
-
*
|
292 |
-
* @param string $type the current type
|
293 |
-
*
|
294 |
-
* @return $this
|
295 |
-
*/
|
296 |
-
public function setType($type)
|
297 |
-
{
|
298 |
-
$this->config->type = $type;
|
299 |
-
|
300 |
-
return $this;
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Set custom metadata to send to Bugsnag with every error.
|
305 |
-
*
|
306 |
-
* You can use this to add custom tabs of data to each error on your
|
307 |
-
* Bugsnag dashboard.
|
308 |
-
*
|
309 |
-
* @param array $metaData an array of arrays of custom data. Eg:
|
310 |
-
* array(
|
311 |
-
* 'user' => array(
|
312 |
-
* 'name' => 'James',
|
313 |
-
* 'email' => 'james@example.com'
|
314 |
-
* )
|
315 |
-
* )
|
316 |
-
* @param bool $merge optionally merge the meta data
|
317 |
-
*
|
318 |
-
* @return $this
|
319 |
-
*/
|
320 |
-
public function setMetaData(array $metaData, $merge = false)
|
321 |
-
{
|
322 |
-
if ($merge) {
|
323 |
-
$this->config->metaData = array_merge_recursive((array) $this->config->metaData, $metaData);
|
324 |
-
} else {
|
325 |
-
$this->config->metaData = $metaData;
|
326 |
-
}
|
327 |
-
|
328 |
-
return $this;
|
329 |
-
}
|
330 |
-
|
331 |
-
/**
|
332 |
-
* Set proxy configuration.
|
333 |
-
*
|
334 |
-
* @param array $proxySettings an array with proxy settings. Eg:
|
335 |
-
* array(
|
336 |
-
* 'host' => 'bugsnag.com',
|
337 |
-
* 'port' => 42,
|
338 |
-
* 'user' => 'username'
|
339 |
-
* 'password' => 'password123'
|
340 |
-
* )
|
341 |
-
*
|
342 |
-
* @return $this
|
343 |
-
*/
|
344 |
-
public function setProxySettings(array $proxySettings)
|
345 |
-
{
|
346 |
-
$this->config->proxySettings = $proxySettings;
|
347 |
-
|
348 |
-
return $this;
|
349 |
-
}
|
350 |
-
|
351 |
-
/**
|
352 |
-
* Set custom curl options.
|
353 |
-
*
|
354 |
-
* @param array $curlOptions an array with curl options. Eg:
|
355 |
-
* array(
|
356 |
-
* CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
|
357 |
-
* )
|
358 |
-
*
|
359 |
-
* @return $this
|
360 |
-
*/
|
361 |
-
public function setCurlOptions(array $curlOptions)
|
362 |
-
{
|
363 |
-
$this->config->curlOptions = $curlOptions;
|
364 |
-
|
365 |
-
return $this;
|
366 |
-
}
|
367 |
-
|
368 |
-
/**
|
369 |
-
* Set a custom function to call before notifying Bugsnag of an error.
|
370 |
-
*
|
371 |
-
* You can use this to call your own error handling functions, or to add
|
372 |
-
* custom tabs of data to each error on your Bugsnag dashboard.
|
373 |
-
*
|
374 |
-
* // Adding meta-data example
|
375 |
-
* function before_bugsnag_notify($error) {
|
376 |
-
* $error->addMetaData(array(
|
377 |
-
* 'user' => array(
|
378 |
-
* 'name' => 'James'
|
379 |
-
* )
|
380 |
-
* ));
|
381 |
-
* }
|
382 |
-
* $bugsnag->setBeforeNotifyFunction('before_bugsnag_notify');
|
383 |
-
*
|
384 |
-
* @param callable $beforeNotifyFunction
|
385 |
-
*
|
386 |
-
* @return $this
|
387 |
-
*/
|
388 |
-
public function setBeforeNotifyFunction($beforeNotifyFunction)
|
389 |
-
{
|
390 |
-
$this->config->beforeNotifyFunction = $beforeNotifyFunction;
|
391 |
-
|
392 |
-
return $this;
|
393 |
-
}
|
394 |
-
|
395 |
-
/**
|
396 |
-
* Set Bugsnag's error reporting level.
|
397 |
-
*
|
398 |
-
* If this is not set, we'll use your current PHP error_reporting value
|
399 |
-
* from your ini file or error_reporting(...) calls.
|
400 |
-
*
|
401 |
-
* @param int $errorReportingLevel the error reporting level integer
|
402 |
-
* exactly as you would pass to PHP's error_reporting
|
403 |
-
*
|
404 |
-
* @return $this
|
405 |
-
*/
|
406 |
-
public function setErrorReportingLevel($errorReportingLevel)
|
407 |
-
{
|
408 |
-
$this->config->errorReportingLevel = $errorReportingLevel;
|
409 |
-
|
410 |
-
return $this;
|
411 |
-
}
|
412 |
-
|
413 |
-
/**
|
414 |
-
* Sets whether Bugsnag should be automatically notified of unhandled exceptions and errors.
|
415 |
-
*
|
416 |
-
* @param bool $autoNotify whether to auto notify or not
|
417 |
-
*
|
418 |
-
* @return $this
|
419 |
-
*/
|
420 |
-
public function setAutoNotify($autoNotify)
|
421 |
-
{
|
422 |
-
$this->config->autoNotify = $autoNotify;
|
423 |
-
|
424 |
-
return $this;
|
425 |
-
}
|
426 |
-
|
427 |
-
/**
|
428 |
-
* Sets whether errors should be batched together and send at the end of each request.
|
429 |
-
*
|
430 |
-
* @param bool $batchSending whether to batch together errors
|
431 |
-
*
|
432 |
-
* @return $this
|
433 |
-
*/
|
434 |
-
public function setBatchSending($batchSending)
|
435 |
-
{
|
436 |
-
$this->config->batchSending = $batchSending;
|
437 |
-
|
438 |
-
return $this;
|
439 |
-
}
|
440 |
-
|
441 |
-
/**
|
442 |
-
* Sets the notifier to report as to Bugsnag.
|
443 |
-
*
|
444 |
-
* This should only be set by other notifier libraries.
|
445 |
-
*
|
446 |
-
* @param array $notifier an array of name, version, url.
|
447 |
-
*
|
448 |
-
* @return $this
|
449 |
-
*/
|
450 |
-
public function setNotifier($notifier)
|
451 |
-
{
|
452 |
-
$this->config->notifier = $notifier;
|
453 |
-
|
454 |
-
return $this;
|
455 |
-
}
|
456 |
-
|
457 |
-
/**
|
458 |
-
* Sets whether Bugsnag should send $_ENV with each error.
|
459 |
-
*
|
460 |
-
* @param bool $sendEnvironment whether to send the environment
|
461 |
-
*
|
462 |
-
* @return $this
|
463 |
-
*/
|
464 |
-
public function setSendEnvironment($sendEnvironment)
|
465 |
-
{
|
466 |
-
$this->config->sendEnvironment = $sendEnvironment;
|
467 |
-
|
468 |
-
return $this;
|
469 |
-
}
|
470 |
-
|
471 |
-
/**
|
472 |
-
* Sets whether Bugsnag should send $_COOKIE with each error.
|
473 |
-
*
|
474 |
-
* @param bool $sendCookies whether to send the environment
|
475 |
-
*
|
476 |
-
* @return $this
|
477 |
-
*/
|
478 |
-
public function setSendCookies($sendCookies)
|
479 |
-
{
|
480 |
-
$this->config->sendCookies = $sendCookies;
|
481 |
-
|
482 |
-
return $this;
|
483 |
-
}
|
484 |
-
|
485 |
-
/**
|
486 |
-
* Sets whether Bugsnag should send $_SESSION with each error.
|
487 |
-
*
|
488 |
-
* @param bool $sendSession whether to send the environment
|
489 |
-
*
|
490 |
-
* @return $this
|
491 |
-
*/
|
492 |
-
public function setSendSession($sendSession)
|
493 |
-
{
|
494 |
-
$this->config->sendSession = $sendSession;
|
495 |
-
|
496 |
-
return $this;
|
497 |
-
}
|
498 |
-
|
499 |
-
/**
|
500 |
-
* Should we send a small snippet of the code that crashed.
|
501 |
-
*
|
502 |
-
* This can help you diagnose even faster from within your dashboard.
|
503 |
-
*
|
504 |
-
* @param bool $sendCode whether to send code to Bugsnag
|
505 |
-
*
|
506 |
-
* @return $this
|
507 |
-
*/
|
508 |
-
public function setSendCode($sendCode)
|
509 |
-
{
|
510 |
-
$this->config->sendCode = $sendCode;
|
511 |
-
|
512 |
-
return $this;
|
513 |
-
}
|
514 |
-
|
515 |
-
/**
|
516 |
-
* Notify Bugsnag of a non-fatal/handled throwable.
|
517 |
-
*
|
518 |
-
* @param Throwable $throwable the throwable to notify Bugsnag about
|
519 |
-
* @param array $metaData optional metaData to send with this error
|
520 |
-
* @param string $severity optional severity of this error (fatal/error/warning/info)
|
521 |
-
*
|
522 |
-
* @return void
|
523 |
-
*/
|
524 |
-
public function notifyException($throwable, array $metaData = null, $severity = null)
|
525 |
-
{
|
526 |
-
if (is_subclass_of($throwable, 'Throwable') || is_subclass_of($throwable, 'Exception') || get_class($throwable) == 'Exception') {
|
527 |
-
$error = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $throwable);
|
528 |
-
$error->setSeverity($severity);
|
529 |
-
|
530 |
-
$this->notify($error, $metaData);
|
531 |
-
}
|
532 |
-
}
|
533 |
-
|
534 |
-
/**
|
535 |
-
* Notify Bugsnag of a non-fatal/handled error.
|
536 |
-
*
|
537 |
-
* @param string $name the name of the error, a short (1 word) string
|
538 |
-
* @param string $message the error message
|
539 |
-
* @param array $metaData optional metaData to send with this error
|
540 |
-
* @param string $severity optional severity of this error (fatal/error/warning/info)
|
541 |
-
*
|
542 |
-
* @return void
|
543 |
-
*/
|
544 |
-
public function notifyError($name, $message, array $metaData = null, $severity = null)
|
545 |
-
{
|
546 |
-
$error = Bugsnag_Error::fromNamedError($this->config, $this->diagnostics, $name, $message);
|
547 |
-
$error->setSeverity($severity);
|
548 |
-
|
549 |
-
$this->notify($error, $metaData);
|
550 |
-
}
|
551 |
-
|
552 |
-
/**
|
553 |
-
* Exception handler callback.
|
554 |
-
*
|
555 |
-
* Should only be called internally by PHP's set_exception_handler.
|
556 |
-
*
|
557 |
-
* @param Throwable $throwable the exception was was thrown
|
558 |
-
*
|
559 |
-
* @return void
|
560 |
-
*/
|
561 |
-
public function exceptionHandler($throwable)
|
562 |
-
{
|
563 |
-
if (!$this->config->autoNotify) {
|
564 |
-
return;
|
565 |
-
}
|
566 |
-
|
567 |
-
$error = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $throwable);
|
568 |
-
$error->setSeverity('error');
|
569 |
-
$this->notify($error);
|
570 |
-
}
|
571 |
-
|
572 |
-
/**
|
573 |
-
* Error handler callback.
|
574 |
-
*
|
575 |
-
* Should only be called internally by PHP's set_error_handler.
|
576 |
-
*
|
577 |
-
* @param int $errno the level of the error raised
|
578 |
-
* @param string $errstr the error message
|
579 |
-
* @param string $errfile the filename that the error was raised in
|
580 |
-
* @param int $errline the line number the error was raised at
|
581 |
-
*
|
582 |
-
* @return void
|
583 |
-
*/
|
584 |
-
public function errorHandler($errno, $errstr, $errfile = '', $errline = 0)
|
585 |
-
{
|
586 |
-
if (!$this->config->autoNotify || $this->config->shouldIgnoreErrorCode($errno)) {
|
587 |
-
return;
|
588 |
-
}
|
589 |
-
|
590 |
-
$error = Bugsnag_Error::fromPHPError($this->config, $this->diagnostics, $errno, $errstr, $errfile, $errline);
|
591 |
-
$this->notify($error);
|
592 |
-
}
|
593 |
-
|
594 |
-
/**
|
595 |
-
* Shutdown handler callback.
|
596 |
-
*
|
597 |
-
* Called when the PHP process has finished running. Should only be called
|
598 |
-
* internally by PHP's register_shutdown_function.
|
599 |
-
*
|
600 |
-
* @return void
|
601 |
-
*/
|
602 |
-
public function shutdownHandler()
|
603 |
-
{
|
604 |
-
// Get last error
|
605 |
-
$lastError = error_get_last();
|
606 |
-
|
607 |
-
// Check if a fatal error caused this shutdown
|
608 |
-
if (!is_null($lastError) && Bugsnag_ErrorTypes::isFatal($lastError['type']) && $this->config->autoNotify && !$this->config->shouldIgnoreErrorCode($lastError['type'])) {
|
609 |
-
$error = Bugsnag_Error::fromPHPError($this->config, $this->diagnostics, $lastError['type'], $lastError['message'], $lastError['file'], $lastError['line'], true);
|
610 |
-
$error->setSeverity('error');
|
611 |
-
$this->notify($error);
|
612 |
-
}
|
613 |
-
|
614 |
-
// Flush any buffered errors
|
615 |
-
if ($this->notification) {
|
616 |
-
$this->notification->deliver();
|
617 |
-
$this->notification = null;
|
618 |
-
}
|
619 |
-
}
|
620 |
-
|
621 |
-
/**
|
622 |
-
* Batches up errors into notifications for later sending.
|
623 |
-
*
|
624 |
-
* @param Bugsnag_Error $error the error to batch up
|
625 |
-
* @param array $metaData optional meta data to send with the error
|
626 |
-
*
|
627 |
-
* @return void
|
628 |
-
*/
|
629 |
-
public function notify(Bugsnag_Error $error, $metaData = array())
|
630 |
-
{
|
631 |
-
// Queue or send the error
|
632 |
-
if ($this->sendErrorsOnShutdown()) {
|
633 |
-
// Create a batch notification unless we already have one
|
634 |
-
if (is_null($this->notification)) {
|
635 |
-
$this->notification = new Bugsnag_Notification($this->config);
|
636 |
-
}
|
637 |
-
|
638 |
-
// Add this error to the notification
|
639 |
-
$this->notification->addError($error, $metaData);
|
640 |
-
} else {
|
641 |
-
// Create and deliver notification immediately
|
642 |
-
$notif = new Bugsnag_Notification($this->config);
|
643 |
-
$notif->addError($error, $metaData);
|
644 |
-
$notif->deliver();
|
645 |
-
}
|
646 |
-
}
|
647 |
-
|
648 |
-
/**
|
649 |
-
* Should we send errors immediately, or on shutdown?
|
650 |
-
*
|
651 |
-
* @return bool
|
652 |
-
*/
|
653 |
-
private function sendErrorsOnShutdown()
|
654 |
-
{
|
655 |
-
return $this->config->batchSending && Bugsnag_Request::isRequest();
|
656 |
-
}
|
657 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Configuration.php
DELETED
@@ -1,145 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Configuration
|
4 |
-
{
|
5 |
-
public static $DEFAULT_TIMEOUT = 10;
|
6 |
-
public static $DEFAULT_ENDPOINT = 'https://notify.bugsnag.com';
|
7 |
-
public static $DEFAULT_NON_SSL_ENDPOINT = 'http://notify.bugsnag.com';
|
8 |
-
|
9 |
-
public $apiKey;
|
10 |
-
public $autoNotify = true;
|
11 |
-
public $batchSending = true;
|
12 |
-
public $useSSL = true;
|
13 |
-
public $endpoint;
|
14 |
-
public $notifyReleaseStages;
|
15 |
-
public $filters = array('password');
|
16 |
-
public $projectRoot;
|
17 |
-
public $projectRootRegex;
|
18 |
-
public $proxySettings = array();
|
19 |
-
public $notifier = array(
|
20 |
-
'name' => 'Bugsnag PHP (Official)',
|
21 |
-
'version' => '2.9.2',
|
22 |
-
'url' => 'https://bugsnag.com',
|
23 |
-
);
|
24 |
-
public $sendEnvironment = false;
|
25 |
-
public $sendCookies = true;
|
26 |
-
public $sendSession = true;
|
27 |
-
public $sendCode = true;
|
28 |
-
public $stripPath;
|
29 |
-
public $stripPathRegex;
|
30 |
-
|
31 |
-
public $context;
|
32 |
-
public $type;
|
33 |
-
public $user;
|
34 |
-
public $releaseStage = 'production';
|
35 |
-
public $appVersion;
|
36 |
-
public $hostname;
|
37 |
-
|
38 |
-
public $metaData;
|
39 |
-
public $beforeNotifyFunction;
|
40 |
-
public $errorReportingLevel;
|
41 |
-
|
42 |
-
public $curlOptions = array();
|
43 |
-
|
44 |
-
public $debug = false;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Create a new config instance.
|
48 |
-
*
|
49 |
-
* @return void
|
50 |
-
*/
|
51 |
-
public function __construct()
|
52 |
-
{
|
53 |
-
$this->timeout = self::$DEFAULT_TIMEOUT;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Get the notify endpoint.
|
58 |
-
*
|
59 |
-
* @return string
|
60 |
-
*/
|
61 |
-
public function getNotifyEndpoint()
|
62 |
-
{
|
63 |
-
if (is_null($this->endpoint)) {
|
64 |
-
return $this->useSSL ? self::$DEFAULT_ENDPOINT : self::$DEFAULT_NON_SSL_ENDPOINT;
|
65 |
-
} elseif (preg_match('/^(http:\/\/|https:\/\/)/', $this->endpoint)) {
|
66 |
-
return $this->endpoint;
|
67 |
-
} else {
|
68 |
-
return ($this->useSSL ? 'https' : 'http').'://'.$this->endpoint;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Should we notify?
|
74 |
-
*
|
75 |
-
* @return bool
|
76 |
-
*/
|
77 |
-
public function shouldNotify()
|
78 |
-
{
|
79 |
-
return is_null($this->notifyReleaseStages) || (is_array($this->notifyReleaseStages) && in_array($this->releaseStage, $this->notifyReleaseStages));
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Should we ignore the given error code?
|
84 |
-
*
|
85 |
-
* @param int $code the error code
|
86 |
-
*
|
87 |
-
* @return bool
|
88 |
-
*/
|
89 |
-
public function shouldIgnoreErrorCode($code)
|
90 |
-
{
|
91 |
-
if (isset($this->errorReportingLevel)) {
|
92 |
-
return !($this->errorReportingLevel & $code);
|
93 |
-
} else {
|
94 |
-
return !(error_reporting() & $code);
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Set the project root.
|
100 |
-
*
|
101 |
-
* @param string $projectRoot the project root path
|
102 |
-
*
|
103 |
-
* @return void
|
104 |
-
*/
|
105 |
-
public function setProjectRoot($projectRoot)
|
106 |
-
{
|
107 |
-
$this->projectRoot = $projectRoot;
|
108 |
-
$this->projectRootRegex = '/'.preg_quote($projectRoot, '/').'[\\/]?/i';
|
109 |
-
if (is_null($this->stripPath)) {
|
110 |
-
$this->setStripPath($projectRoot);
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Set the strip path.
|
116 |
-
*
|
117 |
-
* @param string $stripPath the absolute strip path
|
118 |
-
*
|
119 |
-
* @return void
|
120 |
-
*/
|
121 |
-
public function setStripPath($stripPath)
|
122 |
-
{
|
123 |
-
$this->stripPath = $stripPath;
|
124 |
-
$this->stripPathRegex = '/'.preg_quote($stripPath, '/').'[\\/]?/i';
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Get the given configuration.
|
129 |
-
*
|
130 |
-
* @param string $prop the property to get
|
131 |
-
* @param mixed $default the value to fallback to
|
132 |
-
*
|
133 |
-
* @return mixed
|
134 |
-
*/
|
135 |
-
public function get($prop, $default = null)
|
136 |
-
{
|
137 |
-
$configured = $this->$prop;
|
138 |
-
|
139 |
-
if (is_array($configured) && is_array($default)) {
|
140 |
-
return array_merge($default, $configured);
|
141 |
-
} else {
|
142 |
-
return $configured ? $configured : $default;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Diagnostics.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Diagnostics
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* The config instance.
|
7 |
-
*
|
8 |
-
* @var Bugsnag_Configuration
|
9 |
-
*/
|
10 |
-
private $config;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Create a new diagnostics instance.
|
14 |
-
*
|
15 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
16 |
-
*
|
17 |
-
* @return void
|
18 |
-
*/
|
19 |
-
public function __construct(Bugsnag_Configuration $config)
|
20 |
-
{
|
21 |
-
$this->config = $config;
|
22 |
-
}
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Get the application information.
|
26 |
-
*
|
27 |
-
* @return array
|
28 |
-
*/
|
29 |
-
public function getAppData()
|
30 |
-
{
|
31 |
-
$appData = array();
|
32 |
-
|
33 |
-
if (!is_null($this->config->appVersion)) {
|
34 |
-
$appData['version'] = $this->config->appVersion;
|
35 |
-
}
|
36 |
-
|
37 |
-
if (!is_null($this->config->releaseStage)) {
|
38 |
-
$appData['releaseStage'] = $this->config->releaseStage;
|
39 |
-
}
|
40 |
-
|
41 |
-
if (!is_null($this->config->type)) {
|
42 |
-
$appData['type'] = $this->config->type;
|
43 |
-
}
|
44 |
-
|
45 |
-
return $appData;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Get the device information.
|
50 |
-
*
|
51 |
-
* @return array
|
52 |
-
*/
|
53 |
-
public function getDeviceData()
|
54 |
-
{
|
55 |
-
return array(
|
56 |
-
'hostname' => $this->config->get('hostname', php_uname('n')),
|
57 |
-
);
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Get the error context.
|
62 |
-
*
|
63 |
-
* @return array
|
64 |
-
*/
|
65 |
-
public function getContext()
|
66 |
-
{
|
67 |
-
return $this->config->get('context', Bugsnag_Request::getContext());
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Get the current user.
|
72 |
-
*
|
73 |
-
* @return array
|
74 |
-
*/
|
75 |
-
public function getUser()
|
76 |
-
{
|
77 |
-
$defaultUser = array();
|
78 |
-
$userId = Bugsnag_Request::getUserId();
|
79 |
-
|
80 |
-
if (!is_null($userId)) {
|
81 |
-
$defaultUser['id'] = $userId;
|
82 |
-
}
|
83 |
-
|
84 |
-
return $this->config->get('user', $defaultUser);
|
85 |
-
}
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Error.php
DELETED
@@ -1,415 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Error
|
4 |
-
{
|
5 |
-
private static $VALID_SEVERITIES = array(
|
6 |
-
'error',
|
7 |
-
'warning',
|
8 |
-
'info',
|
9 |
-
);
|
10 |
-
|
11 |
-
public $name;
|
12 |
-
public $payloadVersion = '2';
|
13 |
-
public $message;
|
14 |
-
public $severity = 'warning';
|
15 |
-
/** @var Bugsnag_Stacktrace */
|
16 |
-
public $stacktrace;
|
17 |
-
public $metaData = array();
|
18 |
-
public $user;
|
19 |
-
public $config;
|
20 |
-
public $diagnostics;
|
21 |
-
/** @var Bugsnag_Error|null */
|
22 |
-
public $previous;
|
23 |
-
public $groupingHash;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Create a new error from a PHP error.
|
27 |
-
*
|
28 |
-
* @param Bugsnag_Configuration $config the config instance
|
29 |
-
* @param Bugsnag_Diagnostics $diagnostics the diagnostics instance
|
30 |
-
* @param int $code the error code
|
31 |
-
* @param string $message the error message
|
32 |
-
* @param string $file the error file
|
33 |
-
* @param int $line the error line
|
34 |
-
* @param bool $fatal if the error was fatal
|
35 |
-
*
|
36 |
-
* @return self
|
37 |
-
*/
|
38 |
-
public static function fromPHPError(Bugsnag_Configuration $config, Bugsnag_Diagnostics $diagnostics, $code, $message, $file, $line, $fatal = false)
|
39 |
-
{
|
40 |
-
$error = new self($config, $diagnostics);
|
41 |
-
$error->setPHPError($code, $message, $file, $line, $fatal);
|
42 |
-
|
43 |
-
return $error;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Create a new error from a PHP throwable.
|
48 |
-
*
|
49 |
-
* @param Bugsnag_Configuration $config the config instance
|
50 |
-
* @param Bugsnag_Diagnostics $diagnostics the diagnostics instance
|
51 |
-
* @param Throwable $throwable te he throwable instance
|
52 |
-
*
|
53 |
-
* @return self
|
54 |
-
*/
|
55 |
-
public static function fromPHPThrowable(Bugsnag_Configuration $config, Bugsnag_Diagnostics $diagnostics, $throwable)
|
56 |
-
{
|
57 |
-
$error = new self($config, $diagnostics);
|
58 |
-
$error->setPHPThrowable($throwable);
|
59 |
-
|
60 |
-
return $error;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Create a new error from a named error.
|
65 |
-
*
|
66 |
-
* @param Bugsnag_Configuration $config the config instance
|
67 |
-
* @param Bugsnag_Diagnostics $diagnostics the diagnostics instance
|
68 |
-
* @param string $name the error name
|
69 |
-
* @param string|null $message the error message
|
70 |
-
*
|
71 |
-
* @return self
|
72 |
-
*/
|
73 |
-
public static function fromNamedError(Bugsnag_Configuration $config, Bugsnag_Diagnostics $diagnostics, $name, $message = null)
|
74 |
-
{
|
75 |
-
$error = new self($config, $diagnostics);
|
76 |
-
$error->setName($name)
|
77 |
-
->setMessage($message)
|
78 |
-
->setStacktrace(Bugsnag_Stacktrace::generate($config));
|
79 |
-
|
80 |
-
return $error;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Create a new error instance.
|
85 |
-
*
|
86 |
-
* This is only for for use only by the static methods above.
|
87 |
-
*
|
88 |
-
* @param Bugsnag_Configuration $config the config instance
|
89 |
-
* @param Bugsnag_Diagnostics $diagnostics the diagnostics instance
|
90 |
-
*
|
91 |
-
* @return void
|
92 |
-
*/
|
93 |
-
private function __construct(Bugsnag_Configuration $config, Bugsnag_Diagnostics $diagnostics)
|
94 |
-
{
|
95 |
-
$this->config = $config;
|
96 |
-
$this->diagnostics = $diagnostics;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Set the error name.
|
101 |
-
*
|
102 |
-
* @param string $name the error name
|
103 |
-
*
|
104 |
-
* @throws InvalidArgumentException
|
105 |
-
*
|
106 |
-
* @return $this
|
107 |
-
*/
|
108 |
-
public function setName($name)
|
109 |
-
{
|
110 |
-
if (is_scalar($name) || method_exists($name, '__toString')) {
|
111 |
-
$this->name = (string) $name;
|
112 |
-
} else {
|
113 |
-
throw new InvalidArgumentException('Name must be a string.');
|
114 |
-
}
|
115 |
-
|
116 |
-
return $this;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Set the error message.
|
121 |
-
*
|
122 |
-
* @param string|null $message the error message
|
123 |
-
*
|
124 |
-
* @throws InvalidArgumentException
|
125 |
-
*
|
126 |
-
* @return $this
|
127 |
-
*/
|
128 |
-
public function setMessage($message)
|
129 |
-
{
|
130 |
-
if ($message === null) {
|
131 |
-
$this->message = null;
|
132 |
-
} elseif (is_scalar($message) || method_exists($message, '__toString')) {
|
133 |
-
$this->message = (string) $message;
|
134 |
-
} else {
|
135 |
-
throw new InvalidArgumentException('Message must be a string.');
|
136 |
-
}
|
137 |
-
|
138 |
-
return $this;
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Set the grouping hash.
|
143 |
-
*
|
144 |
-
* @param string $groupingHash the grouping hash
|
145 |
-
*
|
146 |
-
* @return $this
|
147 |
-
*/
|
148 |
-
public function setGroupingHash($groupingHash)
|
149 |
-
{
|
150 |
-
$this->groupingHash = $groupingHash;
|
151 |
-
|
152 |
-
return $this;
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Set the bugsnag stacktrace.
|
157 |
-
*
|
158 |
-
* @param Bugsnag_Stacktrace $stacktrace the stacktrace instance
|
159 |
-
*
|
160 |
-
* @return $this
|
161 |
-
*/
|
162 |
-
public function setStacktrace(Bugsnag_Stacktrace $stacktrace)
|
163 |
-
{
|
164 |
-
$this->stacktrace = $stacktrace;
|
165 |
-
|
166 |
-
return $this;
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Set the error severity.
|
171 |
-
*
|
172 |
-
* @param int|null $severity the error severity
|
173 |
-
*
|
174 |
-
* @return $this
|
175 |
-
*/
|
176 |
-
public function setSeverity($severity)
|
177 |
-
{
|
178 |
-
if (!is_null($severity)) {
|
179 |
-
if (in_array($severity, self::$VALID_SEVERITIES)) {
|
180 |
-
$this->severity = $severity;
|
181 |
-
} else {
|
182 |
-
error_log('Bugsnag Warning: Tried to set error severity to '.$severity.' which is not allowed.');
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
return $this;
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Set the PHP exception.
|
191 |
-
*
|
192 |
-
* @param Throwable $exception the throwable instance
|
193 |
-
*
|
194 |
-
* @return $this
|
195 |
-
*
|
196 |
-
* @deprecated since version 2.9. Use setPHPThrowable instead.
|
197 |
-
*/
|
198 |
-
public function setPHPException($exception)
|
199 |
-
{
|
200 |
-
return $this->setPHPThrowable($exception);
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Set the PHP throwable.
|
205 |
-
*
|
206 |
-
* @param Throwable $exception the throwable instance
|
207 |
-
*
|
208 |
-
* @return $this
|
209 |
-
*/
|
210 |
-
public function setPHPThrowable($exception)
|
211 |
-
{
|
212 |
-
if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
|
213 |
-
if (!$exception instanceof Throwable) {
|
214 |
-
error_log('Bugsnag Warning: The exception must implement Throwable.');
|
215 |
-
|
216 |
-
return $this;
|
217 |
-
}
|
218 |
-
} else {
|
219 |
-
if (!$exception instanceof Exception) {
|
220 |
-
error_log('Bugsnag Warning: The exception must be an Exception.');
|
221 |
-
|
222 |
-
return $this;
|
223 |
-
}
|
224 |
-
}
|
225 |
-
|
226 |
-
$this->setName(get_class($exception))
|
227 |
-
->setMessage($exception->getMessage())
|
228 |
-
->setStacktrace(Bugsnag_Stacktrace::fromBacktrace($this->config, $exception->getTrace(), $exception->getFile(), $exception->getLine()));
|
229 |
-
|
230 |
-
if (method_exists($exception, 'getPrevious')) {
|
231 |
-
$this->setPrevious($exception->getPrevious());
|
232 |
-
}
|
233 |
-
|
234 |
-
return $this;
|
235 |
-
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Set the PHP error.
|
239 |
-
*
|
240 |
-
* @param int $code the error code
|
241 |
-
* @param string $message the error message
|
242 |
-
* @param string $file the error file
|
243 |
-
* @param int $line the error line
|
244 |
-
* @param bool $fatal if the error was fatal
|
245 |
-
*
|
246 |
-
* @return $this
|
247 |
-
*/
|
248 |
-
public function setPHPError($code, $message, $file, $line, $fatal = false)
|
249 |
-
{
|
250 |
-
if ($fatal) {
|
251 |
-
// Generating stacktrace for PHP fatal errors is not possible,
|
252 |
-
// since this code executes when the PHP process shuts down,
|
253 |
-
// rather than at the time of the crash.
|
254 |
-
//
|
255 |
-
// In these situations, we generate a "stacktrace" containing only
|
256 |
-
// the line and file number where the crash occurred.
|
257 |
-
$stacktrace = Bugsnag_Stacktrace::fromFrame($this->config, $file, $line);
|
258 |
-
} else {
|
259 |
-
$stacktrace = Bugsnag_Stacktrace::generate($this->config);
|
260 |
-
}
|
261 |
-
|
262 |
-
$this->setName(Bugsnag_ErrorTypes::getName($code))
|
263 |
-
->setMessage($message)
|
264 |
-
->setSeverity(Bugsnag_ErrorTypes::getSeverity($code))
|
265 |
-
->setStacktrace($stacktrace);
|
266 |
-
|
267 |
-
return $this;
|
268 |
-
}
|
269 |
-
|
270 |
-
/**
|
271 |
-
* Set the error meta data.
|
272 |
-
*
|
273 |
-
* @param array $metaData the error meta data
|
274 |
-
*
|
275 |
-
* @return $this
|
276 |
-
*/
|
277 |
-
public function setMetaData($metaData)
|
278 |
-
{
|
279 |
-
if (is_array($metaData)) {
|
280 |
-
$this->metaData = array_merge_recursive($this->metaData, $metaData);
|
281 |
-
}
|
282 |
-
|
283 |
-
return $this;
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Set the current user.
|
288 |
-
*
|
289 |
-
* @param array|null $user the current user
|
290 |
-
*
|
291 |
-
* @return $this
|
292 |
-
*/
|
293 |
-
public function setUser($user)
|
294 |
-
{
|
295 |
-
$this->user = $user;
|
296 |
-
|
297 |
-
return $this;
|
298 |
-
}
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Set the previous throwable.
|
302 |
-
*
|
303 |
-
* @param Throwable $exception the previous throwable
|
304 |
-
*
|
305 |
-
* @return $this
|
306 |
-
*/
|
307 |
-
public function setPrevious($exception)
|
308 |
-
{
|
309 |
-
if ($exception) {
|
310 |
-
$this->previous = self::fromPHPThrowable($this->config, $this->diagnostics, $exception);
|
311 |
-
}
|
312 |
-
|
313 |
-
return $this;
|
314 |
-
}
|
315 |
-
|
316 |
-
/**
|
317 |
-
* Get the array representation.
|
318 |
-
*
|
319 |
-
* @return array
|
320 |
-
*/
|
321 |
-
public function toArray()
|
322 |
-
{
|
323 |
-
$errorArray = array(
|
324 |
-
'app' => $this->diagnostics->getAppData(),
|
325 |
-
'device' => $this->diagnostics->getDeviceData(),
|
326 |
-
'user' => is_null($this->user) ? $this->diagnostics->getUser() : $this->user,
|
327 |
-
'context' => $this->diagnostics->getContext(),
|
328 |
-
'payloadVersion' => $this->payloadVersion,
|
329 |
-
'severity' => $this->severity,
|
330 |
-
'exceptions' => $this->exceptionArray(),
|
331 |
-
'metaData' => $this->cleanupObj($this->metaData, true),
|
332 |
-
);
|
333 |
-
|
334 |
-
if (isset($this->groupingHash)) {
|
335 |
-
$errorArray['groupingHash'] = $this->groupingHash;
|
336 |
-
}
|
337 |
-
|
338 |
-
return $errorArray;
|
339 |
-
}
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Get the exception array.
|
343 |
-
*
|
344 |
-
* @return array
|
345 |
-
*/
|
346 |
-
public function exceptionArray()
|
347 |
-
{
|
348 |
-
if ($this->previous) {
|
349 |
-
$exceptionArray = $this->previous->exceptionArray();
|
350 |
-
} else {
|
351 |
-
$exceptionArray = array();
|
352 |
-
}
|
353 |
-
|
354 |
-
$exceptionArray[] = array(
|
355 |
-
'errorClass' => $this->name,
|
356 |
-
'message' => $this->message,
|
357 |
-
'stacktrace' => $this->stacktrace->toArray(),
|
358 |
-
);
|
359 |
-
|
360 |
-
return $this->cleanupObj($exceptionArray, false);
|
361 |
-
}
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Cleanup the given object.
|
365 |
-
*
|
366 |
-
* @param mixed $obj the data to cleanup
|
367 |
-
* @param bool $isMetaData if it is meta data
|
368 |
-
*
|
369 |
-
* @return array|null
|
370 |
-
*/
|
371 |
-
private function cleanupObj($obj, $isMetaData)
|
372 |
-
{
|
373 |
-
if (is_null($obj)) {
|
374 |
-
return;
|
375 |
-
}
|
376 |
-
|
377 |
-
if (is_array($obj)) {
|
378 |
-
$cleanArray = array();
|
379 |
-
foreach ($obj as $key => $value) {
|
380 |
-
// Check if this key should be filtered
|
381 |
-
$shouldFilter = false;
|
382 |
-
|
383 |
-
// Apply filters to metadata if required
|
384 |
-
if ($isMetaData && is_array($this->config->filters)) {
|
385 |
-
foreach ($this->config->filters as $filter) {
|
386 |
-
if (strpos($key, $filter) !== false) {
|
387 |
-
$shouldFilter = true;
|
388 |
-
break;
|
389 |
-
}
|
390 |
-
}
|
391 |
-
}
|
392 |
-
// Apply filter
|
393 |
-
if ($shouldFilter) {
|
394 |
-
$cleanArray[$key] = '[FILTERED]';
|
395 |
-
} else {
|
396 |
-
$cleanArray[$key] = $this->cleanupObj($value, $isMetaData);
|
397 |
-
}
|
398 |
-
}
|
399 |
-
|
400 |
-
return $cleanArray;
|
401 |
-
} elseif (is_string($obj)) {
|
402 |
-
// UTF8-encode if not already encoded
|
403 |
-
if (function_exists('mb_detect_encoding') && !mb_detect_encoding($obj, 'UTF-8', true)) {
|
404 |
-
return utf8_encode($obj);
|
405 |
-
} else {
|
406 |
-
return $obj;
|
407 |
-
}
|
408 |
-
} elseif (is_object($obj)) {
|
409 |
-
// json_encode -> json_decode trick turns an object into an array
|
410 |
-
return $this->cleanupObj(json_decode(json_encode($obj), true), $isMetaData);
|
411 |
-
} else {
|
412 |
-
return $obj;
|
413 |
-
}
|
414 |
-
}
|
415 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/ErrorTypes.php
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_ErrorTypes
|
4 |
-
{
|
5 |
-
private static $ERROR_TYPES = array(
|
6 |
-
E_ERROR => array(
|
7 |
-
'name' => 'PHP Fatal Error',
|
8 |
-
'severity' => 'error',
|
9 |
-
),
|
10 |
-
|
11 |
-
E_WARNING => array(
|
12 |
-
'name' => 'PHP Warning',
|
13 |
-
'severity' => 'warning',
|
14 |
-
),
|
15 |
-
|
16 |
-
E_PARSE => array(
|
17 |
-
'name' => 'PHP Parse Error',
|
18 |
-
'severity' => 'error',
|
19 |
-
),
|
20 |
-
|
21 |
-
E_NOTICE => array(
|
22 |
-
'name' => 'PHP Notice',
|
23 |
-
'severity' => 'info',
|
24 |
-
),
|
25 |
-
|
26 |
-
E_CORE_ERROR => array(
|
27 |
-
'name' => 'PHP Core Error',
|
28 |
-
'severity' => 'error',
|
29 |
-
),
|
30 |
-
|
31 |
-
E_CORE_WARNING => array(
|
32 |
-
'name' => 'PHP Core Warning',
|
33 |
-
'severity' => 'warning',
|
34 |
-
),
|
35 |
-
|
36 |
-
E_COMPILE_ERROR => array(
|
37 |
-
'name' => 'PHP Compile Error',
|
38 |
-
'severity' => 'error',
|
39 |
-
),
|
40 |
-
|
41 |
-
E_COMPILE_WARNING => array(
|
42 |
-
'name' => 'PHP Compile Warning',
|
43 |
-
'severity' => 'warning',
|
44 |
-
),
|
45 |
-
|
46 |
-
E_USER_ERROR => array(
|
47 |
-
'name' => 'User Error',
|
48 |
-
'severity' => 'error',
|
49 |
-
),
|
50 |
-
|
51 |
-
E_USER_WARNING => array(
|
52 |
-
'name' => 'User Warning',
|
53 |
-
'severity' => 'warning',
|
54 |
-
),
|
55 |
-
|
56 |
-
E_USER_NOTICE => array(
|
57 |
-
'name' => 'User Notice',
|
58 |
-
'severity' => 'info',
|
59 |
-
),
|
60 |
-
|
61 |
-
E_STRICT => array(
|
62 |
-
'name' => 'PHP Strict',
|
63 |
-
'severity' => 'info',
|
64 |
-
),
|
65 |
-
|
66 |
-
E_RECOVERABLE_ERROR => array(
|
67 |
-
'name' => 'PHP Recoverable Error',
|
68 |
-
'severity' => 'error',
|
69 |
-
),
|
70 |
-
|
71 |
-
// E_DEPRECATED (Since PHP 5.3.0)
|
72 |
-
8192 => array(
|
73 |
-
'name' => 'PHP Deprecated',
|
74 |
-
'severity' => 'info',
|
75 |
-
),
|
76 |
-
|
77 |
-
// E_USER_DEPRECATED (Since PHP 5.3.0)
|
78 |
-
16384 => array(
|
79 |
-
'name' => 'User Deprecated',
|
80 |
-
'severity' => 'info',
|
81 |
-
),
|
82 |
-
);
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Is the given error code fatal?
|
86 |
-
*
|
87 |
-
* @param int $code the error code
|
88 |
-
*
|
89 |
-
* @return bool
|
90 |
-
*/
|
91 |
-
public static function isFatal($code)
|
92 |
-
{
|
93 |
-
return self::getSeverity($code) == 'error';
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Get the name of the given error code.
|
98 |
-
*
|
99 |
-
* @param int $code the error code
|
100 |
-
*
|
101 |
-
* @return string
|
102 |
-
*/
|
103 |
-
public static function getName($code)
|
104 |
-
{
|
105 |
-
if (array_key_exists($code, self::$ERROR_TYPES)) {
|
106 |
-
return self::$ERROR_TYPES[$code]['name'];
|
107 |
-
} else {
|
108 |
-
return 'Unknown';
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Get the severity of the given error code.
|
114 |
-
*
|
115 |
-
* @param int $code the error code
|
116 |
-
*
|
117 |
-
* @return string
|
118 |
-
*/
|
119 |
-
public static function getSeverity($code)
|
120 |
-
{
|
121 |
-
if (array_key_exists($code, self::$ERROR_TYPES)) {
|
122 |
-
return self::$ERROR_TYPES[$code]['severity'];
|
123 |
-
} else {
|
124 |
-
return 'error';
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Get the the levels for the given severity.
|
130 |
-
*
|
131 |
-
* @param string $severity the given severity
|
132 |
-
*
|
133 |
-
* @return int
|
134 |
-
*/
|
135 |
-
public static function getLevelsForSeverity($severity)
|
136 |
-
{
|
137 |
-
$levels = 0;
|
138 |
-
foreach (self::$ERROR_TYPES as $level => $info) {
|
139 |
-
if ($info['severity'] == $severity) {
|
140 |
-
$levels |= $level;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
return $levels;
|
145 |
-
}
|
146 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Notification.php
DELETED
@@ -1,321 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Notification
|
4 |
-
{
|
5 |
-
private static $CONTENT_TYPE_HEADER = 'Content-type: application/json';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* The config instance.
|
9 |
-
*
|
10 |
-
* @var Bugsnag_Configuration
|
11 |
-
*/
|
12 |
-
private $config;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* The queue of errors to send to Bugsnag.
|
16 |
-
*
|
17 |
-
* @var Bugsnag_Error[]
|
18 |
-
*/
|
19 |
-
private $errorQueue = array();
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Create a new notification instance.
|
23 |
-
*
|
24 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
25 |
-
*
|
26 |
-
* @return void
|
27 |
-
*/
|
28 |
-
public function __construct(Bugsnag_Configuration $config)
|
29 |
-
{
|
30 |
-
$this->config = $config;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Add an error to the queue.
|
35 |
-
*
|
36 |
-
* @param Bugsnag_Error $config the bugsnag error instance
|
37 |
-
* @param array $passedMetaData the associated meta data
|
38 |
-
*
|
39 |
-
* @return bool
|
40 |
-
*/
|
41 |
-
public function addError(Bugsnag_Error $error, $passedMetaData = array())
|
42 |
-
{
|
43 |
-
// Check if this error should be sent to Bugsnag
|
44 |
-
if (!$this->config->shouldNotify()) {
|
45 |
-
return false;
|
46 |
-
}
|
47 |
-
|
48 |
-
// Add global meta-data to error
|
49 |
-
$error->setMetaData($this->config->metaData);
|
50 |
-
|
51 |
-
// Add request meta-data to error
|
52 |
-
if (Bugsnag_Request::isRequest()) {
|
53 |
-
$error->setMetaData(Bugsnag_Request::getRequestMetaData());
|
54 |
-
}
|
55 |
-
|
56 |
-
// Session Tab
|
57 |
-
if ($this->config->sendSession && !empty($_SESSION)) {
|
58 |
-
$error->setMetaData(array('session' => $_SESSION));
|
59 |
-
}
|
60 |
-
|
61 |
-
// Cookies Tab
|
62 |
-
if ($this->config->sendCookies && !empty($_COOKIE)) {
|
63 |
-
$error->setMetaData(array('cookies' => $_COOKIE));
|
64 |
-
}
|
65 |
-
|
66 |
-
// Add environment meta-data to error
|
67 |
-
if ($this->config->sendEnvironment && !empty($_ENV)) {
|
68 |
-
$error->setMetaData(array('Environment' => $_ENV));
|
69 |
-
}
|
70 |
-
|
71 |
-
// Add user-specified meta-data to error
|
72 |
-
$error->setMetaData($passedMetaData);
|
73 |
-
|
74 |
-
// Run beforeNotify function (can cause more meta-data to be merged)
|
75 |
-
if (isset($this->config->beforeNotifyFunction) && is_callable($this->config->beforeNotifyFunction)) {
|
76 |
-
$beforeNotifyReturn = call_user_func($this->config->beforeNotifyFunction, $error);
|
77 |
-
}
|
78 |
-
|
79 |
-
// Skip this error if the beforeNotify function returned FALSE
|
80 |
-
if (!isset($beforeNotifyReturn) || $beforeNotifyReturn !== false) {
|
81 |
-
$this->errorQueue[] = $error;
|
82 |
-
|
83 |
-
return true;
|
84 |
-
} else {
|
85 |
-
return false;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Get the array representation.
|
91 |
-
*
|
92 |
-
* @return array
|
93 |
-
*/
|
94 |
-
public function toArray()
|
95 |
-
{
|
96 |
-
$events = array();
|
97 |
-
foreach ($this->errorQueue as $error) {
|
98 |
-
$errorArray = $error->toArray();
|
99 |
-
|
100 |
-
if (!is_null($errorArray)) {
|
101 |
-
$events[] = $errorArray;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
return array(
|
106 |
-
'apiKey' => $this->config->apiKey,
|
107 |
-
'notifier' => $this->config->notifier,
|
108 |
-
'events' => $events,
|
109 |
-
);
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Deliver everything on the queue to Bugsnag.
|
114 |
-
*
|
115 |
-
* @return void
|
116 |
-
*/
|
117 |
-
public function deliver()
|
118 |
-
{
|
119 |
-
if (empty($this->errorQueue)) {
|
120 |
-
return;
|
121 |
-
}
|
122 |
-
|
123 |
-
// Post the request to bugsnag
|
124 |
-
$this->postJSON($this->config->getNotifyEndpoint(), $this->toArray());
|
125 |
-
|
126 |
-
// Clear the error queue
|
127 |
-
$this->errorQueue = array();
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Post the given data to Bugsnag in json form.
|
132 |
-
*
|
133 |
-
* @param string $url the url to hit
|
134 |
-
* @param array $data the data send
|
135 |
-
*
|
136 |
-
* @return void
|
137 |
-
*/
|
138 |
-
public function postJSON($url, $data)
|
139 |
-
{
|
140 |
-
// Try to send the whole lot, or without the meta data for the first
|
141 |
-
// event. If failed, try to send the first event, and then the rest of
|
142 |
-
// them, revursively. Decrease by a constant and concquer if you like.
|
143 |
-
// Note that the base case is satisfied as soon as the payload is small
|
144 |
-
// enought to send, or when it's simply discarded.
|
145 |
-
try {
|
146 |
-
$body = $this->encode($data);
|
147 |
-
} catch (RuntimeException $e) {
|
148 |
-
if (count($data['events']) > 1) {
|
149 |
-
$event = array_shift($data['events']);
|
150 |
-
$this->postJSON($url, array_merge($data, array('events' => array($event))));
|
151 |
-
$this->postJSON($url, $data);
|
152 |
-
} else {
|
153 |
-
error_log('Bugsnag Warning: '.$e->getMessage());
|
154 |
-
}
|
155 |
-
|
156 |
-
return;
|
157 |
-
}
|
158 |
-
|
159 |
-
// Prefer cURL if it is installed, otherwise fall back to fopen()
|
160 |
-
// cURL supports both timeouts and proxies
|
161 |
-
|
162 |
-
try {
|
163 |
-
if (function_exists('curl_version')) {
|
164 |
-
$this->postWithCurl($url, $body);
|
165 |
-
} elseif (ini_get('allow_url_fopen')) {
|
166 |
-
$this->postWithFopen($url, $body);
|
167 |
-
} else {
|
168 |
-
error_log('Bugsnag Warning: Couldn\'t notify (neither cURL or allow_url_fopen are available on your PHP installation)');
|
169 |
-
}
|
170 |
-
} catch (Exception $e) {
|
171 |
-
error_log('Bugsnag Warning: Couldn\'t notify. '.$e->getMessage());
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Json encode the given data.
|
177 |
-
*
|
178 |
-
* We will also strip out the meta data if it's too large.
|
179 |
-
*
|
180 |
-
* @param array $data the data to encode
|
181 |
-
*
|
182 |
-
* @throws RuntimeException
|
183 |
-
*
|
184 |
-
* @return string
|
185 |
-
*/
|
186 |
-
private function encode(array $data)
|
187 |
-
{
|
188 |
-
$body = json_encode($data);
|
189 |
-
|
190 |
-
if ($this->length($body) > 500000) {
|
191 |
-
unset($data['events'][0]['metaData']);
|
192 |
-
}
|
193 |
-
|
194 |
-
$body = json_encode($data);
|
195 |
-
|
196 |
-
if ($this->length($body) > 500000) {
|
197 |
-
throw new RuntimeException('Payload too large');
|
198 |
-
}
|
199 |
-
|
200 |
-
return $body;
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Get the length of the given string in bytes.
|
205 |
-
*
|
206 |
-
* @param string $str the string to get the length of
|
207 |
-
*
|
208 |
-
* @return int
|
209 |
-
*/
|
210 |
-
private function length($str)
|
211 |
-
{
|
212 |
-
return function_exists('mb_strlen') ? mb_strlen($str, '8bit') : strlen($str);
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Post the given info to Bugsnag using cURL.
|
217 |
-
*
|
218 |
-
* @param string $url the url to hit
|
219 |
-
* @param string $body the request body
|
220 |
-
*
|
221 |
-
* @return void
|
222 |
-
*/
|
223 |
-
private function postWithCurl($url, $body)
|
224 |
-
{
|
225 |
-
$http = curl_init($url);
|
226 |
-
|
227 |
-
// Default curl settings
|
228 |
-
curl_setopt($http, CURLOPT_HEADER, false);
|
229 |
-
curl_setopt($http, CURLOPT_RETURNTRANSFER, true);
|
230 |
-
curl_setopt($http, CURLOPT_POST, true);
|
231 |
-
curl_setopt($http, CURLOPT_HTTPHEADER, array(self::$CONTENT_TYPE_HEADER, 'Expect:'));
|
232 |
-
curl_setopt($http, CURLOPT_POSTFIELDS, $body);
|
233 |
-
curl_setopt($http, CURLOPT_CONNECTTIMEOUT, $this->config->timeout);
|
234 |
-
curl_setopt($http, CURLOPT_SSL_VERIFYPEER, false);
|
235 |
-
curl_setopt($http, CURLOPT_VERBOSE, false);
|
236 |
-
if (defined('HHVM_VERSION')) {
|
237 |
-
curl_setopt($http, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
238 |
-
} else {
|
239 |
-
curl_setopt($http, CURL_IPRESOLVE_V4, true);
|
240 |
-
}
|
241 |
-
|
242 |
-
if (!empty($this->config->curlOptions)) {
|
243 |
-
foreach ($this->config->curlOptions as $option => $value) {
|
244 |
-
curl_setopt($http, $option, $value);
|
245 |
-
}
|
246 |
-
}
|
247 |
-
// Apply proxy settings (if present)
|
248 |
-
if (count($this->config->proxySettings)) {
|
249 |
-
if (isset($this->config->proxySettings['host'])) {
|
250 |
-
curl_setopt($http, CURLOPT_PROXY, $this->config->proxySettings['host']);
|
251 |
-
}
|
252 |
-
if (isset($this->config->proxySettings['port'])) {
|
253 |
-
curl_setopt($http, CURLOPT_PROXYPORT, $this->config->proxySettings['port']);
|
254 |
-
}
|
255 |
-
if (isset($this->config->proxySettings['user'])) {
|
256 |
-
$userPassword = $this->config->proxySettings['user'].':';
|
257 |
-
$userPassword .= isset($this->config->proxySettings['password']) ? $this->config->proxySettings['password'] : '';
|
258 |
-
curl_setopt($http, CURLOPT_PROXYUSERPWD, $userPassword);
|
259 |
-
}
|
260 |
-
}
|
261 |
-
|
262 |
-
// Execute the request and fetch the response
|
263 |
-
$responseBody = curl_exec($http);
|
264 |
-
$statusCode = curl_getinfo($http, CURLINFO_HTTP_CODE);
|
265 |
-
|
266 |
-
if ($statusCode > 200) {
|
267 |
-
error_log('Bugsnag Warning: Couldn\'t notify ('.$responseBody.')');
|
268 |
-
|
269 |
-
if ($this->config->debug) {
|
270 |
-
error_log('Bugsnag Debug: Attempted to post to URL - "'.$url.'"');
|
271 |
-
error_log('Bugsnag Debug: Attempted to post payload - "'.$body.'"');
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
if (curl_errno($http)) {
|
276 |
-
error_log('Bugsnag Warning: Couldn\'t notify ('.curl_error($http).')');
|
277 |
-
}
|
278 |
-
|
279 |
-
curl_close($http);
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Post the given info to Bugsnag using fopen.
|
284 |
-
*
|
285 |
-
* @param string $url the url to hit
|
286 |
-
* @param string $body the request body
|
287 |
-
*
|
288 |
-
* @return void
|
289 |
-
*/
|
290 |
-
private function postWithFopen($url, $body)
|
291 |
-
{
|
292 |
-
// Warn about lack of proxy support if we are using fopen()
|
293 |
-
if (count($this->config->proxySettings)) {
|
294 |
-
error_log('Bugsnag Warning: Can\'t use proxy settings unless cURL is installed');
|
295 |
-
}
|
296 |
-
|
297 |
-
// Create the request context
|
298 |
-
$context = stream_context_create(array(
|
299 |
-
'http' => array(
|
300 |
-
'method' => 'POST',
|
301 |
-
'header' => self::$CONTENT_TYPE_HEADER.'\r\n',
|
302 |
-
'content' => $body,
|
303 |
-
'timeout' => $this->config->timeout,
|
304 |
-
),
|
305 |
-
'ssl' => array(
|
306 |
-
'verify_peer' => false,
|
307 |
-
),
|
308 |
-
));
|
309 |
-
|
310 |
-
// Execute the request and fetch the response
|
311 |
-
if ($stream = fopen($url, 'rb', false, $context)) {
|
312 |
-
$response = stream_get_contents($stream);
|
313 |
-
|
314 |
-
if (!$response) {
|
315 |
-
error_log('Bugsnag Warning: Couldn\'t notify (no response)');
|
316 |
-
}
|
317 |
-
} else {
|
318 |
-
error_log('Bugsnag Warning: Couldn\'t notify (fopen failed)');
|
319 |
-
}
|
320 |
-
}
|
321 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Request.php
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Request
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* Are we currently processing a request?
|
7 |
-
*
|
8 |
-
* @return bool
|
9 |
-
*/
|
10 |
-
public static function isRequest()
|
11 |
-
{
|
12 |
-
return isset($_SERVER['REQUEST_METHOD']);
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Get the request formatted as meta data.
|
17 |
-
*
|
18 |
-
* @return array
|
19 |
-
*/
|
20 |
-
public static function getRequestMetaData()
|
21 |
-
{
|
22 |
-
static $requestData;
|
23 |
-
|
24 |
-
if ($requestData !== null) {
|
25 |
-
return $requestData;
|
26 |
-
}
|
27 |
-
|
28 |
-
$requestData = array();
|
29 |
-
|
30 |
-
$methodsWithPayload = array('PUT');
|
31 |
-
|
32 |
-
// Request Tab
|
33 |
-
$requestData['request'] = array();
|
34 |
-
$requestData['request']['url'] = self::getCurrentUrl();
|
35 |
-
if (isset($_SERVER['REQUEST_METHOD'])) {
|
36 |
-
$requestData['request']['httpMethod'] = $_SERVER['REQUEST_METHOD'];
|
37 |
-
}
|
38 |
-
|
39 |
-
if (!empty($_POST)) {
|
40 |
-
$requestData['request']['params'] = $_POST;
|
41 |
-
} else {
|
42 |
-
$input = file_get_contents('php://input');
|
43 |
-
|
44 |
-
if (isset($_SERVER['CONTENT_TYPE']) && stripos($_SERVER['CONTENT_TYPE'], 'application/json') === 0) {
|
45 |
-
$requestData['request']['params'] = json_decode($input, true);
|
46 |
-
}
|
47 |
-
|
48 |
-
if (isset($_SERVER['REQUEST_METHOD']) && in_array(strtoupper($_SERVER['REQUEST_METHOD']), $methodsWithPayload)) {
|
49 |
-
parse_str($input, $params);
|
50 |
-
if (isset($requestData['request']['params']) && is_array($requestData['request']['params'])) {
|
51 |
-
$requestData['request']['params'] = array_merge($requestData['request']['params'], $params);
|
52 |
-
} else {
|
53 |
-
$requestData['request']['params'] = $params;
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
$requestData['request']['clientIp'] = self::getRequestIp();
|
59 |
-
if (isset($_SERVER['HTTP_USER_AGENT'])) {
|
60 |
-
$requestData['request']['userAgent'] = $_SERVER['HTTP_USER_AGENT'];
|
61 |
-
}
|
62 |
-
|
63 |
-
$headers = self::getRequestHeaders();
|
64 |
-
if (!empty($headers)) {
|
65 |
-
$requestData['request']['headers'] = $headers;
|
66 |
-
}
|
67 |
-
|
68 |
-
return $requestData;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Get the request context.
|
73 |
-
*
|
74 |
-
* @return string|null
|
75 |
-
*/
|
76 |
-
public static function getContext()
|
77 |
-
{
|
78 |
-
if (self::isRequest() && isset($_SERVER['REQUEST_METHOD']) && isset($_SERVER['REQUEST_URI'])) {
|
79 |
-
return $_SERVER['REQUEST_METHOD'].' '.strtok($_SERVER['REQUEST_URI'], '?');
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Get the request id.
|
85 |
-
*
|
86 |
-
* @return string|null
|
87 |
-
*/
|
88 |
-
public static function getUserId()
|
89 |
-
{
|
90 |
-
if (self::isRequest()) {
|
91 |
-
return self::getRequestIp();
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Get the request url.
|
97 |
-
*
|
98 |
-
* @return string
|
99 |
-
*/
|
100 |
-
public static function getCurrentUrl()
|
101 |
-
{
|
102 |
-
$schema = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? 'https://' : 'http://';
|
103 |
-
|
104 |
-
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
|
105 |
-
|
106 |
-
return $schema.$host.$_SERVER['REQUEST_URI'];
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Get the request ip.
|
111 |
-
*
|
112 |
-
* @return string
|
113 |
-
*/
|
114 |
-
public static function getRequestIp()
|
115 |
-
{
|
116 |
-
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Get the request headers.
|
121 |
-
*
|
122 |
-
* @return array
|
123 |
-
*/
|
124 |
-
public static function getRequestHeaders()
|
125 |
-
{
|
126 |
-
$headers = array();
|
127 |
-
|
128 |
-
foreach ($_SERVER as $name => $value) {
|
129 |
-
if (substr($name, 0, 5) == 'HTTP_') {
|
130 |
-
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
return $headers;
|
135 |
-
}
|
136 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/shippit-bugsnag/Stacktrace.php
DELETED
@@ -1,209 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Bugsnag_Stacktrace
|
4 |
-
{
|
5 |
-
private static $DEFAULT_NUM_LINES = 7;
|
6 |
-
private static $MAX_LINE_LENGTH = 200;
|
7 |
-
|
8 |
-
public $frames = array();
|
9 |
-
private $config;
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Generate a new stacktrace using the given config.
|
13 |
-
*
|
14 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
15 |
-
*
|
16 |
-
* @return self
|
17 |
-
*/
|
18 |
-
public static function generate($config)
|
19 |
-
{
|
20 |
-
// Reduce memory usage by omitting args and objects from backtrace
|
21 |
-
if (version_compare(PHP_VERSION, '5.3.6') >= 0) {
|
22 |
-
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS & ~DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
23 |
-
} elseif (version_compare(PHP_VERSION, '5.2.5') >= 0) {
|
24 |
-
$backtrace = debug_backtrace(false);
|
25 |
-
} else {
|
26 |
-
$backtrace = debug_backtrace();
|
27 |
-
}
|
28 |
-
|
29 |
-
return self::fromBacktrace($config, $backtrace, '[generator]', 0);
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Create a new stacktrace instance from a frame.
|
34 |
-
*
|
35 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
36 |
-
* @param string $file the associated file
|
37 |
-
* @param int $line the line number
|
38 |
-
*
|
39 |
-
* @return self
|
40 |
-
*/
|
41 |
-
public static function fromFrame($config, $file, $line)
|
42 |
-
{
|
43 |
-
$stacktrace = new self($config);
|
44 |
-
$stacktrace->addFrame($file, $line, '[unknown]');
|
45 |
-
|
46 |
-
return $stacktrace;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Create a new stacktrace instance from a backtrace.
|
51 |
-
*
|
52 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
53 |
-
* @param array $backtrace the associated backtrace
|
54 |
-
* @param int $topFile the top file to use
|
55 |
-
* @param int $topLine the top line to use
|
56 |
-
*
|
57 |
-
* @return self
|
58 |
-
*/
|
59 |
-
public static function fromBacktrace($config, $backtrace, $topFile, $topLine)
|
60 |
-
{
|
61 |
-
$stacktrace = new self($config);
|
62 |
-
|
63 |
-
// PHP backtrace's are misaligned, we need to shift the file/line down a frame
|
64 |
-
foreach ($backtrace as $frame) {
|
65 |
-
if (!self::frameInsideBugsnag($frame)) {
|
66 |
-
$stacktrace->addFrame(
|
67 |
-
$topFile,
|
68 |
-
$topLine,
|
69 |
-
isset($frame['function']) ? $frame['function'] : null,
|
70 |
-
isset($frame['class']) ? $frame['class'] : null
|
71 |
-
);
|
72 |
-
}
|
73 |
-
|
74 |
-
if (isset($frame['file']) && isset($frame['line'])) {
|
75 |
-
$topFile = $frame['file'];
|
76 |
-
$topLine = $frame['line'];
|
77 |
-
} else {
|
78 |
-
$topFile = '[internal]';
|
79 |
-
$topLine = 0;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
// Add a final stackframe for the "main" method
|
84 |
-
$stacktrace->addFrame($topFile, $topLine, '[main]');
|
85 |
-
|
86 |
-
return $stacktrace;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Does the given frame internally belong to bugsnag.
|
91 |
-
*
|
92 |
-
* @param array $frame the given frame to check
|
93 |
-
*
|
94 |
-
* @return bool
|
95 |
-
*/
|
96 |
-
public static function frameInsideBugsnag($frame)
|
97 |
-
{
|
98 |
-
return isset($frame['class']) && strpos($frame['class'], 'Bugsnag_') === 0;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Create a new stacktrace instance.
|
103 |
-
*
|
104 |
-
* @param Bugsnag_Configuration $config the configuration instance
|
105 |
-
*
|
106 |
-
* @return void
|
107 |
-
*/
|
108 |
-
public function __construct($config)
|
109 |
-
{
|
110 |
-
$this->config = $config;
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Get the array representation.
|
115 |
-
*
|
116 |
-
* @return array
|
117 |
-
*/
|
118 |
-
public function toArray()
|
119 |
-
{
|
120 |
-
return $this->frames;
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Add the given frame to the stacktrace.
|
125 |
-
*
|
126 |
-
* @param string $file the associated file
|
127 |
-
* @param int $line the line number
|
128 |
-
* @param string $method the method called
|
129 |
-
* @param string|null $class the associated class
|
130 |
-
*
|
131 |
-
* @return void
|
132 |
-
*/
|
133 |
-
public function addFrame($file, $line, $method, $class = null)
|
134 |
-
{
|
135 |
-
// Account for special "filenames" in eval'd code
|
136 |
-
$matches = array();
|
137 |
-
if (preg_match("/^(.*?)\((\d+)\) : (?:eval\(\)'d code|runtime-created function)$/", $file, $matches)) {
|
138 |
-
$file = $matches[1];
|
139 |
-
$line = $matches[2];
|
140 |
-
}
|
141 |
-
|
142 |
-
// Construct the frame
|
143 |
-
$frame = array(
|
144 |
-
'lineNumber' => (int) $line,
|
145 |
-
'method' => $class ? "$class::$method" : $method,
|
146 |
-
);
|
147 |
-
|
148 |
-
// Attach some lines of code for context
|
149 |
-
if ($this->config->sendCode) {
|
150 |
-
$frame['code'] = $this->getCode($file, $line, self::$DEFAULT_NUM_LINES);
|
151 |
-
}
|
152 |
-
|
153 |
-
// Check if this frame is inProject
|
154 |
-
$frame['inProject'] = !is_null($this->config->projectRootRegex) && preg_match($this->config->projectRootRegex, $file);
|
155 |
-
|
156 |
-
// Strip out projectRoot from start of file path
|
157 |
-
if (is_null($this->config->stripPathRegex)) {
|
158 |
-
$frame['file'] = $file;
|
159 |
-
} else {
|
160 |
-
$frame['file'] = preg_replace($this->config->stripPathRegex, '', $file);
|
161 |
-
}
|
162 |
-
|
163 |
-
$this->frames[] = $frame;
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Extract the code for the given file and lines.
|
168 |
-
*
|
169 |
-
* @param string $path the path to the file
|
170 |
-
* @param int $line the line to centre about
|
171 |
-
* @param string $numLines the number of lines to fetch
|
172 |
-
*
|
173 |
-
* @return string[]|null
|
174 |
-
*/
|
175 |
-
private function getCode($path, $line, $numLines)
|
176 |
-
{
|
177 |
-
if (empty($path) || empty($line) || !file_exists($path)) {
|
178 |
-
return;
|
179 |
-
}
|
180 |
-
|
181 |
-
try {
|
182 |
-
// Get the number of lines in the file
|
183 |
-
$file = new SplFileObject($path);
|
184 |
-
$file->seek(PHP_INT_MAX);
|
185 |
-
$totalLines = $file->key() + 1;
|
186 |
-
|
187 |
-
// Work out which lines we should fetch
|
188 |
-
$start = max($line - floor($numLines / 2), 1);
|
189 |
-
$end = $start + ($numLines - 1);
|
190 |
-
if ($end > $totalLines) {
|
191 |
-
$end = $totalLines;
|
192 |
-
$start = max($end - ($numLines - 1), 1);
|
193 |
-
}
|
194 |
-
|
195 |
-
// Get the code for this range
|
196 |
-
$code = array();
|
197 |
-
|
198 |
-
$file->seek($start - 1);
|
199 |
-
while ($file->key() < $end) {
|
200 |
-
$code[$file->key() + 1] = rtrim(substr($file->current(), 0, self::$MAX_LINE_LENGTH));
|
201 |
-
$file->next();
|
202 |
-
}
|
203 |
-
|
204 |
-
return $code;
|
205 |
-
} catch (RuntimeException $ex) {
|
206 |
-
return;
|
207 |
-
}
|
208 |
-
}
|
209 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shippit_Shippit</name>
|
4 |
-
<version>4.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software Licence</license>
|
7 |
<channel>community</channel>
|
@@ -18,9 +18,9 @@ Allows for retrieving shipping quotes during checkout and sending orders to Ship
|
|
18 |

|
19 |
Also adds Australian States and Territories to the available region options and Authority to Leave and Delivery Comments to the checkout process.</notes>
|
20 |
<authors><author><name>Matthew Muscat</name><user>matthewmuscat</user><email>matthew@mamis.com.au</email></author><author><name>William On</name><user>williamon</user><email>will@shippit.com</email></author></authors>
|
21 |
-
<date>2017-
|
22 |
-
<time>
|
23 |
-
<contents><target name="
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
|
26 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Shippit_Shippit</name>
|
4 |
+
<version>4.6.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software Licence</license>
|
7 |
<channel>community</channel>
|
18 |

|
19 |
Also adds Australian States and Territories to the available region options and Authority to Leave and Delivery Comments to the checkout process.</notes>
|
20 |
<authors><author><name>Matthew Muscat</name><user>matthewmuscat</user><email>matthew@mamis.com.au</email></author><author><name>William On</name><user>williamon</user><email>will@shippit.com</email></author></authors>
|
21 |
+
<date>2017-07-19</date>
|
22 |
+
<time>04:47:33</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="Shippit"><dir name="Shippit"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="13fbd04dda6b27926ccef9372f9f277d"/><file name="Items.php" hash="f3f349a42b2920d206869a2e493eecb4"/></dir><file name="Order.php" hash="e890e1f421472d79b1ae93523d9f225f"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><dir name="Renderer"><dir name="Shipping"><file name="Methods.php" hash="d9d4ff06bc019d9cd33486c37c7d3408"/></dir><dir name="Shippit"><file name="ServiceClass.php" hash="642ea37688fd7b58db2755103ab4f2bf"/></dir></dir><dir name="Sync"><dir name="Order"><file name="ShippingMethodMapping.php" hash="fe000cfd947e1f70a81f836363753a08"/></dir></dir></dir><dir name="Fieldset"><file name="Version.php" hash="4826ff9c81e674170760b291d2cc0c8c"/></dir></dir></dir></dir></dir><dir name="Checkout"><dir name="Cart"><file name="Shipping.php" hash="85099d8b76b07b15af03b2e258836d46"/></dir><dir name="Shipping"><file name="AuthorityToLeave.php" hash="4c6c967bf4712f33703d53f33ba6bd7e"/><file name="DeliveryInstructions.php" hash="d694de127c13d73399a0706e156ec5e8"/></dir></dir></dir><file name="Exception.php" hash="93d6781a165686a612f72603fead9169"/><dir name="Helper"><file name="Api.php" hash="31829547fa672d11a568abc313199ffa"/><file name="Carrier.php" hash="b47e8e1116770ddf68cb937dff44b008"/><file name="Checkout.php" hash="d9ae6fa2e4fc9836555cf522b5fe2d2f"/><file name="Data.php" hash="892f0204f702c298764b72c1ea032991"/><dir name="Sync"><file name="Item.php" hash="17e2847d5af57dd064f16080124ed90a"/><file name="Order.php" hash="2e49a4d27096210786d6cfd474780d63"/><file name="Shipping.php" hash="542df51f62670ef20083bf4cdc18ef36"/></dir></dir><dir name="Model"><dir name="Api"><file name="Order.php" hash="783ed8aea65afc5e38c9435c548d8cd1"/></dir><file name="Logger.php" hash="9689ef33fa3f5c68f67dec26906f37e9"/><dir name="Observer"><dir name="Adminhtml"><dir name="Sales"><file name="Order.php" hash="7b9f6d26c2afaecd64ade673346e6ffe"/></dir></dir><dir name="Order"><file name="Sync.php" hash="51c792a3e7db5cbae6d8e9a6dd8dc637"/></dir><dir name="Quote"><file name="AuthorityToLeave.php" hash="487ed26a3849c8d8a2e390cb90c66590"/><file name="DeliveryInstructions.php" hash="c2e69ef0db9ffd099ee0adcb70e17d65"/></dir><dir name="Shipping"><file name="Tracking.php" hash="877837eea6cce86d2d342010e4aa1fd3"/></dir><file name="Shippit.php" hash="bee7b54e82b16a64cb68e4e1b00dd01e"/><dir name="System"><file name="Config.php" hash="8e0b0b1e3f3580cd8184717c04d1891e"/></dir></dir><dir name="Request"><dir name="Api"><file name="Order.php" hash="db71a3c5cb99ff8a61eb13f8df03afc4"/><file name="Shipment.php" hash="ad030ad0550383f1e61b8a2d25c2d064"/></dir><dir name="Sync"><file name="Order.php" hash="6eed98e7a7b679caaf2a404ea72128bc"/></dir></dir><dir name="Resource"><file name="Setup.php" hash="26d6719441c7f52a942d7ef1707a2cbd"/><dir name="Sync"><dir name="Order"><file name="Collection.php" hash="71a534ab9ef571dd7ecfc9c5a1fd2e8e"/><dir name="Item"><file name="Collection.php" hash="050607cbd5c14125e893029d35c0aaae"/></dir><file name="Item.php" hash="76475f4072dad76680f3314ca07af16a"/></dir><file name="Order.php" hash="fea245c7d26017436d942ead41e85551"/></dir></dir><dir name="Shipping"><dir name="Carrier"><file name="Shippit.php" hash="e0715e7418b82349d72d7c4263bb98aa"/></dir></dir><file name="Shippit.php" hash="41c3a40f265c4b751384dd8736803c02"/><dir name="Sync"><dir name="Order"><file name="Config.php" hash="5d4206b2bbb223dc27e69f1c337aa155"/><file name="Item.php" hash="172e15541e1c47c7b5f61600e10b55cc"/></dir><file name="Order.php" hash="ac8cdb8ca5b0f629dc21284ce0a95a7f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Catalog"><dir name="Attributes"><file name="Location.php" hash="d655039eedd68a4d12e564ed0911cb56"/></dir><file name="Attributes.php" hash="9ea052fc2749dad83035f9ccfb8d52cc"/><file name="Products.php" hash="11842f237c6f9d6d905a3e895b7f4755"/><dir name="Unit"><file name="Dimensions.php" hash="6edca21b6acacbe11061f72744ab964a"/><file name="Weight.php" hash="fb8d260c7d0c29b6826c45c4a823bb4a"/></dir></dir><dir name="Order"><dir name="Status"><file name="Processing.php" hash="2c106314d9b545bb68d893019361f086"/></dir></dir><dir name="Shipping"><file name="Methods.php" hash="cb2cbac353bd6ef7064560c34b77a242"/></dir><dir name="Shippit"><file name="Environment.php" hash="8358dad3fa00f5f7afd896005e9384d2"/><file name="Margin.php" hash="698af229b99842069df3fbc5723c6aa1"/><file name="MaxTimeslots.php" hash="289648c1b1013ad3f46e51213969b658"/><file name="Methods.php" hash="63d2d705f0bef407123731785eb14a28"/><dir name="Order"><file name="Status.php" hash="692a48c0c27cd5684c4ca6592afc074f"/></dir><dir name="Sync"><file name="Mode.php" hash="b4d4b400f9a89b4b4abd31c8d789e67c"/><file name="SendAllOrders.php" hash="d64cbe8492eb7723905c6059baea5135"/></dir></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Shippit"><dir name="Order"><file name="SyncController.php" hash="f75315d6a861fa5bea9356c9dfd4234d"/></dir><file name="OrderController.php" hash="6f6b2e039814d3b92291e5569b8dfe2a"/></dir></dir><file name="OrderController.php" hash="4c4f2f69b34379ad375e4fcd02fc5e37"/></dir><dir name="data"><dir name="shippit_setup"><file name="data-install-4.0.0.php" hash="a103a31ca30efdf15da611f3515139c3"/><file name="data-upgrade-4.1.0-4.1.1.php" hash="32bd577f63386552b6c7f50a02893d43"/><file name="data-upgrade-4.1.6-4.1.7.php" hash="1192bc5195a6836c8a772c7438548dde"/><file name="data-upgrade-4.2.3-4.2.4.php" hash="e62df589ecb3f2bf0e369adeed6b01f6"/><file name="data-upgrade-4.3.2-4.3.3.php" hash="bf712884783dc2094f6bdc7914a26cae"/><file name="data-upgrade-4.4.0-4.5.0.php" hash="27c64893befe9b8adcbd24d430a05225"/><file name="data-upgrade-4.5.3-4.5.4.php" hash="75444696cbd2a3e736b07f8abef7ea30"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ef9af2663df4b0ce2376d29cf3e4e796"/><file name="config.xml" hash="bb28a234ddca5401f018838fca694362"/><file name="system.xml" hash="60f6c60842b88ddbd7a4e9612dd1f2b2"/></dir><dir name="sql"><dir name="shippit_setup"><file name="install-4.0.0.php" hash="148388fc103d64494eeab1123c36c486"/><file name="upgrade-4.0.9-4.1.0.php" hash="3f91445f5bac0f854fdbd2c4c4e01380"/><file name="upgrade-4.1.0-4.1.1.php" hash="894bbf9961115233c251840ceba8235f"/><file name="upgrade-4.2.5-4.2.6.php" hash="740a985a3792033a760cd8bfd194ed6a"/><file name="upgrade-4.2.6-4.3.0.php" hash="34925bcf6f7fce018ccf27e59247ad9a"/><file name="upgrade-4.4.0-4.5.0.php" hash="a64a5a254f75c4e122a59456e7a79364"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shippit.xml" hash="7f449eb63634539b357d4b5522be9a26"/></dir><dir name="template"><dir name="shippit"><dir name="checkout"><dir name="onepage"><dir name="shipping_method"><file name="authoritytoleave.phtml" hash="dd41307e67a0d79dff515fbe8661243c"/><file name="deliveryinstructions.phtml" hash="32ce8620ccf7aa5ea9f0e80c180a5557"/></dir><file name="shipping_method.phtml" hash="39e83ab9369db299e50de6cc06618df4"/></dir></dir><dir name="email"><dir name="order"><dir name="shipment"><file name="track.phtml" hash="0fdb70d0a5fe33affe68c51fbbe4df24"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shippit.xml" hash="a5ee167afd1cfd4b06856b90238d0921"/></dir><dir name="template"><dir name="shippit"><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array.phtml" hash="d90ecc5b623a2c27e6822cb1f48d4456"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shippit_Shippit.xml" hash="401f33d7db491808587c51209d8d6a8b"/></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
|
26 |
</package>
|