Version Notes
* Performance improvements for different catalog settings
Download this release
Release Info
Developer | Christiaan de Ridder |
Extension | Tritac_ChannelEngine |
Version | 4.3.0 |
Comparing to | |
See all releases |
Code changes from version 3.5.0 to 4.3.0
- app/code/community/Tritac/ChannelEngine/Helper/Data.php +49 -18
- app/code/community/Tritac/ChannelEngine/Model/Loader.php +24 -0
- app/code/community/Tritac/ChannelEngine/Model/Observer.php +299 -248
- app/code/community/Tritac/ChannelEngine/controllers/Adminhtml/GenerateController.php +19 -4
- app/code/community/Tritac/ChannelEngine/etc/config.xml +29 -9
- app/code/community/Tritac/ChannelEngine/etc/system.xml +0 -8
- lib/ChannelEngine/.gitignore +2 -0
- lib/Tritac/ChannelEngineApiClient/AddTrustExternalCARoot.crt +0 -25
- lib/Tritac/ChannelEngineApiClient/Client.php +0 -282
- lib/Tritac/ChannelEngineApiClient/Enums/CancellationLineStatus.php +0 -8
- lib/Tritac/ChannelEngineApiClient/Enums/CancellationStatus.php +0 -9
- lib/Tritac/ChannelEngineApiClient/Enums/Gender.php +0 -8
- lib/Tritac/ChannelEngineApiClient/Enums/MancoReason.php +0 -8
- lib/Tritac/ChannelEngineApiClient/Enums/OrderStatus.php +0 -13
- lib/Tritac/ChannelEngineApiClient/Enums/ReturnAcceptStatus.php +0 -6
- lib/Tritac/ChannelEngineApiClient/Enums/ReturnReason.php +0 -10
- lib/Tritac/ChannelEngineApiClient/Enums/ReturnStatus.php +0 -6
- lib/Tritac/ChannelEngineApiClient/Enums/ShipmentLineStatus.php +0 -8
- lib/Tritac/ChannelEngineApiClient/Enums/ShipmentStatus.php +0 -5
- lib/Tritac/ChannelEngineApiClient/Helpers/Collection.php +0 -49
- lib/Tritac/ChannelEngineApiClient/Helpers/HttpMethod.php +0 -9
- lib/Tritac/ChannelEngineApiClient/Helpers/JsonMapper.php +0 -91
- lib/Tritac/ChannelEngineApiClient/Models/Address.php +0 -97
- lib/Tritac/ChannelEngineApiClient/Models/BaseModel.php +0 -23
- lib/Tritac/ChannelEngineApiClient/Models/Cancellation.php +0 -39
- lib/Tritac/ChannelEngineApiClient/Models/CancellationLine.php +0 -33
- lib/Tritac/ChannelEngineApiClient/Models/Message.php +0 -12
- lib/Tritac/ChannelEngineApiClient/Models/Order.php +0 -154
- lib/Tritac/ChannelEngineApiClient/Models/OrderExtraDataItem.php +0 -19
- lib/Tritac/ChannelEngineApiClient/Models/OrderLine.php +0 -146
- lib/Tritac/ChannelEngineApiClient/Models/ReturnLine.php +0 -46
- lib/Tritac/ChannelEngineApiClient/Models/ReturnObject.php +0 -64
- lib/Tritac/ChannelEngineApiClient/Models/Shipment.php +0 -73
- lib/Tritac/ChannelEngineApiClient/Models/ShipmentLine.php +0 -48
- lib/Tritac/ChannelEngineApiClient/loader.php +0 -14
- package.xml +6 -7
app/code/community/Tritac/ChannelEngine/Helper/Data.php
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
<?php
|
2 |
class Tritac_ChannelEngine_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
|
|
|
|
|
|
|
4 |
protected $_config = null;
|
5 |
|
6 |
/**
|
@@ -10,6 +13,42 @@ class Tritac_ChannelEngine_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
10 |
*/
|
11 |
protected $_defaultTimeToShip = 5;
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Get extension general config
|
15 |
*
|
@@ -44,10 +83,13 @@ class Tritac_ChannelEngine_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
44 |
{
|
45 |
$result = array();
|
46 |
|
47 |
-
foreach($this->getConfig() as $storeId => $storeConfig)
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
-
|
51 |
return $result;
|
52 |
}
|
53 |
|
@@ -60,29 +102,18 @@ class Tritac_ChannelEngine_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
60 |
public function checkGeneralConfig($storeId = null)
|
61 |
{
|
62 |
$config = Mage::getStoreConfig('channelengine/general', $storeId);
|
63 |
-
|
64 |
-
if(empty($config['api_key']) || empty($config['api_secret']) || empty($config['tenant'])) {
|
65 |
-
$storeMsg = ($storeId) ? 'for store '.$storeId : '';
|
66 |
-
Mage::log(
|
67 |
-
"Couldn't connect to ChannelEngine.
|
68 |
-
Please specify account keys {$storeMsg}
|
69 |
-
(System/Configuration/Tritac ChannelEngine/Settings/General)"
|
70 |
-
);
|
71 |
-
return false;
|
72 |
-
}
|
73 |
-
|
74 |
-
return true;
|
75 |
}
|
76 |
|
77 |
/**
|
78 |
* Get store expected shipment text
|
79 |
*
|
80 |
-
* @param $
|
81 |
* @return DateTime
|
82 |
*/
|
83 |
-
public function getExpectedShipmentDate($
|
84 |
{
|
85 |
-
$config = $this->getConfig($
|
86 |
|
87 |
$weekdays = (int) $config['shipping']['expected_date'];
|
88 |
if($weekdays <= 0)
|
1 |
<?php
|
2 |
class Tritac_ChannelEngine_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
|
4 |
+
const AUTOLOAD_FILENAME = 'autoload.php';
|
5 |
+
const DEFAULT_PATH = '{{libdir}}/ChannelEngine/vendor';
|
6 |
+
|
7 |
protected $_config = null;
|
8 |
|
9 |
/**
|
13 |
*/
|
14 |
protected $_defaultTimeToShip = 5;
|
15 |
|
16 |
+
/**
|
17 |
+
* The location of the vendor directory on the machine the site is running on.
|
18 |
+
* It always comes without a trailing slash.
|
19 |
+
*
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function getVendorDirectoryPath()
|
23 |
+
{
|
24 |
+
$path = (string) Mage::getConfig()->getNode('global/composer_autoloader/path');
|
25 |
+
if (!$path) {
|
26 |
+
$path = self::DEFAULT_PATH;
|
27 |
+
}
|
28 |
+
$path = str_replace('/', DS, $path);
|
29 |
+
$path = str_replace('{{basedir}}', Mage::getBaseDir(), $path);
|
30 |
+
$path = str_replace('{{libdir}}', Mage::getBaseDir('lib'), $path);
|
31 |
+
$path = rtrim($path, DS);
|
32 |
+
return realpath($path);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @param string|null $path Path to vendor directory. Pass null to use the configured value.
|
37 |
+
* @param string|null $filename Filename of autoload file. Pass null to use the default (autoload.php).
|
38 |
+
*/
|
39 |
+
public function registerAutoloader($path = null, $filename = null)
|
40 |
+
{
|
41 |
+
if ($path === null) {
|
42 |
+
$path = $this->getVendorDirectoryPath();
|
43 |
+
}
|
44 |
+
if ($filename === null) {
|
45 |
+
$filename = self::AUTOLOAD_FILENAME;
|
46 |
+
}
|
47 |
+
if (file_exists($path . DS . $filename)) {
|
48 |
+
require_once($path . DS . $filename);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
/**
|
53 |
* Get extension general config
|
54 |
*
|
83 |
{
|
84 |
$result = array();
|
85 |
|
86 |
+
foreach($this->getConfig() as $storeId => $storeConfig)
|
87 |
+
{
|
88 |
+
if(isset($storeConfig['general']))
|
89 |
+
{
|
90 |
+
$result[$storeId] = $storeConfig['general'];
|
91 |
+
}
|
92 |
}
|
|
|
93 |
return $result;
|
94 |
}
|
95 |
|
102 |
public function checkGeneralConfig($storeId = null)
|
103 |
{
|
104 |
$config = Mage::getStoreConfig('channelengine/general', $storeId);
|
105 |
+
return (empty($config['api_key']) || empty($config['api_secret']) || empty($config['tenant'])) ? false : true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
109 |
* Get store expected shipment text
|
110 |
*
|
111 |
+
* @param $storeId
|
112 |
* @return DateTime
|
113 |
*/
|
114 |
+
public function getExpectedShipmentDate($storeId)
|
115 |
{
|
116 |
+
$config = $this->getConfig($storeId);
|
117 |
|
118 |
$weekdays = (int) $config['shipping']['expected_date'];
|
119 |
if($weekdays <= 0)
|
app/code/community/Tritac/ChannelEngine/Model/Loader.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Observer model
|
4 |
+
*/
|
5 |
+
class Tritac_ChannelEngine_Model_Loader
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @var bool
|
9 |
+
*/
|
10 |
+
protected static $added = false;
|
11 |
+
/**
|
12 |
+
* Register the Composer autoloader
|
13 |
+
* @param Varien_Event_Observer $observer
|
14 |
+
*/
|
15 |
+
public function addComposerAutoloader(Varien_Event_Observer $observer)
|
16 |
+
{
|
17 |
+
if (self::$added === false) {
|
18 |
+
/** @var $helper Tritac_ChannelEngine_Helper_Data */
|
19 |
+
$helper = Mage::helper('channelengine');
|
20 |
+
$helper->registerAutoloader();
|
21 |
+
self::$added = true;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Tritac/ChannelEngine/Model/Observer.php
CHANGED
@@ -2,12 +2,27 @@
|
|
2 |
/**
|
3 |
* Observer model
|
4 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
class Tritac_ChannelEngine_Model_Observer
|
6 |
{
|
7 |
/**
|
8 |
* API client
|
9 |
*
|
10 |
-
* @var
|
11 |
*/
|
12 |
protected $_client = null;
|
13 |
|
@@ -27,6 +42,8 @@ class Tritac_ChannelEngine_Model_Observer
|
|
27 |
|
28 |
const ATTRIBUTES_LIMIT = 30;
|
29 |
|
|
|
|
|
30 |
/**
|
31 |
* Retrieve and validate API config
|
32 |
* Initialize API client
|
@@ -34,21 +51,33 @@ class Tritac_ChannelEngine_Model_Observer
|
|
34 |
public function __construct()
|
35 |
{
|
36 |
$this->_helper = Mage::helper('channelengine');
|
|
|
|
|
37 |
$this->_config = $this->_helper->getConfig();
|
38 |
/**
|
39 |
* Check required config parameters. Initialize API client.
|
40 |
*/
|
41 |
foreach($this->_config as $storeId => $storeConfig) {
|
42 |
if($this->_helper->checkGeneralConfig($storeId)) {
|
43 |
-
$
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
48 |
}
|
49 |
}
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
/**
|
53 |
* Fetch new orders from ChannelEngine.
|
54 |
* Ran by cron. The cronjob is set in extension config file.
|
@@ -60,88 +89,87 @@ class Tritac_ChannelEngine_Model_Observer
|
|
60 |
/**
|
61 |
* Check if client is initialized
|
62 |
*/
|
63 |
-
if(is_null($this->_client))
|
64 |
-
return false;
|
65 |
|
66 |
-
foreach($this->_client as $storeId => $
|
67 |
-
|
68 |
-
|
69 |
-
*/
|
70 |
-
$orders = $_client->getOrders(array(
|
71 |
-
Tritac_ChannelEngineApiClient_Enums_OrderStatus::NEW_ORDER
|
72 |
-
));
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
continue;
|
|
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
foreach($orders as $order) {
|
83 |
|
|
|
|
|
84 |
$billingAddress = $order->getBillingAddress();
|
85 |
$shippingAddress = $order->getShippingAddress();
|
86 |
-
if(empty($billingAddress)) continue;
|
87 |
|
88 |
$lines = $order->getLines();
|
89 |
|
90 |
-
if(
|
91 |
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
$ids = explode('_', $productNo);
|
99 |
-
$productId = $ids[0];
|
100 |
-
$productOptions = array();
|
101 |
-
if(count($ids) == 3) {
|
102 |
-
$productOptions = array($ids[1] => intval($ids[2]));
|
103 |
-
}
|
104 |
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
$_product->load($productId);
|
|
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
}
|
114 |
-
|
115 |
-
// Prepare product parameters for quote
|
116 |
-
$params = new Varien_Object();
|
117 |
-
$params->setQty($item->getQuantity());
|
118 |
-
$params->setOptions($productOptions);
|
119 |
-
|
120 |
-
// Add product to quote
|
121 |
-
try {
|
122 |
-
$_quoteItem = $quote->addProduct($_product, $params);
|
123 |
-
|
124 |
-
if(is_string($_quoteItem)) {
|
125 |
-
// Magento sometimes returns a string when the method fails. -_-"
|
126 |
-
Mage::throwException('Failed to create quote item: ' . $_quoteItem);
|
127 |
-
}
|
128 |
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
134 |
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
-
} catch (Exception $e) {
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
}
|
146 |
}
|
147 |
|
@@ -159,7 +187,7 @@ class Tritac_ChannelEngine_Model_Observer
|
|
159 |
'postcode' => $billingAddress->getZipCode(),
|
160 |
'city' => $billingAddress->getCity(),
|
161 |
'street' =>
|
162 |
-
$billingAddress->getStreetName().
|
163 |
$billingAddress->getHouseNr().
|
164 |
$billingAddress->getHouseNrAddition()
|
165 |
);
|
@@ -174,7 +202,7 @@ class Tritac_ChannelEngine_Model_Observer
|
|
174 |
'postcode' => $shippingAddress->getZipCode(),
|
175 |
'city' => $shippingAddress->getCity(),
|
176 |
'street' =>
|
177 |
-
$shippingAddress->getStreetName().
|
178 |
$shippingAddress->getHouseNr().
|
179 |
$shippingAddress->getHouseNrAddition()
|
180 |
);
|
@@ -207,76 +235,87 @@ class Tritac_ChannelEngine_Model_Observer
|
|
207 |
$quote->getPayment()->importData(array('method' => 'channelengine'));
|
208 |
|
209 |
// Save quote and convert it to new order
|
210 |
-
try
|
211 |
-
|
212 |
$quote->save();
|
213 |
-
|
214 |
$service = Mage::getModel('sales/service_quote', $quote);
|
215 |
-
|
216 |
$service->submitAll();
|
217 |
-
|
218 |
-
|
|
|
219 |
Mage::getModel('adminnotification/inbox')->addCritical(
|
220 |
-
"An order (#{$order->
|
221 |
"Reason: {$e->getMessage()} Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
222 |
);
|
223 |
Mage::logException($e);
|
224 |
continue;
|
225 |
}
|
226 |
|
227 |
-
$
|
228 |
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
try {
|
236 |
-
// Initialize new invoice model
|
237 |
-
$invoice = Mage::getModel('sales/service_order', $_order)->prepareInvoice();
|
238 |
-
// Add comment to invoice
|
239 |
-
$invoice->addComment(
|
240 |
-
"Order paid on the marketplace.",
|
241 |
-
false,
|
242 |
-
true
|
243 |
-
);
|
244 |
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
Mage::
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
|
|
|
|
280 |
}
|
281 |
}
|
282 |
|
@@ -295,55 +334,80 @@ class Tritac_ChannelEngine_Model_Observer
|
|
295 |
$event = $observer->getEvent();
|
296 |
/** @var $_shipment Mage_Sales_Model_Order_Shipment */
|
297 |
$_shipment = $event->getShipment();
|
298 |
-
|
299 |
/** @var $_order Mage_Sales_Model_Order */
|
300 |
$_order = $_shipment->getOrder();
|
301 |
-
|
302 |
$storeId = $_order->getStoreId();
|
303 |
-
|
304 |
$ceOrder = Mage::getModel('channelengine/order')->loadByOrderId($_order->getId());
|
305 |
-
$
|
|
|
|
|
|
|
306 |
|
307 |
-
if(!$ceOrderId) return false;
|
308 |
-
|
309 |
// Check if the API client was initialized for this order
|
310 |
if(!isset($this->_client[$storeId])) return false;
|
311 |
|
|
|
|
|
312 |
// Initialize new ChannelEngine shipment object
|
313 |
-
$ceShipment = new
|
314 |
-
$ceShipment->
|
315 |
$ceShipment->setMerchantShipmentNo($_shipment->getId());
|
316 |
|
317 |
// Set tracking info if available
|
318 |
-
$trackingCode = null;
|
319 |
$trackingCodes = $_shipment->getAllTracks();
|
320 |
-
|
|
|
|
|
321 |
$trackingCode = $trackingCodes[0];
|
322 |
$ceShipment->setTrackTraceNo($trackingCode->getNumber());
|
323 |
-
$ceShipment->setMethod($trackingCode->getTitle());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
}
|
325 |
|
326 |
// If the shipment is already known to ChannelEngine we will just update it
|
327 |
$_channelShipment = Mage::getModel('channelengine/shipment')->loadByShipmentId($_shipment->getId());
|
328 |
|
329 |
-
if($_channelShipment->getId() != null)
|
|
|
|
|
|
|
|
|
330 |
|
331 |
-
|
332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
334 |
|
335 |
-
Mage::log("CE Shipment Id: #{$_channelShipment->getChannelengineShipmentId()}");
|
336 |
-
$ceShipment->setId($_channelShipment->getChannelengineShipmentId());
|
337 |
-
$this->_client[$storeId]->putShipment($ceShipment);
|
338 |
return true;
|
339 |
}
|
340 |
|
341 |
-
Mage::log('New shipment, continue');
|
342 |
-
|
343 |
// Add the shipment lines
|
344 |
-
$ceShipmentLines =
|
345 |
-
foreach($_shipment->getAllItems() as $_shipmentItem)
|
346 |
-
|
347 |
// Get the quantity for this shipment
|
348 |
$shippedQty = (int)$_shipmentItem->getQty();
|
349 |
if($shippedQty == 0) continue;
|
@@ -352,12 +416,10 @@ class Tritac_ChannelEngine_Model_Observer
|
|
352 |
$_orderItem = Mage::getModel('sales/order_item')->load($_shipmentItem->getOrderItemId());
|
353 |
if($_orderItem == null) continue;
|
354 |
|
355 |
-
$ceShipmentLine = new
|
356 |
-
$ceShipmentLine->
|
357 |
$ceShipmentLine->setQuantity($shippedQty);
|
358 |
-
$ceShipmentLine
|
359 |
-
|
360 |
-
$ceShipmentLines->append($ceShipmentLine);
|
361 |
}
|
362 |
|
363 |
// Check if there are any shipment lines
|
@@ -366,31 +428,29 @@ class Tritac_ChannelEngine_Model_Observer
|
|
366 |
$ceShipment->setLines($ceShipmentLines);
|
367 |
|
368 |
// Post shipment to ChannelEngine
|
369 |
-
try
|
370 |
-
|
371 |
-
$
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
|
374 |
$_channelShipment = Mage::getModel('channelengine/shipment')
|
375 |
-
->setShipmentId($_shipment->getId())
|
376 |
-
->setChannelengineShipmentId($result->getId());
|
377 |
$_channelShipment->save();
|
378 |
|
379 |
-
Mage::log("Shipment #{$_shipment->getId()}
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
Mage::getModel('adminnotification/inbox')->addCritical(
|
386 |
-
"A shipment (#{$_shipment->getId()}) could not be exported",
|
387 |
-
"Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
388 |
-
);
|
389 |
-
|
390 |
Mage::logException($e);
|
391 |
-
|
392 |
}
|
393 |
-
|
394 |
|
395 |
return true;
|
396 |
}
|
@@ -402,46 +462,38 @@ class Tritac_ChannelEngine_Model_Observer
|
|
402 |
*/
|
403 |
public function fetchReturns()
|
404 |
{
|
405 |
-
|
406 |
-
* Check if client is initialized
|
407 |
-
*/
|
408 |
-
if(is_null($this->_client))
|
409 |
-
return false;
|
410 |
|
411 |
-
foreach($this->_client as $storeId => $
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
$
|
416 |
-
Tritac_ChannelEngineApiClient_Enums_ReturnStatus::DECLARED
|
417 |
-
));
|
418 |
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
|
425 |
-
|
426 |
-
$_channelOrder = Mage::getModel('channelengine/order')->loadByChannelOrderId($return->getOrderId());
|
427 |
-
$_order = Mage::getModel('sales/order')->load($_channelOrder->getOrderId());
|
428 |
|
429 |
-
|
430 |
-
|
431 |
-
|
|
|
432 |
|
|
|
433 |
|
434 |
-
$link = "https://". $this->_config[$storeId]['general']['tenant'] .".channelengine.net/
|
435 |
-
$
|
436 |
-
$
|
437 |
-
|
438 |
-
$message = "Magento Order #: <a href='".
|
439 |
-
Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id'=>$_order->getOrderId())).
|
440 |
"'>".
|
441 |
$_order->getIncrementId().
|
442 |
"</a><br />";
|
443 |
-
$message .= "
|
444 |
-
$message .= "Reason: {$
|
445 |
$message .= "For more details visit ChannelEngine your <a href='".$link."' target='_blank'>account</a>";
|
446 |
|
447 |
// Check if notification is already exist
|
@@ -454,16 +506,10 @@ class Tritac_ChannelEngine_Model_Observer
|
|
454 |
->limit(1);
|
455 |
$data = $_connectionRead->fetchRow($select);
|
456 |
|
457 |
-
if ($data)
|
458 |
-
continue;
|
459 |
-
}
|
460 |
|
461 |
// Add new notification
|
462 |
-
Mage::getModel('adminnotification/inbox')->addCritical(
|
463 |
-
$title,
|
464 |
-
$message,
|
465 |
-
$link
|
466 |
-
);
|
467 |
}
|
468 |
}
|
469 |
}
|
@@ -504,12 +550,15 @@ class Tritac_ChannelEngine_Model_Observer
|
|
504 |
* Export products from each store.
|
505 |
* Note: products with undefined website id will not be export.
|
506 |
*/
|
507 |
-
foreach(Mage::app()->getStores() as $_store)
|
508 |
-
|
|
|
|
|
509 |
$path = Mage::getBaseDir('media') . DS . 'channelengine' . DS;
|
510 |
$storeConfig = $this->_helper->getConfig($_store->getId());
|
511 |
$name = $storeConfig['general']['tenant'].'_products.xml';
|
512 |
$file = $path . DS . $name;
|
|
|
513 |
|
514 |
$io = new Varien_Io_File();
|
515 |
$io->setAllowCreateFolders(true);
|
@@ -517,7 +566,8 @@ class Tritac_ChannelEngine_Model_Observer
|
|
517 |
$io->streamOpen($file, 'w+');
|
518 |
$io->streamLock(true);
|
519 |
$io->streamWrite('<?xml version="1.0" encoding="UTF-8"?>' . "\n");
|
520 |
-
$io->streamWrite('<Products xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
|
521 |
|
522 |
/**
|
523 |
* Prepare custom options array
|
@@ -542,16 +592,19 @@ class Tritac_ChannelEngine_Model_Observer
|
|
542 |
/**
|
543 |
* Retrieve product collection with all visible attributes
|
544 |
*/
|
545 |
-
|
546 |
-
|
547 |
-
}
|
548 |
-
$collection = Mage::getModel('catalog/product')->getCollection();
|
549 |
|
550 |
-
|
551 |
-
|
552 |
-
|
|
|
|
|
|
|
553 |
|
554 |
-
$
|
|
|
|
|
555 |
'name',
|
556 |
'description',
|
557 |
'image',
|
@@ -565,35 +618,33 @@ class Tritac_ChannelEngine_Model_Observer
|
|
565 |
'msrp'
|
566 |
);
|
567 |
|
568 |
-
$
|
569 |
-
$attributes = Mage::
|
570 |
-
->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection();
|
571 |
|
572 |
-
foreach($attributes as $attribute)
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
$visibleAttributes[$code]['label'] = $attribute->getFrontendLabel();
|
578 |
|
579 |
-
|
580 |
-
|
581 |
-
}
|
582 |
-
if(!in_array($code, $attributesToSelect)) {
|
583 |
-
$attributesToSelect[] = $code;
|
584 |
-
}
|
585 |
-
}
|
586 |
-
}
|
587 |
|
588 |
-
|
589 |
-
$attributesToSelect[] = $this->_config[$storeId]['feed']['gtin'];
|
590 |
-
}
|
591 |
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
}
|
598 |
|
599 |
$collection->addAttributeToSelect($attributesToSelect, 'left')
|
@@ -620,7 +671,6 @@ class Tritac_ChannelEngine_Model_Observer
|
|
620 |
)
|
621 |
->group('e.entity_id');
|
622 |
|
623 |
-
|
624 |
Mage::getSingleton('core/resource_iterator')->walk(
|
625 |
$collection->getSelect(),
|
626 |
array(array($this, 'callbackGenerateFeed')),
|
@@ -859,6 +909,7 @@ class Tritac_ChannelEngine_Model_Observer
|
|
859 |
if(isset($additional['attributes'])) {
|
860 |
$xml .= '<Attributes>';
|
861 |
foreach($additional['attributes'] as $code => $attribute) {
|
|
|
862 |
if(isset($product[$code]) && !in_array($code, $additional['systemAttributes'])) {
|
863 |
$xml .= "<".$code.">";
|
864 |
/*$xml .= "<label><![CDATA[".$attribute['label']."]]></label>";
|
2 |
/**
|
3 |
* Observer model
|
4 |
*/
|
5 |
+
|
6 |
+
use ChannelEngine\ApiClient\ApiClient;
|
7 |
+
use ChannelEngine\ApiClient\Configuration;
|
8 |
+
|
9 |
+
use ChannelEngine\ApiClient\Api\OrderApi;
|
10 |
+
use ChannelEngine\ApiClient\Api\ShipmentApi;
|
11 |
+
use ChannelEngine\ApiClient\Api\CancellationApi;
|
12 |
+
use ChannelEngine\ApiClient\Api\ReturnApi;
|
13 |
+
|
14 |
+
use ChannelEngine\ApiClient\Model\MerchantOrderResponse;
|
15 |
+
use ChannelEngine\ApiClient\Model\OrderAcknowledgement;
|
16 |
+
use ChannelEngine\ApiClient\Model\MerchantShipmentRequest;
|
17 |
+
use ChannelEngine\ApiClient\Model\MerchantShipmentTrackingRequest;
|
18 |
+
use ChannelEngine\ApiClient\Model\MerchantShipmentLineRequest;
|
19 |
+
|
20 |
class Tritac_ChannelEngine_Model_Observer
|
21 |
{
|
22 |
/**
|
23 |
* API client
|
24 |
*
|
25 |
+
* @var ChannelEngine\ApiClient\ApiClient
|
26 |
*/
|
27 |
protected $_client = null;
|
28 |
|
42 |
|
43 |
const ATTRIBUTES_LIMIT = 30;
|
44 |
|
45 |
+
private $_hasPostNL = false;
|
46 |
+
|
47 |
/**
|
48 |
* Retrieve and validate API config
|
49 |
* Initialize API client
|
51 |
public function __construct()
|
52 |
{
|
53 |
$this->_helper = Mage::helper('channelengine');
|
54 |
+
$this->_hasPostNL = Mage::helper('core')->isModuleEnabled('TIG_PostNL');
|
55 |
+
|
56 |
$this->_config = $this->_helper->getConfig();
|
57 |
/**
|
58 |
* Check required config parameters. Initialize API client.
|
59 |
*/
|
60 |
foreach($this->_config as $storeId => $storeConfig) {
|
61 |
if($this->_helper->checkGeneralConfig($storeId)) {
|
62 |
+
$apiConfig = new Configuration();
|
63 |
+
|
64 |
+
$apiConfig->setApiKey('apikey', $storeConfig['general']['api_key']);
|
65 |
+
$apiConfig->setHost('https://'.$storeConfig['general']['tenant'].'.channelengine.net/api');
|
66 |
+
|
67 |
+
$client = new ApiClient($apiConfig);
|
68 |
+
$this->_client[$storeId] = $client;
|
69 |
}
|
70 |
}
|
71 |
}
|
72 |
|
73 |
+
private function logApiError($storeId, $apiResponse)
|
74 |
+
{
|
75 |
+
Mage::log(
|
76 |
+
'Failed to make ChannelEngine API call '. $storeId . "\r\n" .
|
77 |
+
'['.$response->getStatusCode().'] ' . $response->getMessage()
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
/**
|
82 |
* Fetch new orders from ChannelEngine.
|
83 |
* Ran by cron. The cronjob is set in extension config file.
|
89 |
/**
|
90 |
* Check if client is initialized
|
91 |
*/
|
92 |
+
if(is_null($this->_client)) return false;
|
|
|
93 |
|
94 |
+
foreach($this->_client as $storeId => $client)
|
95 |
+
{
|
96 |
+
$orderApi = new OrderApi($client);
|
|
|
|
|
|
|
|
|
97 |
|
98 |
+
$response = $orderApi->orderGetNew();
|
99 |
+
if(!$response->getSuccess())
|
100 |
+
{
|
101 |
+
$this->logApiError($storeId, $response);
|
102 |
continue;
|
103 |
+
}
|
104 |
|
105 |
+
if($response->getCount() == 0) continue;
|
|
|
|
|
106 |
|
107 |
+
foreach($response->getContent() as $order)
|
108 |
+
{
|
109 |
$billingAddress = $order->getBillingAddress();
|
110 |
$shippingAddress = $order->getShippingAddress();
|
|
|
111 |
|
112 |
$lines = $order->getLines();
|
113 |
|
114 |
+
if(count($lines) == 0 || empty($billingAddress)) continue;
|
115 |
|
116 |
+
// Initialize new quote
|
117 |
+
$quote = Mage::getModel('sales/quote')->setStoreId($storeId);
|
118 |
+
|
119 |
+
foreach($lines as $item)
|
120 |
+
{
|
121 |
+
$productNo = $item->getMerchantProductNo();
|
122 |
+
|
123 |
+
$ids = explode('_', $productNo);
|
124 |
+
$productId = $ids[0];
|
125 |
+
$productOptions = array();
|
126 |
+
if(count($ids) == 3) {
|
127 |
+
$productOptions = array($ids[1] => intval($ids[2]));
|
128 |
+
}
|
129 |
|
130 |
+
// Load magento product
|
131 |
+
$_product = Mage::getModel('catalog/product')->setStoreId($storeId);
|
132 |
+
$_product->load($productId);
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
+
if(!$_product->getId())
|
135 |
+
{
|
136 |
+
// If the product can't be found by ID, fall back on the SKU.
|
137 |
+
$productId = $_product->getIdBySku($productNo);
|
138 |
$_product->load($productId);
|
139 |
+
}
|
140 |
|
141 |
+
// Prepare product parameters for quote
|
142 |
+
$params = new Varien_Object();
|
143 |
+
$params->setQty($item->getQuantity());
|
144 |
+
$params->setOptions($productOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
+
// Add product to quote
|
147 |
+
try
|
148 |
+
{
|
149 |
+
$_quoteItem = $quote->addProduct($_product, $params);
|
150 |
+
|
151 |
+
if(is_string($_quoteItem))
|
152 |
+
{
|
153 |
+
// Magento sometimes returns a string when the method fails. -_-"
|
154 |
+
Mage::throwException('Failed to create quote item: ' . $_quoteItem);
|
155 |
+
}
|
156 |
|
157 |
+
$price = $item->getUnitPriceInclVat();
|
158 |
+
$_quoteItem->setOriginalCustomPrice($price);
|
159 |
+
$_quoteItem->setCustomPrice($price);
|
160 |
+
$_quoteItem->getProduct()->setIsSuperMode(true);
|
161 |
+
$_quoteItem->setChannelengineOrderLineId($item->getChannelProductNo());
|
162 |
|
|
|
163 |
|
164 |
+
}
|
165 |
+
catch (Exception $e)
|
166 |
+
{
|
167 |
+
Mage::getModel('adminnotification/inbox')->addCritical(
|
168 |
+
"An order ({$order->getChannelName()} #{$order->getChannelOrderNo()}) could not be imported",
|
169 |
+
"Failed add product to order: #{$productNo}. Reason: {$e->getMessage()} Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
170 |
+
);
|
171 |
+
Mage::logException($e);
|
172 |
+
break;
|
173 |
}
|
174 |
}
|
175 |
|
187 |
'postcode' => $billingAddress->getZipCode(),
|
188 |
'city' => $billingAddress->getCity(),
|
189 |
'street' =>
|
190 |
+
$billingAddress->getStreetName()."\n".
|
191 |
$billingAddress->getHouseNr().
|
192 |
$billingAddress->getHouseNrAddition()
|
193 |
);
|
202 |
'postcode' => $shippingAddress->getZipCode(),
|
203 |
'city' => $shippingAddress->getCity(),
|
204 |
'street' =>
|
205 |
+
$shippingAddress->getStreetName()."\n".
|
206 |
$shippingAddress->getHouseNr().
|
207 |
$shippingAddress->getHouseNrAddition()
|
208 |
);
|
235 |
$quote->getPayment()->importData(array('method' => 'channelengine'));
|
236 |
|
237 |
// Save quote and convert it to new order
|
238 |
+
try
|
239 |
+
{
|
240 |
$quote->save();
|
|
|
241 |
$service = Mage::getModel('sales/service_quote', $quote);
|
|
|
242 |
$service->submitAll();
|
243 |
+
}
|
244 |
+
catch (Exception $e)
|
245 |
+
{
|
246 |
Mage::getModel('adminnotification/inbox')->addCritical(
|
247 |
+
"An order ({$order->getChannelName()} #{$order->getChannelOrderNo()}) could not be imported",
|
248 |
"Reason: {$e->getMessage()} Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
249 |
);
|
250 |
Mage::logException($e);
|
251 |
continue;
|
252 |
}
|
253 |
|
254 |
+
$magentoOrder = $service->getOrder();
|
255 |
|
256 |
+
if(!$magentoOrder->getIncrementId())
|
257 |
+
{
|
258 |
+
Mage::log("An order (#{$order->getId()}) could not be imported");
|
259 |
+
continue;
|
260 |
+
}
|
261 |
|
262 |
+
try
|
263 |
+
{
|
264 |
+
// Initialize new invoice model
|
265 |
+
$invoice = Mage::getModel('sales/service_order', $magentoOrder)->prepareInvoice();
|
266 |
+
// Add comment to invoice
|
267 |
+
$invoice->addComment(
|
268 |
+
"Order paid on the marketplace.",
|
269 |
+
false,
|
270 |
+
true
|
271 |
+
);
|
272 |
|
273 |
+
// Register invoice. Register invoice items. Collect invoice totals.
|
274 |
+
$invoice->register();
|
275 |
+
$invoice->getOrder()->setIsInProcess(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
+
$os = $order->getChannelOrderSupport();
|
278 |
+
$canShipPartiallyItem = ($os == MerchantOrderResponse::CHANNEL_ORDER_SUPPORT_SPLIT_ORDER_LINES);
|
279 |
+
$canShipPartially = ($canShipPartiallyItem || $os == MerchantOrderResponse::CHANNEL_ORDER_SUPPORT_SPLIT_ORDERS);
|
280 |
+
|
281 |
+
|
282 |
+
// Initialize new channel order
|
283 |
+
$_channelOrder = Mage::getModel('channelengine/order');
|
284 |
+
$_channelOrder->setOrderId($magentoOrder->getId())
|
285 |
+
->setChannelOrderId($order->getChannelOrderNo())
|
286 |
+
->setChannelName($order->getChannelName())
|
287 |
+
->setCanShipPartial($canShipPartially);
|
288 |
+
|
289 |
+
$invoice->getOrder()
|
290 |
+
->setCanShipPartiallyItem($canShipPartiallyItem)
|
291 |
+
->setCanShipPartially($canShipPartially);
|
292 |
+
|
293 |
+
// Start new transaction
|
294 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
295 |
+
->addObject($invoice)
|
296 |
+
->addObject($invoice->getOrder())
|
297 |
+
->addObject($_channelOrder);
|
298 |
+
$transactionSave->save();
|
299 |
+
|
300 |
+
|
301 |
+
// Send order acknowledgement to CE.
|
302 |
+
$ack = new OrderAcknowledgement();
|
303 |
+
$ack->setMerchantOrderNo($magentoOrder->getId());
|
304 |
+
$ack->setOrderId($order->getId());
|
305 |
+
$orderApi->orderAcknowledge($ack);
|
306 |
+
|
307 |
+
}
|
308 |
+
catch (Exception $e)
|
309 |
+
{
|
310 |
+
Mage::getModel('adminnotification/inbox')->addCritical(
|
311 |
+
"An invoice could not be created (order #{$magentoOrder->getIncrementId()}, {$order->getChannelName()} #{$order->getChannelOrderNo()})",
|
312 |
+
"Reason: {$e->getMessage()} Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792"
|
313 |
+
);
|
314 |
+
Mage::logException($e);
|
315 |
+
continue;
|
316 |
}
|
317 |
+
|
318 |
+
Mage::log("Order #{$magentoOrder->getIncrementId()} was imported successfully.");
|
319 |
}
|
320 |
}
|
321 |
|
334 |
$event = $observer->getEvent();
|
335 |
/** @var $_shipment Mage_Sales_Model_Order_Shipment */
|
336 |
$_shipment = $event->getShipment();
|
|
|
337 |
/** @var $_order Mage_Sales_Model_Order */
|
338 |
$_order = $_shipment->getOrder();
|
339 |
+
|
340 |
$storeId = $_order->getStoreId();
|
341 |
+
|
342 |
$ceOrder = Mage::getModel('channelengine/order')->loadByOrderId($_order->getId());
|
343 |
+
if($ceOrder->getId() == null) return true;
|
344 |
+
|
345 |
+
$errorTitle = "A shipment (#{$_shipment->getId()}) could not be updated";
|
346 |
+
$errorMessage = "Please contact ChannelEngine support at <a href='mailto:support@channelengine.com'>support@channelengine.com</a> or +31(0)71-5288792";
|
347 |
|
|
|
|
|
348 |
// Check if the API client was initialized for this order
|
349 |
if(!isset($this->_client[$storeId])) return false;
|
350 |
|
351 |
+
$shipmentApi = new ShipmentApi($this->_client[$storeId]);
|
352 |
+
|
353 |
// Initialize new ChannelEngine shipment object
|
354 |
+
$ceShipment = new MerchantShipmentRequest();
|
355 |
+
$ceShipment->setMerchantOrderNo($_order->getId());
|
356 |
$ceShipment->setMerchantShipmentNo($_shipment->getId());
|
357 |
|
358 |
// Set tracking info if available
|
|
|
359 |
$trackingCodes = $_shipment->getAllTracks();
|
360 |
+
|
361 |
+
if(count($trackingCodes) > 0)
|
362 |
+
{
|
363 |
$trackingCode = $trackingCodes[0];
|
364 |
$ceShipment->setTrackTraceNo($trackingCode->getNumber());
|
365 |
+
$ceShipment->setMethod(($trackingCode->getCarrierCode() == 'custom') ? $trackingCode->getTitle() : $trackingCode->getCarrierCode());
|
366 |
+
}
|
367 |
+
|
368 |
+
// Post NL support, in case of a leter box parcel, we can safely omit the tracking code.
|
369 |
+
if($this->_hasPostNL)
|
370 |
+
{
|
371 |
+
$postnlShipment = Mage::getModel('postnl_core/shipment')->load($_shipment->getId(), 'shipment_id');
|
372 |
+
if($postnlShipment->getId() != null && $postnlShipment->getIsBuspakje())
|
373 |
+
{
|
374 |
+
$ceShipment->setMethod('Briefpost');
|
375 |
+
}
|
376 |
}
|
377 |
|
378 |
// If the shipment is already known to ChannelEngine we will just update it
|
379 |
$_channelShipment = Mage::getModel('channelengine/shipment')->loadByShipmentId($_shipment->getId());
|
380 |
|
381 |
+
if($_channelShipment->getId() != null)
|
382 |
+
{
|
383 |
+
$ceShipmentUpdate = new MerchantShipmentTrackingRequest();
|
384 |
+
$ceShipmentUpdate->setTrackTraceNo($ceShipment->getTrackTraceNo());
|
385 |
+
$ceShipmentUpdate->setTrackTraceNo($ceShipment->getMethod());
|
386 |
|
387 |
+
try
|
388 |
+
{
|
389 |
+
$response = $shipmentApi->shipmentUpdate($_shipment->getId(), $ceShipmentUpdate);
|
390 |
+
if(!$response->getSuccess())
|
391 |
+
{
|
392 |
+
$this->logApiError($storeId, $response);
|
393 |
+
Mage::getModel('adminnotification/inbox')->addCritical($errorTitle, $errorMessage);
|
394 |
+
return false;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
catch(Exception $e)
|
398 |
+
{
|
399 |
+
//Mage::getModel('adminnotification/inbox')->addCritical($errorTitle, $errorMessage);
|
400 |
+
Mage::logException($e);
|
401 |
+
return false;
|
402 |
}
|
403 |
|
|
|
|
|
|
|
404 |
return true;
|
405 |
}
|
406 |
|
|
|
|
|
407 |
// Add the shipment lines
|
408 |
+
$ceShipmentLines = [];
|
409 |
+
foreach($_shipment->getAllItems() as $_shipmentItem)
|
410 |
+
{
|
411 |
// Get the quantity for this shipment
|
412 |
$shippedQty = (int)$_shipmentItem->getQty();
|
413 |
if($shippedQty == 0) continue;
|
416 |
$_orderItem = Mage::getModel('sales/order_item')->load($_shipmentItem->getOrderItemId());
|
417 |
if($_orderItem == null) continue;
|
418 |
|
419 |
+
$ceShipmentLine = new MerchantShipmentLineRequest();
|
420 |
+
$ceShipmentLine->setMerchantProductNo($_shipmentItem->getProductId());
|
421 |
$ceShipmentLine->setQuantity($shippedQty);
|
422 |
+
$ceShipmentLines[] = $ceShipmentLine;
|
|
|
|
|
423 |
}
|
424 |
|
425 |
// Check if there are any shipment lines
|
428 |
$ceShipment->setLines($ceShipmentLines);
|
429 |
|
430 |
// Post shipment to ChannelEngine
|
431 |
+
try
|
432 |
+
{
|
433 |
+
$response = $shipmentApi->shipmentCreate($ceShipment);
|
434 |
+
|
435 |
+
if(!$response->getSuccess())
|
436 |
+
{
|
437 |
+
$this->logApiError($storeId, $response);
|
438 |
+
Mage::getModel('adminnotification/inbox')->addCritical($errorTitle, $errorMessage);
|
439 |
+
return false;
|
440 |
+
}
|
441 |
|
442 |
$_channelShipment = Mage::getModel('channelengine/shipment')
|
443 |
+
->setShipmentId($_shipment->getId());
|
|
|
444 |
$_channelShipment->save();
|
445 |
|
446 |
+
Mage::log("Shipment #{$_shipment->getId()} was placed successfully.");
|
447 |
+
}
|
448 |
+
catch(Exception $e)
|
449 |
+
{
|
450 |
+
Mage::getModel('adminnotification/inbox')->addCritical($errorTitle, $errorMessage);
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
Mage::logException($e);
|
452 |
+
return false;
|
453 |
}
|
|
|
454 |
|
455 |
return true;
|
456 |
}
|
462 |
*/
|
463 |
public function fetchReturns()
|
464 |
{
|
465 |
+
if(is_null($this->_client)) return false;
|
|
|
|
|
|
|
|
|
466 |
|
467 |
+
foreach($this->_client as $storeId => $client)
|
468 |
+
{
|
469 |
+
$returnApi = new ReturnApi($client);
|
470 |
+
$lastUpdatedAt = new DateTime('-1 day');
|
471 |
+
$response = $returnApi->returnGetDeclaredByChannel($lastUpdatedAt);
|
|
|
|
|
472 |
|
473 |
+
if(!$response->getSuccess())
|
474 |
+
{
|
475 |
+
$this->logApiError($storeId, $response);
|
476 |
+
continue;
|
477 |
+
}
|
478 |
|
479 |
+
if($response->getCount() == 0) continue;
|
|
|
|
|
480 |
|
481 |
+
foreach($response->getContent() as $return)
|
482 |
+
{
|
483 |
+
//$_channelOrder = Mage::getModel('channelengine/order')->loadByChannelOrderId($return->getOrderId());
|
484 |
+
$_order = Mage::getModel('sales/order')->load($return->getMerchantOrderNo());
|
485 |
|
486 |
+
if(!$_order->getIncrementId()) continue;
|
487 |
|
488 |
+
$link = "https://". $this->_config[$storeId]['general']['tenant'] .".channelengine.net/returns";
|
489 |
+
$title = "A new return was declared in ChannelEngine for order #" . $_order->getIncrementId();
|
490 |
+
$message = "Magento Order #<a href='".
|
491 |
+
Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $_order->getId())).
|
|
|
|
|
492 |
"'>".
|
493 |
$_order->getIncrementId().
|
494 |
"</a><br />";
|
495 |
+
$message .= "Comment: {$return->getCustomerComment()}<br />";
|
496 |
+
$message .= "Reason: {$return->getReason()}<br />";
|
497 |
$message .= "For more details visit ChannelEngine your <a href='".$link."' target='_blank'>account</a>";
|
498 |
|
499 |
// Check if notification is already exist
|
506 |
->limit(1);
|
507 |
$data = $_connectionRead->fetchRow($select);
|
508 |
|
509 |
+
if ($data) continue;
|
|
|
|
|
510 |
|
511 |
// Add new notification
|
512 |
+
Mage::getModel('adminnotification/inbox')->addCritical($title, $message);
|
|
|
|
|
|
|
|
|
513 |
}
|
514 |
}
|
515 |
}
|
550 |
* Export products from each store.
|
551 |
* Note: products with undefined website id will not be export.
|
552 |
*/
|
553 |
+
foreach(Mage::app()->getStores() as $_store)
|
554 |
+
{
|
555 |
+
Mage::app()->setCurrentStore($_store);
|
556 |
+
|
557 |
$path = Mage::getBaseDir('media') . DS . 'channelengine' . DS;
|
558 |
$storeConfig = $this->_helper->getConfig($_store->getId());
|
559 |
$name = $storeConfig['general']['tenant'].'_products.xml';
|
560 |
$file = $path . DS . $name;
|
561 |
+
$date = date('c');
|
562 |
|
563 |
$io = new Varien_Io_File();
|
564 |
$io->setAllowCreateFolders(true);
|
566 |
$io->streamOpen($file, 'w+');
|
567 |
$io->streamLock(true);
|
568 |
$io->streamWrite('<?xml version="1.0" encoding="UTF-8"?>' . "\n");
|
569 |
+
$io->streamWrite('<Products xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
570 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" GeneratedAt="'.$date.'">' . "\n");
|
571 |
|
572 |
/**
|
573 |
* Prepare custom options array
|
592 |
/**
|
593 |
* Retrieve product collection with all visible attributes
|
594 |
*/
|
595 |
+
$collection = Mage::getResourceModel('catalog/product_collection');
|
596 |
+
$collection->getEntity()->setStoreId($storeId);
|
|
|
|
|
597 |
|
598 |
+
$flatCatalogEnabled = $collection->isEnabledFlat();
|
599 |
+
|
600 |
+
// Make sure to create a new instance of our collection after setting the store ID
|
601 |
+
// when using the flat catalog. Otherwise store ID will be ignored. This is a bug in magento.
|
602 |
+
// https://magento.stackexchange.com/a/25908
|
603 |
+
if($flatCatalogEnabled) $collection = Mage::getResourceModel('catalog/product_collection');
|
604 |
|
605 |
+
$visibleAttributes = array();
|
606 |
+
$systemAttributes = array();
|
607 |
+
$attributesToSelect = array(
|
608 |
'name',
|
609 |
'description',
|
610 |
'image',
|
618 |
'msrp'
|
619 |
);
|
620 |
|
621 |
+
if(!empty($this->_config[$storeId]['feed']['gtin'])) $attributesToSelect[] = $this->_config[$storeId]['feed']['gtin'];
|
622 |
+
$attributes = Mage::getResourceModel('catalog/product_attribute_collection');
|
|
|
623 |
|
624 |
+
foreach($attributes as $attribute)
|
625 |
+
{
|
626 |
+
$code = $attribute->getAttributeCode();
|
627 |
+
$isFlat = $flatCatalogEnabled && $attribute->getUsedInProductListing();
|
628 |
+
$isRegular = !$flatCatalogEnabled && $attribute->getIsVisible() && $attribute->getIsVisibleOnFront();
|
|
|
629 |
|
630 |
+
// Only allow a subset of system attributes
|
631 |
+
$isSystem = !$attribute->getIsUserDefined();
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
|
633 |
+
if(!$isFlat && !$isRegular || in_array($code, $attributesToSelect)) continue;
|
|
|
|
|
634 |
|
635 |
+
if($isSystem)
|
636 |
+
{
|
637 |
+
$systemAttributes[] = $code;
|
638 |
+
continue;
|
639 |
+
}
|
640 |
+
|
641 |
+
$attributesToSelect[] = $code;
|
642 |
+
|
643 |
+
$visibleAttributes[$code]['label'] = $attribute->getFrontendLabel();
|
644 |
+
foreach($attribute->getSource()->getAllOptions(false) as $option)
|
645 |
+
{
|
646 |
+
$visibleAttributes[$code]['values'][$option['value']] = $option['label'];
|
647 |
+
}
|
648 |
}
|
649 |
|
650 |
$collection->addAttributeToSelect($attributesToSelect, 'left')
|
671 |
)
|
672 |
->group('e.entity_id');
|
673 |
|
|
|
674 |
Mage::getSingleton('core/resource_iterator')->walk(
|
675 |
$collection->getSelect(),
|
676 |
array(array($this, 'callbackGenerateFeed')),
|
909 |
if(isset($additional['attributes'])) {
|
910 |
$xml .= '<Attributes>';
|
911 |
foreach($additional['attributes'] as $code => $attribute) {
|
912 |
+
|
913 |
if(isset($product[$code]) && !in_array($code, $additional['systemAttributes'])) {
|
914 |
$xml .= "<".$code.">";
|
915 |
/*$xml .= "<label><![CDATA[".$attribute['label']."]]></label>";
|
app/code/community/Tritac/ChannelEngine/controllers/Adminhtml/GenerateController.php
CHANGED
@@ -1,12 +1,27 @@
|
|
1 |
<?php
|
2 |
class Tritac_ChannelEngine_Adminhtml_GenerateController extends Mage_Adminhtml_Controller_Action
|
3 |
{
|
4 |
-
public function ajaxAction()
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
6 |
$observer = Mage::getModel('channelengine/observer');
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
}
|
12 |
}
|
1 |
<?php
|
2 |
class Tritac_ChannelEngine_Adminhtml_GenerateController extends Mage_Adminhtml_Controller_Action
|
3 |
{
|
4 |
+
public function ajaxAction()
|
5 |
+
{
|
6 |
+
$observer = Mage::getModel('channelengine/observer');
|
7 |
+
$res = $this->getResponse();
|
8 |
+
$res->setHeader('Content-type', 'application/json');
|
9 |
+
if($observer->generateFeed()) $res->setBody(1);
|
10 |
+
}
|
11 |
|
12 |
+
public function importOrdersAction()
|
13 |
+
{
|
14 |
$observer = Mage::getModel('channelengine/observer');
|
15 |
+
$res = $this->getResponse();
|
16 |
+
$res->setHeader('Content-type', 'application/json');
|
17 |
+
if($observer->fetchNewOrders()) $res->setBody(1);
|
18 |
+
}
|
19 |
|
20 |
+
public function importReturnsAction()
|
21 |
+
{
|
22 |
+
$observer = Mage::getModel('channelengine/observer');
|
23 |
+
$res = $this->getResponse();
|
24 |
+
$res->setHeader('Content-type', 'application/json');
|
25 |
+
if($observer->fetchReturns()) $res->setBody(1);
|
26 |
}
|
27 |
}
|
app/code/community/Tritac/ChannelEngine/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tritac_ChannelEngine>
|
5 |
-
<version>3.
|
6 |
</Tritac_ChannelEngine>
|
7 |
</modules>
|
8 |
|
@@ -130,6 +130,15 @@
|
|
130 |
</shipmentsave>
|
131 |
</observers>
|
132 |
</sales_order_shipment_save_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
<!--<core_block_abstract_prepare_layout_before>
|
134 |
<observers>
|
135 |
<ordergrid_column_append>
|
@@ -165,30 +174,41 @@
|
|
165 |
|
166 |
<crontab>
|
167 |
<jobs>
|
168 |
-
<
|
169 |
<schedule>
|
170 |
-
<cron_expr>*/
|
171 |
</schedule>
|
172 |
<run>
|
173 |
<model>channelengine/observer::fetchNewOrders</model>
|
174 |
</run>
|
175 |
-
</
|
176 |
-
<
|
177 |
<schedule>
|
178 |
-
<cron_expr>*/
|
179 |
</schedule>
|
180 |
<run>
|
181 |
<model>channelengine/observer::fetchReturns</model>
|
182 |
</run>
|
183 |
-
</
|
184 |
-
<
|
185 |
<schedule>
|
186 |
<cron_expr>30 * * * *</cron_expr>
|
187 |
</schedule>
|
188 |
<run>
|
189 |
<model>channelengine/observer::generateFeed</model>
|
190 |
</run>
|
191 |
-
</
|
192 |
</jobs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
</crontab>
|
194 |
</config>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Tritac_ChannelEngine>
|
5 |
+
<version>4.3.0</version>
|
6 |
</Tritac_ChannelEngine>
|
7 |
</modules>
|
8 |
|
130 |
</shipmentsave>
|
131 |
</observers>
|
132 |
</sales_order_shipment_save_after>
|
133 |
+
<resource_get_tablename>
|
134 |
+
<observers>
|
135 |
+
<channelengine_composer_autoloader>
|
136 |
+
<type>singleton</type>
|
137 |
+
<class>channelengine/loader</class>
|
138 |
+
<method>addComposerAutoloader</method>
|
139 |
+
</channelengine_composer_autoloader>
|
140 |
+
</observers>
|
141 |
+
</resource_get_tablename>
|
142 |
<!--<core_block_abstract_prepare_layout_before>
|
143 |
<observers>
|
144 |
<ordergrid_column_append>
|
174 |
|
175 |
<crontab>
|
176 |
<jobs>
|
177 |
+
<channelengine_import_orders>
|
178 |
<schedule>
|
179 |
+
<cron_expr>*/5 * * * *</cron_expr>
|
180 |
</schedule>
|
181 |
<run>
|
182 |
<model>channelengine/observer::fetchNewOrders</model>
|
183 |
</run>
|
184 |
+
</channelengine_import_orders>
|
185 |
+
<channelengine_import_returns>
|
186 |
<schedule>
|
187 |
+
<cron_expr>*/5 * * * *</cron_expr>
|
188 |
</schedule>
|
189 |
<run>
|
190 |
<model>channelengine/observer::fetchReturns</model>
|
191 |
</run>
|
192 |
+
</channelengine_import_returns>
|
193 |
+
<channelengine_generate_feed>
|
194 |
<schedule>
|
195 |
<cron_expr>30 * * * *</cron_expr>
|
196 |
</schedule>
|
197 |
<run>
|
198 |
<model>channelengine/observer::generateFeed</model>
|
199 |
</run>
|
200 |
+
</channelengine_generate_feed>
|
201 |
</jobs>
|
202 |
+
<events>
|
203 |
+
<resource_get_tablename>
|
204 |
+
<observers>
|
205 |
+
<channelengine_composer_autoloader>
|
206 |
+
<type>singleton</type>
|
207 |
+
<class>channelengine/loader</class>
|
208 |
+
<method>addComposerAutoloader</method>
|
209 |
+
</channelengine_composer_autoloader>
|
210 |
+
</observers>
|
211 |
+
</resource_get_tablename>
|
212 |
+
</events>
|
213 |
</crontab>
|
214 |
</config>
|
app/code/community/Tritac/ChannelEngine/etc/system.xml
CHANGED
@@ -33,14 +33,6 @@
|
|
33 |
<show_in_website>0</show_in_website>
|
34 |
<show_in_store>1</show_in_store>
|
35 |
</api_key>
|
36 |
-
<api_secret translate="label">
|
37 |
-
<label>Api Secret</label>
|
38 |
-
<frontend_type>text</frontend_type>
|
39 |
-
<sort_order>2</sort_order>
|
40 |
-
<show_in_default>0</show_in_default>
|
41 |
-
<show_in_website>0</show_in_website>
|
42 |
-
<show_in_store>1</show_in_store>
|
43 |
-
</api_secret>
|
44 |
<tenant translate="label">
|
45 |
<label>Account Name</label>
|
46 |
<frontend_type>text</frontend_type>
|
33 |
<show_in_website>0</show_in_website>
|
34 |
<show_in_store>1</show_in_store>
|
35 |
</api_key>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
<tenant translate="label">
|
37 |
<label>Account Name</label>
|
38 |
<frontend_type>text</frontend_type>
|
lib/ChannelEngine/.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
*
|
2 |
+
!.gitignore
|
lib/Tritac/ChannelEngineApiClient/AddTrustExternalCARoot.crt
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
-----BEGIN CERTIFICATE-----
|
2 |
-
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
|
3 |
-
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
|
4 |
-
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
|
5 |
-
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
|
6 |
-
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
|
7 |
-
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
|
8 |
-
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
|
9 |
-
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
|
10 |
-
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
|
11 |
-
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
|
12 |
-
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
|
13 |
-
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
|
14 |
-
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
|
15 |
-
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
|
16 |
-
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
|
17 |
-
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
|
18 |
-
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
|
19 |
-
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
|
20 |
-
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
|
21 |
-
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
|
22 |
-
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
|
23 |
-
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
|
24 |
-
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
|
25 |
-
-----END CERTIFICATE-----
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Client.php
DELETED
@@ -1,282 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Client {
|
4 |
-
|
5 |
-
private $environment;
|
6 |
-
private $tenant;
|
7 |
-
private $certificate;
|
8 |
-
|
9 |
-
private $apiUrl;
|
10 |
-
private $apiKey;
|
11 |
-
private $apiSecret;
|
12 |
-
|
13 |
-
private $lastRepresentation;
|
14 |
-
|
15 |
-
const FIDDLER_PROXY = '127.0.0.1:8888';
|
16 |
-
const USE_FIDDLER = false;
|
17 |
-
const FIDDLER_CERTIFICATE_PATH = 'fiddler.crt';
|
18 |
-
|
19 |
-
const ENV_DEVELOPMENT = 'dev';
|
20 |
-
const ENV_ACCEPTATION = 'acc';
|
21 |
-
const ENV_PRODUCTION = 'prod';
|
22 |
-
|
23 |
-
const DEV_URL = 'http://%s.channelengine.local';
|
24 |
-
const ACC_URL = 'http://%s.channelengine-acc.nl';
|
25 |
-
const PROD_URL = 'https://%s.channelengine.net';
|
26 |
-
|
27 |
-
const BASE_PATH = '/api/v1/';
|
28 |
-
const CERTIFICATE_PATH = 'AddTrustExternalCARoot.crt';
|
29 |
-
|
30 |
-
const ORDERS_PATH = 'orders/';
|
31 |
-
const SHIPMENTS_PATH = 'shipments/';
|
32 |
-
const RETURNS_PATH = 'returns/';
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Create a new instance of the Kieskeurig Api client.
|
36 |
-
* @param string $apiKey Your personal Api key
|
37 |
-
* @param string $apiSecret Your personal Api secret
|
38 |
-
* @param string $tenant Your personal ChannelEngine name. If your ChannelEngine Url is https://yourshop.channelengine.net your personal name is "yourshop"
|
39 |
-
*/
|
40 |
-
public function __construct($apiKey, $apiSecret, $tenant, $environment = null)
|
41 |
-
{
|
42 |
-
if($environment == null || $environment == self::ENV_PRODUCTION){
|
43 |
-
$this->apiUrl = sprintf(self::PROD_URL, $tenant);
|
44 |
-
}elseif($environment == self::ENV_ACCEPTATION){
|
45 |
-
$this->apiUrl = sprintf(self::ACC_URL, $tenant);
|
46 |
-
}elseif($environment == self::ENV_DEVELOPMENT){
|
47 |
-
$this->apiUrl = sprintf(self::DEV_URL, $tenant);
|
48 |
-
}
|
49 |
-
|
50 |
-
$this->environment = $environment;
|
51 |
-
$this->tenant = $tenant;
|
52 |
-
$this->apiKey = $apiKey;
|
53 |
-
$this->apiSecret = $apiSecret;
|
54 |
-
$this->certificate = __DIR__ . DIRECTORY_SEPARATOR . (self::USE_FIDDLER ? self::FIDDLER_CERTIFICATE_PATH : self::CERTIFICATE_PATH);
|
55 |
-
|
56 |
-
$this->lastRepresentation = '';
|
57 |
-
}
|
58 |
-
|
59 |
-
/* Public API methods */
|
60 |
-
|
61 |
-
/* ORDERS */
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Gets all orders with selected parameters
|
65 |
-
* @param array $statuses An array of ChannelEngineApiClient\Enums\OrderStatus or NULL for all new orders.
|
66 |
-
* @param DateTime $dateFrom Filter orders from the given date
|
67 |
-
* @param DateTime $dateTo Filter orders until the given date
|
68 |
-
* @return ChannelEngineApiClient\Helpers\MerchantOrderCollection The retrieved orders
|
69 |
-
*/
|
70 |
-
public function getOrders(array $statuses = array(Tritac_ChannelEngineApiClient_Enums_OrderStatus::NEW_ORDER), DateTime $dateFrom = null, DateTime $dateTo = null)
|
71 |
-
{
|
72 |
-
$args = array();
|
73 |
-
$args['OrderStatus'] = $statuses;
|
74 |
-
$args = $this->addDateArgs($dateFrom, $dateTo, $args);
|
75 |
-
|
76 |
-
$url = self::BASE_PATH . self::ORDERS_PATH;
|
77 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::GET, $url, $this->createQueryString($args));
|
78 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_Order)');
|
79 |
-
}
|
80 |
-
|
81 |
-
/* SHIPMENTS */
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Create a new shipment for the given order with the given lines
|
85 |
-
* @param ChannelEngineApiClient\Models\Shipment $shipment The shipment to send
|
86 |
-
*/
|
87 |
-
public function postShipment(Tritac_ChannelEngineApiClient_Models_Shipment $shipment)
|
88 |
-
{
|
89 |
-
$url = self::BASE_PATH . self::SHIPMENTS_PATH;
|
90 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::POST, $url, '', Tritac_ChannelEngineApiClient_Helpers_JsonMapper::toJson($shipment));
|
91 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_Shipment');
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Update an existing Shipment
|
96 |
-
* @param ChannelEngineApiClient\Models\Shipment $shipment The shipment to send
|
97 |
-
*/
|
98 |
-
public function putShipment(Tritac_ChannelEngineApiClient_Models_Shipment $shipment)
|
99 |
-
{
|
100 |
-
$url = self::BASE_PATH . self::SHIPMENTS_PATH;
|
101 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::PUT, $url, '', Tritac_ChannelEngineApiClient_Helpers_JsonMapper::toJson($shipment));
|
102 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_Shipment');
|
103 |
-
}
|
104 |
-
|
105 |
-
/* RETURNS */
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Gets all orders with selected parameters
|
109 |
-
* @param array $statuses An array of ChannelEngineApiClient\Enums\ReturnStatus or NULL for all declared returns
|
110 |
-
* @param DateTime $dateFrom Filter returns from the given date
|
111 |
-
* @param DateTime $dateTo Filter returns until the given date
|
112 |
-
* @return ChannelEngineApiClient\Helpers\ReturnCollection The retrieved returns
|
113 |
-
*/
|
114 |
-
public function getReturns(array $statuses = array(Tritac_ChannelEngineApiClient_Enums_ReturnStatus::DECLARED), DateTime $dateFrom = null, DateTime $dateTo = null)
|
115 |
-
{
|
116 |
-
$args = array();
|
117 |
-
$args['Status'] = $statuses;
|
118 |
-
$args = $this->addDateArgs($dateFrom, $dateTo, $args);
|
119 |
-
|
120 |
-
$url = self::BASE_PATH . self::RETURNS_PATH;
|
121 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::GET, $url, $this->createQueryString($args));
|
122 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_ReturnObject)');
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Create a new return for the given shipment with the given lines
|
127 |
-
* @param ChannelEngineApiClient\Models\ReturnObject $return The shipment to send
|
128 |
-
*/
|
129 |
-
public function postReturn(Tritac_ChannelEngineApiClient_Models_ReturnObject $return)
|
130 |
-
{
|
131 |
-
$url = self::BASE_PATH . self::RETURNS_PATH;
|
132 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::POST, $url, '', Tritac_ChannelEngineApiClient_Helpers_JsonMapper::toJson($return));
|
133 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_ReturnObject');
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Updates the status of the given return
|
138 |
-
* @param ChannelEngineApiClient\Models\ReturnObject $return The return to update
|
139 |
-
*/
|
140 |
-
public function putReturn(Tritac_ChannelEngineApiClient_Models_ReturnObject $return)
|
141 |
-
{
|
142 |
-
$url = self::BASE_PATH . self::RETURNS_PATH;
|
143 |
-
$result = $this->makeRequest(Tritac_ChannelEngineApiClient_Helpers_HttpMethod::PUT, $url, '', Tritac_ChannelEngineApiClient_Helpers_JsonMapper::toJson($return));
|
144 |
-
return Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($result, 'Tritac_ChannelEngineApiClient_Models_ReturnObject');
|
145 |
-
}
|
146 |
-
|
147 |
-
/* Private methods */
|
148 |
-
|
149 |
-
private function makeRequest($method, $url, $queryString = '', $content = null)
|
150 |
-
{
|
151 |
-
$request = curl_init();
|
152 |
-
|
153 |
-
// Create the required Http headers and Hmac signature
|
154 |
-
$headers = $this->buildHeaders($method, $url, $content);
|
155 |
-
|
156 |
-
if($this->environment == self::ENV_DEVELOPMENT && self::USE_FIDDLER)
|
157 |
-
{
|
158 |
-
// We use this to redirect the request through a local proxy and trace it with fiddler
|
159 |
-
curl_setopt($request, CURLOPT_PROXY, self::FIDDLER_PROXY);
|
160 |
-
}
|
161 |
-
|
162 |
-
// Set the Url
|
163 |
-
curl_setopt($request, CURLOPT_URL, $this->apiUrl . $url . $queryString);
|
164 |
-
|
165 |
-
// Add the headers and hmac auth.
|
166 |
-
curl_setopt($request, CURLOPT_HTTPHEADER, $headers);
|
167 |
-
|
168 |
-
// Return the response as a string
|
169 |
-
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
|
170 |
-
|
171 |
-
// Set custom request method because curl has no setting for PUT and DELETE
|
172 |
-
curl_setopt($request, CURLOPT_CUSTOMREQUEST, $method);
|
173 |
-
|
174 |
-
// Make the headers accessible for debugging purposes
|
175 |
-
curl_setopt($request, CURLINFO_HEADER_OUT, true);
|
176 |
-
|
177 |
-
// Point curl to the correct certificate.
|
178 |
-
// See: http://stackoverflow.com/questions/6400300/php-curl-https-causing-exception-ssl-certificate-problem-verify-that-the-ca-cer
|
179 |
-
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, true);
|
180 |
-
curl_setopt($request, CURLOPT_CAINFO, $this->certificate);
|
181 |
-
|
182 |
-
// If we have a request body send it too
|
183 |
-
if(strlen($content) > 0)
|
184 |
-
curl_setopt($request, CURLOPT_POSTFIELDS, $content);
|
185 |
-
|
186 |
-
// Make the request
|
187 |
-
$response = curl_exec($request);
|
188 |
-
|
189 |
-
// Get the status code
|
190 |
-
$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
|
191 |
-
|
192 |
-
// Check for errors
|
193 |
-
// First we check if the response is missing which will probably be caused by a cURL error
|
194 |
-
// After this the check if there are not HTTP errors (status codes other than 200-206)
|
195 |
-
if ($response === false)
|
196 |
-
{
|
197 |
-
$error = curl_error($request);
|
198 |
-
curl_close($request);
|
199 |
-
throw new Exception('cURL error: ' . $error);
|
200 |
-
}
|
201 |
-
else if($status < 200 || $status > 206)
|
202 |
-
{
|
203 |
-
$headers = curl_getinfo($request, CURLINFO_HEADER_OUT);
|
204 |
-
$message = Tritac_ChannelEngineApiClient_Helpers_JsonMapper::fromJson($response, 'Tritac_ChannelEngineApiClient_Models_Message');
|
205 |
-
curl_close($request);
|
206 |
-
|
207 |
-
throw new Exception("\r\n".
|
208 |
-
'------Sent Headers-------------' . "\r\n" . $headers . "\r\n" .
|
209 |
-
'------Sent Content-------------' . "\r\n" . $content . "\r\n" .
|
210 |
-
'------Used Representation------' . "\r\n" . $this->lastRepresentation . "\r\n" .
|
211 |
-
'------Response Status----------' . "\r\n" . $status . "\r\n" .
|
212 |
-
'------Response Content---------' . "\r\n" . $message->getMessage() . "\r\n"
|
213 |
-
);
|
214 |
-
}
|
215 |
-
else
|
216 |
-
{
|
217 |
-
curl_close($request);
|
218 |
-
|
219 |
-
return $response;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
private function buildHeaders($method, $url, $content = null)
|
224 |
-
{
|
225 |
-
$date = time();
|
226 |
-
$headers = array(
|
227 |
-
'Accept: application/json',
|
228 |
-
'Authorization: HMAC ' . $this->apiKey . ':' . $this->calculateHmac($method, $url, $date, $content),
|
229 |
-
'Content-Type: application/json; charset=utf-8',
|
230 |
-
'Content-Length: ' . strlen($content),
|
231 |
-
'Content-MD5: ' . ((strlen($content) > 0) ? base64_encode(md5($content, true)) : ''),
|
232 |
-
'Date: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT',
|
233 |
-
);
|
234 |
-
|
235 |
-
return $headers;
|
236 |
-
}
|
237 |
-
|
238 |
-
/*
|
239 |
-
Builds message representation as follows:
|
240 |
-
|
241 |
-
Timestamp\n +
|
242 |
-
HTTP METHOD\n +
|
243 |
-
Request URI
|
244 |
-
Content-MD5 (base64)\n +
|
245 |
-
apikey\n +
|
246 |
-
|
247 |
-
*/
|
248 |
-
private function calculateHmac($method, $url, $date, $content = null)
|
249 |
-
{
|
250 |
-
$representation = array(
|
251 |
-
gmdate('m/d/Y H:i:s', $date),
|
252 |
-
$method,
|
253 |
-
$url,
|
254 |
-
(strlen($content) > 0) ? base64_encode(md5($content, true)) : '',
|
255 |
-
$this->apiKey
|
256 |
-
);
|
257 |
-
$representationString = implode("\n", $representation);
|
258 |
-
|
259 |
-
$this->lastRepresentation = $representationString;
|
260 |
-
|
261 |
-
$hash = hash_hmac('sha256', utf8_encode($representationString), utf8_encode($this->apiSecret), true);
|
262 |
-
$signature = base64_encode($hash);
|
263 |
-
|
264 |
-
return $signature;
|
265 |
-
}
|
266 |
-
|
267 |
-
private function createQueryString(array $args)
|
268 |
-
{
|
269 |
-
$queryString = (count($args) > 0) ? '?' . http_build_query($args) : '';
|
270 |
-
|
271 |
-
// .Net does not seem to like the /?foo[0]=bar&foo[1]=baz notation so we
|
272 |
-
// convert it to /?foo=bar&foo=baz
|
273 |
-
return preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $queryString);
|
274 |
-
}
|
275 |
-
|
276 |
-
private function addDateArgs(DateTime $dateFrom = null, DateTime $dateTo = null, array $args)
|
277 |
-
{
|
278 |
-
if(!is_null($dateFrom)) $args['FromDate'] = $dateFrom->format('Y-m-d H:i:s');
|
279 |
-
if(!is_null($dateTo)) $args['ToDate'] = $dateTo->format('Y-m-d H:i:s');
|
280 |
-
return $args;
|
281 |
-
}
|
282 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/CancellationLineStatus.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_CancellationLineStatus {
|
3 |
-
|
4 |
-
const PENDING = 0;
|
5 |
-
const ACCEPTED = 1;
|
6 |
-
const REJECTED = 2;
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/CancellationStatus.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_CancellationStatus {
|
3 |
-
|
4 |
-
const PENDING = 0;
|
5 |
-
const CLOSED = 2; // refunded or maybe not
|
6 |
-
const REFUND_STARTED = 3;
|
7 |
-
const REFUND_FAILED = 4;
|
8 |
-
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/Gender.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_Gender {
|
3 |
-
|
4 |
-
const MALE = 1;
|
5 |
-
const FEMALE = 2;
|
6 |
-
const NOT_APPLICABLE = 3;
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/MancoReason.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_MancoReason {
|
3 |
-
const NOT_IN_STOCK = 0;
|
4 |
-
const DAMAGED = 1;
|
5 |
-
const INCOMPLETE = 2;
|
6 |
-
const CLIENT_CANCELLED = 3;
|
7 |
-
const OTHER = 99;
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/OrderStatus.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_OrderStatus {
|
3 |
-
|
4 |
-
const IN_PROGRESS = 0;
|
5 |
-
const SHIPPED = 1;
|
6 |
-
const IN_BACKORDER = 2;
|
7 |
-
const CANCELED = 3;
|
8 |
-
const MANCO = 4;
|
9 |
-
const IN_COMBI = 5; // combi: one or more not closed
|
10 |
-
const CLOSED = 6; // combi:closed
|
11 |
-
const NEW_ORDER = 7; // renamed NEW to NEW_ORDER because new is a protected keyword in php
|
12 |
-
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/ReturnAcceptStatus.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_ReturnAcceptStatus {
|
3 |
-
const PENDING = 0;
|
4 |
-
const ACCEPTED = 1;
|
5 |
-
const REJECTED = 2; // refunded
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/ReturnReason.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_ReturnReason {
|
3 |
-
const PRODUCT_DEFECT = 0;
|
4 |
-
const PRODUCT_UNSATISFACTORY = 1;
|
5 |
-
const REFUSED = 4;
|
6 |
-
const REFUSED_DAMAGED = 5;
|
7 |
-
const WRONG_ADDRESS = 6;
|
8 |
-
const NOT_COLLECTED = 7;
|
9 |
-
const OTHER = 99;
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/ReturnStatus.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_ReturnStatus {
|
3 |
-
const DECLARED = 0;
|
4 |
-
const RECEIVED = 1;
|
5 |
-
const CLOSED = 2;
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/ShipmentLineStatus.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_ShipmentLineStatus {
|
3 |
-
|
4 |
-
const SHIPPED = 1;
|
5 |
-
const IN_BACKORDER = 2;
|
6 |
-
const MANCO = 4;
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Enums/ShipmentStatus.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Enums_ShipmentStatus {
|
3 |
-
const PENDING = 0;
|
4 |
-
const CLOSED = 2;
|
5 |
-
}
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Helpers/Collection.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Helpers_Collection extends ArrayObject{
|
3 |
-
|
4 |
-
private $type;
|
5 |
-
private $test;
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
public function __construct($type = 'stdObject')
|
10 |
-
{
|
11 |
-
$matches = array();
|
12 |
-
if(preg_match('/Collection\(([\\\\\w]+)\)$/', $type, $matches))
|
13 |
-
{
|
14 |
-
$this->type = $matches[1];
|
15 |
-
}
|
16 |
-
else
|
17 |
-
{
|
18 |
-
$this->type = $type;
|
19 |
-
}
|
20 |
-
|
21 |
-
$this->test = new $this->type();
|
22 |
-
}
|
23 |
-
|
24 |
-
public function append($item)
|
25 |
-
{
|
26 |
-
$this->checkType($item);
|
27 |
-
parent::append($item);
|
28 |
-
}
|
29 |
-
|
30 |
-
public function offsetSet($idx, $item)
|
31 |
-
{
|
32 |
-
$this->checkType($item);
|
33 |
-
parent::offsetSet($idx, $item);
|
34 |
-
}
|
35 |
-
|
36 |
-
private function checkType($item)
|
37 |
-
{
|
38 |
-
if(!($item instanceof $this->test))
|
39 |
-
{
|
40 |
-
throw new Exception('Invalid type inserted in list with type ' . $this->type);
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
public function getTypeName()
|
45 |
-
{
|
46 |
-
return $this->type;
|
47 |
-
}
|
48 |
-
|
49 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Helpers/HttpMethod.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Helpers_HttpMethod {
|
3 |
-
|
4 |
-
const GET = 'GET';
|
5 |
-
const POST = 'POST';
|
6 |
-
const PUT = 'PUT';
|
7 |
-
const DELETE = 'DELETE';
|
8 |
-
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Helpers/JsonMapper.php
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Helpers_JsonMapper {
|
3 |
-
|
4 |
-
public static function fromJson($jsonString, $rootType)
|
5 |
-
{
|
6 |
-
$jsonRoot = json_decode($jsonString);
|
7 |
-
return self::convertToObject($jsonRoot, $rootType);
|
8 |
-
}
|
9 |
-
|
10 |
-
private static function convertToObject($jsonObject, $jsonType)
|
11 |
-
{
|
12 |
-
$rootObject = null;
|
13 |
-
if(preg_match('/Collection\(([\\\\\w]+)\)$/', $jsonType))
|
14 |
-
{
|
15 |
-
$rootObject = new Tritac_ChannelEngineApiClient_Helpers_Collection($jsonType);
|
16 |
-
if(is_array($jsonObject))
|
17 |
-
{
|
18 |
-
foreach ($jsonObject as $jsonChildObject)
|
19 |
-
{
|
20 |
-
$rootObject[] = self::convertToObject($jsonChildObject, $rootObject->getTypeName());
|
21 |
-
}
|
22 |
-
}
|
23 |
-
}
|
24 |
-
else
|
25 |
-
{
|
26 |
-
$rootObject = new $jsonType();
|
27 |
-
if($jsonObject != null){
|
28 |
-
foreach (get_object_vars($jsonObject) as $key => $value)
|
29 |
-
{
|
30 |
-
if(array_key_exists(lcfirst($key), $rootObject::$typeMap))
|
31 |
-
{
|
32 |
-
$value = self::convertToObject($value, $rootObject::$typeMap[lcfirst($key)]);
|
33 |
-
}
|
34 |
-
$action = 'set' . $key;
|
35 |
-
if(method_exists($rootObject, $action))
|
36 |
-
{
|
37 |
-
$rootObject->{$action}($value);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
return $rootObject;
|
43 |
-
}
|
44 |
-
|
45 |
-
private static function isIterable($var)
|
46 |
-
{
|
47 |
-
return ($var !== null && (is_array($var) || $var instanceof Iterator || $var instanceof IteratorAggregate));
|
48 |
-
}
|
49 |
-
|
50 |
-
public static function toJson($object)
|
51 |
-
{
|
52 |
-
return json_encode(self::convertFromObject($object));
|
53 |
-
}
|
54 |
-
|
55 |
-
public static function convertFromObject($root, $d = 0, $mustexist = false)
|
56 |
-
{
|
57 |
-
if($root instanceof Tritac_ChannelEngineApiClient_Helpers_Collection)
|
58 |
-
{
|
59 |
-
$root = $root->getArrayCopy();
|
60 |
-
foreach($root as $key => $value)
|
61 |
-
{
|
62 |
-
if($value instanceof Tritac_ChannelEngineApiClient_Models_BaseModel || $value instanceof Tritac_ChannelEngineApiClient_Helpers_Collection)
|
63 |
-
$root[ucfirst($key)] = self::convertFromObject($value, $d+1, true);
|
64 |
-
}
|
65 |
-
return $root;
|
66 |
-
}
|
67 |
-
elseif($root instanceof Tritac_ChannelEngineApiClient_Models_BaseModel)
|
68 |
-
{
|
69 |
-
$newRoot = new stdClass();
|
70 |
-
foreach($root->getProperties() as $key => $value)
|
71 |
-
{
|
72 |
-
if($value instanceof Tritac_ChannelEngineApiClient_Models_BaseModel || $value instanceof Tritac_ChannelEngineApiClient_Helpers_Collection)
|
73 |
-
{
|
74 |
-
$newRoot->{ucfirst($key)} = self::convertFromObject($value, $d+1, true);
|
75 |
-
}
|
76 |
-
else
|
77 |
-
{
|
78 |
-
$newRoot->{ucfirst($key)} = $value;
|
79 |
-
}
|
80 |
-
|
81 |
-
}
|
82 |
-
return $newRoot;
|
83 |
-
}
|
84 |
-
elseif($mustexist)
|
85 |
-
{
|
86 |
-
throw new Exception('No or invalid object given to the function.');
|
87 |
-
}
|
88 |
-
|
89 |
-
return new stdClass();
|
90 |
-
}
|
91 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/Address.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Models_Address extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
public static $typeMap = array(
|
5 |
-
|
6 |
-
);
|
7 |
-
|
8 |
-
// For non-vital fields, no string length errors, but they are silently truncated.
|
9 |
-
// salutation, companyName, firstName, lastName, streetName, city: 50 characters
|
10 |
-
|
11 |
-
protected $gender; // https://en.wikipedia.org/wiki/ISO/IEC_5218
|
12 |
-
protected $salutation;
|
13 |
-
protected $companyName;
|
14 |
-
protected $firstName;
|
15 |
-
protected $lastName;
|
16 |
-
protected $streetName;
|
17 |
-
protected $houseNr;
|
18 |
-
protected $houseNrAddition;
|
19 |
-
protected $zipCode;
|
20 |
-
protected $city;
|
21 |
-
protected $countryIso;
|
22 |
-
|
23 |
-
public function __construct()
|
24 |
-
{
|
25 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
26 |
-
|
27 |
-
$this->gender = Tritac_ChannelEngineApiClient_Enums_Gender::NOT_APPLICABLE;
|
28 |
-
$this->salutation = '';
|
29 |
-
$this->companyName = '';
|
30 |
-
$this->firstName = '';
|
31 |
-
$this->lastName = '';
|
32 |
-
$this->streetName = '';
|
33 |
-
$this->houseNr = '';
|
34 |
-
$this->houseNrAddition = '';
|
35 |
-
$this->zipCode = '';
|
36 |
-
$this->city = '';
|
37 |
-
$this->countryIso = '';
|
38 |
-
}
|
39 |
-
|
40 |
-
function setGender($gender) { $this->gender = $gender; }
|
41 |
-
function getGender() { return $this->gender; }
|
42 |
-
|
43 |
-
function setSalutation($salutation) { $this->salutation = $salutation; }
|
44 |
-
function getSalutation() { return $this->salutation; }
|
45 |
-
|
46 |
-
function setCompanyName($companyName) { $this->companyName = $companyName; }
|
47 |
-
function getCompanyName() { return $this->companyName; }
|
48 |
-
|
49 |
-
function setFirstName($firstName) { $this->firstName = $firstName; }
|
50 |
-
function getFirstName() { return $this->firstName; }
|
51 |
-
|
52 |
-
function setLastName($lastName) { $this->lastName = $lastName; }
|
53 |
-
function getLastName() { return $this->lastName; }
|
54 |
-
|
55 |
-
function setStreetName($streetName) { $this->streetName = $streetName; }
|
56 |
-
function getStreetName() { return $this->streetName; }
|
57 |
-
|
58 |
-
function setHouseNr($houseNr) {
|
59 |
-
|
60 |
-
if(strlen($houseNr) > 50) {
|
61 |
-
throw new Exception('HouseNr may not exceed 50 characters');
|
62 |
-
}
|
63 |
-
|
64 |
-
$this->houseNr = $houseNr;
|
65 |
-
}
|
66 |
-
function getHouseNr() { return $this->houseNr; }
|
67 |
-
|
68 |
-
function setHouseNrAddition($houseNrAddition) {
|
69 |
-
|
70 |
-
if(strlen($houseNrAddition) > 50) {
|
71 |
-
throw new Exception('HouseNrAddition may not exceed 50 characters');
|
72 |
-
}
|
73 |
-
|
74 |
-
$this->houseNrAddition = $houseNrAddition;
|
75 |
-
|
76 |
-
}
|
77 |
-
function getHouseNrAddition() { return $this->houseNrAddition; }
|
78 |
-
|
79 |
-
function setZipCode($zipCode) { $this->zipCode = $zipCode; }
|
80 |
-
function getZipCode() { return $this->zipCode; }
|
81 |
-
|
82 |
-
function setCity($city) { $this->city = $city; }
|
83 |
-
function getCity() { return $this->city; }
|
84 |
-
|
85 |
-
function setCountryIso($countryIso) {
|
86 |
-
|
87 |
-
if(strlen($countryIso) > 2) {
|
88 |
-
throw new Exception('CountryIso may not exceed 2 characters');
|
89 |
-
}
|
90 |
-
|
91 |
-
$this->countryIso = $countryIso;
|
92 |
-
|
93 |
-
}
|
94 |
-
function getCountryIso() { return $this->countryIso; }
|
95 |
-
|
96 |
-
}
|
97 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/BaseModel.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
abstract class Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
protected $id;
|
5 |
-
|
6 |
-
public static $typeMap = array(
|
7 |
-
|
8 |
-
);
|
9 |
-
|
10 |
-
public function getTypeName()
|
11 |
-
{
|
12 |
-
return get_called_class();
|
13 |
-
}
|
14 |
-
|
15 |
-
public function getProperties()
|
16 |
-
{
|
17 |
-
return get_object_vars($this);
|
18 |
-
}
|
19 |
-
|
20 |
-
function setId($id) { $this->id = $id; }
|
21 |
-
function getId() { return $this->id; }
|
22 |
-
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/Cancellation.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Models_Cancellation extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
public static $typeMap = array(
|
5 |
-
'lines' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_CancellationLine)',
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $orderId;
|
9 |
-
protected $channelOrderNo;
|
10 |
-
protected $lines;
|
11 |
-
protected $cancellationStatus;
|
12 |
-
protected $refundInclVat;
|
13 |
-
protected $refundExclVat;
|
14 |
-
|
15 |
-
public function __construct()
|
16 |
-
{
|
17 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
18 |
-
|
19 |
-
$this->lines = new Tritac_ChannelEngineApiClient_Helpers_Collection('Tritac_ChannelEngineApiClient_Models_CancellationLine');
|
20 |
-
}
|
21 |
-
|
22 |
-
function setOrderId($orderId) { $this->orderId = $orderId; }
|
23 |
-
function getOrderId() { return $this->orderId; }
|
24 |
-
|
25 |
-
function setChannelOrderNo($channelOrderNo) { $this->channelOrderNo = $channelOrderNo; }
|
26 |
-
function getChannelOrderNo() { return $this->channelOrderNo; }
|
27 |
-
|
28 |
-
function setLines($lines) { $this->lines = $lines; }
|
29 |
-
function getLines() { return $this->lines; }
|
30 |
-
|
31 |
-
function setCancellationStatus($cancellationStatus) { $this->cancellationStatus = $cancellationStatus; }
|
32 |
-
function getCancellationStatus() { return $this->cancellationStatus; }
|
33 |
-
|
34 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
35 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
36 |
-
|
37 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
38 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/CancellationLine.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Models_CancellationLine extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
public static $typeMap = array(
|
5 |
-
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $cancellationId;
|
9 |
-
protected $orderLineId;
|
10 |
-
protected $quantity;
|
11 |
-
protected $status;
|
12 |
-
protected $refundInclVat;
|
13 |
-
protected $refundExclVat;
|
14 |
-
|
15 |
-
function setCancellationId($cancellationId) { $this->cancellationId = $cancellationId; }
|
16 |
-
function getCancellationId() { return $this->cancellationId; }
|
17 |
-
|
18 |
-
function setOrderLineId($orderLineId) { $this->orderLineId = $orderLineId; }
|
19 |
-
function getOrderLineId() { return $this->orderLineId; }
|
20 |
-
|
21 |
-
function setQuantity($quantity) { $this->quantity = $quantity; }
|
22 |
-
function getQuantity() { return $this->quantity; }
|
23 |
-
|
24 |
-
function setStatus($status) { $this->status = $status; }
|
25 |
-
function getStatus() { return $this->status; }
|
26 |
-
|
27 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
28 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
29 |
-
|
30 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
31 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
32 |
-
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/Message.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Models_Message extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
public static $typeMap = array(
|
5 |
-
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $message;
|
9 |
-
|
10 |
-
function setMessage($message) { $this->message = $message; }
|
11 |
-
function getMessage() { return $this->message; }
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/Order.php
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Tritac_ChannelEngineApiClient_Models_Order extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
3 |
-
|
4 |
-
public static $typeMap = array(
|
5 |
-
'billingAddress' => 'Tritac_ChannelEngineApiClient_Models_Address',
|
6 |
-
'cancellations' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_Cancellation)',
|
7 |
-
'extraData' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_OrderExtraDataItem)',
|
8 |
-
'shippingAddress' => 'Tritac_ChannelEngineApiClient_Models_Address',
|
9 |
-
'lines' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_OrderLine)',
|
10 |
-
'shipments' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_Shipment)',
|
11 |
-
);
|
12 |
-
|
13 |
-
protected $phone;
|
14 |
-
protected $email;
|
15 |
-
protected $cocNo;
|
16 |
-
protected $vatNo;
|
17 |
-
protected $paymentMethod;
|
18 |
-
protected $orderDate;
|
19 |
-
protected $createdAt;
|
20 |
-
protected $updatedAt;
|
21 |
-
protected $channelId;
|
22 |
-
protected $channelOrderNo;
|
23 |
-
protected $channelCustomerNo;
|
24 |
-
protected $billingAddress;
|
25 |
-
protected $cancellations;
|
26 |
-
protected $channelName;
|
27 |
-
protected $doSendMails;
|
28 |
-
protected $canShipPartialOrderLines;
|
29 |
-
|
30 |
-
protected $merchantId;
|
31 |
-
protected $merchantOrderNo;
|
32 |
-
protected $shippingCostsInclVat;
|
33 |
-
protected $shippingCostsVat;
|
34 |
-
protected $subTotalInclVat;
|
35 |
-
protected $subTotalVat;
|
36 |
-
protected $totalInclVat;
|
37 |
-
protected $totalVat;
|
38 |
-
protected $refundInclVat;
|
39 |
-
protected $refundExclVat;
|
40 |
-
protected $extraData;
|
41 |
-
protected $shippingAddress;
|
42 |
-
protected $status;
|
43 |
-
protected $closedDate;
|
44 |
-
protected $lines;
|
45 |
-
protected $shipments;
|
46 |
-
protected $maxVatRate;
|
47 |
-
|
48 |
-
public function __construct()
|
49 |
-
{
|
50 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
51 |
-
|
52 |
-
$this->lines = new Tritac_ChannelEngineApiClient_Helpers_Collection('Tritac_ChannelEngineApiClient_Models_OrderLine');
|
53 |
-
}
|
54 |
-
|
55 |
-
function setPhone($phone) { $this->phone = $phone; }
|
56 |
-
function getPhone() { return $this->phone; }
|
57 |
-
|
58 |
-
function setEmail($email) { $this->email = $email; }
|
59 |
-
function getEmail() { return $this->email; }
|
60 |
-
|
61 |
-
function setCocNo($cocNo) { $this->cocNo = $cocNo; }
|
62 |
-
function getCocNo() { return $this->cocNo; }
|
63 |
-
|
64 |
-
function setVatNo($vatNo) { $this->vatNo = $vatNo; }
|
65 |
-
function getVatNo() { return $this->vatNo; }
|
66 |
-
|
67 |
-
function setPaymentMethod($paymentMethod) { $this->paymentMethod = $paymentMethod; }
|
68 |
-
function getPaymentMethod() { return $this->paymentMethod; }
|
69 |
-
|
70 |
-
function setOrderDate($orderDate) { $this->orderDate = $orderDate; }
|
71 |
-
function getOrderDate() { return $this->orderDate; }
|
72 |
-
|
73 |
-
function setCreatedAt( $createdAt) { $this->createdAt = $createdAt; }
|
74 |
-
function getCreatedAt() { return $this->createdAt; }
|
75 |
-
|
76 |
-
function setUpdatedAt( $updatedAt) { $this->updatedAt = $updatedAt; }
|
77 |
-
function getUpdatedAt() { return $this->updatedAt; }
|
78 |
-
|
79 |
-
function setChannelId($channelId) { $this->channelId = $channelId; }
|
80 |
-
function getChannelId() { return $this->channelId; }
|
81 |
-
|
82 |
-
function setChannelOrderNo($channelOrderNo) { $this->channelOrderNo = $channelOrderNo; }
|
83 |
-
function getChannelOrderNo() { return $this->channelOrderNo; }
|
84 |
-
|
85 |
-
function setChannelCustomerNo($channelCustomerNo) { $this->channelCustomerNo = $channelCustomerNo; }
|
86 |
-
function getChannelCustomerNo() { return $this->channelCustomerNo; }
|
87 |
-
|
88 |
-
function setBillingAddress(Tritac_ChannelEngineApiClient_Models_Address $billingAddress) { $this->billingAddress = $billingAddress; }
|
89 |
-
function getBillingAddress() { return $this->billingAddress; }
|
90 |
-
|
91 |
-
function setCancellations($cancellations) { $this->cancellations = $cancellations; }
|
92 |
-
function getCancellations() { return $this->cancellations; }
|
93 |
-
|
94 |
-
function setChannelName($channelName) { $this->channelName = $channelName; }
|
95 |
-
function getChannelName() { return $this->channelName; }
|
96 |
-
|
97 |
-
function setDoSendMails($doSendMails) { $this->doSendMails = $doSendMails; }
|
98 |
-
function getDoSendMails() { return $this->doSendMails; }
|
99 |
-
|
100 |
-
function setCanShipPartialOrderLines($canShipPartialOrderLines) { $this->canShipPartialOrderLines = $canShipPartialOrderLines; }
|
101 |
-
function getCanShipPartialOrderLines() { return $this->canShipPartialOrderLines; }
|
102 |
-
|
103 |
-
function setMerchantId($merchantId) { $this->merchantId = $merchantId; }
|
104 |
-
function getMerchantId() { return $this->merchantId; }
|
105 |
-
|
106 |
-
function setMerchantOrderNo($merchantOrderNo) { $this->merchantOrderNo = $merchantOrderNo; }
|
107 |
-
function getMerchantOrderNo() { return $this->merchantOrderNo; }
|
108 |
-
|
109 |
-
function setShippingCostsInclVat($shippingCostsInclVat) { $this->shippingCostsInclVat = $shippingCostsInclVat; }
|
110 |
-
function getShippingCostsInclVat() { return $this->shippingCostsInclVat; }
|
111 |
-
|
112 |
-
function setShippingCostsVat($shippingCostsVat) { $this->shippingCostsVat = $shippingCostsVat; }
|
113 |
-
function getShippingCostsVat() { return $this->shippingCostsVat; }
|
114 |
-
|
115 |
-
function setSubTotalInclVat($subTotalInclVat) { $this->subTotalInclVat = $subTotalInclVat; }
|
116 |
-
function getSubTotalInclVat() { return $this->subTotalInclVat; }
|
117 |
-
|
118 |
-
function setSubTotalVat($subTotalVat) { $this->subTotalVat = $subTotalVat; }
|
119 |
-
function getSubTotalVat() { return $this->subTotalVat; }
|
120 |
-
|
121 |
-
function setTotalInclVat($totalInclVat) { $this->totalInclVat = $totalInclVat; }
|
122 |
-
function getTotalInclVat() { return $this->totalInclVat; }
|
123 |
-
|
124 |
-
function setTotalVat($totalVat) { $this->totalVat = $totalVat; }
|
125 |
-
function getTotalVat() { return $this->totalVat; }
|
126 |
-
|
127 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
128 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
129 |
-
|
130 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
131 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
132 |
-
|
133 |
-
function setExtraData($extraData) { $this->extraData = $extraData; }
|
134 |
-
function getExtraData() { return $this->extraData; }
|
135 |
-
|
136 |
-
function setShippingAddress($shippingAddress) { $this->shippingAddress = $shippingAddress; }
|
137 |
-
function getShippingAddress() { return $this->shippingAddress; }
|
138 |
-
|
139 |
-
function setStatus($status) { $this->status = $status; }
|
140 |
-
function getStatus() { return $this->status; }
|
141 |
-
|
142 |
-
function setClosedDate( $closedDate) { $this->closedDate = $closedDate; }
|
143 |
-
function getClosedDate() { return $this->closedDate; }
|
144 |
-
|
145 |
-
function setLines($lines) { $this->lines = $lines; }
|
146 |
-
function getLines() { return $this->lines; }
|
147 |
-
|
148 |
-
function setShipments($shipments) { $this->shipments = $shipments; }
|
149 |
-
function getShipments() { return $this->shipments; }
|
150 |
-
|
151 |
-
function setMaxVatRate($maxVatRate) { $this->maxVatRate = $maxVatRate; }
|
152 |
-
function getMaxVatRate() { return $this->maxVatRate; }
|
153 |
-
|
154 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/OrderExtraDataItem.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_OrderExtraDataItem extends Tritac_ChannelEngineApiClient_Models_BaseModel{
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
|
7 |
-
);
|
8 |
-
|
9 |
-
protected $key;
|
10 |
-
protected $value;
|
11 |
-
|
12 |
-
|
13 |
-
function setKey($key) { $this->key = $key; }
|
14 |
-
function getKey() { return $this->key; }
|
15 |
-
|
16 |
-
function setValue($value) { $this->value = $value; }
|
17 |
-
function getValue() { return $this->value; }
|
18 |
-
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/OrderLine.php
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_OrderLine extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $channelProductNo;
|
9 |
-
protected $merchantProductNo;
|
10 |
-
protected $productEan;
|
11 |
-
protected $productName;
|
12 |
-
protected $productBrand;
|
13 |
-
protected $productVariantColor;
|
14 |
-
protected $productVariantSize;
|
15 |
-
protected $quantity;
|
16 |
-
protected $unitPriceInclVat;
|
17 |
-
protected $lineTotalInclVat;
|
18 |
-
protected $vatRate;
|
19 |
-
protected $unitVat;
|
20 |
-
protected $lineVat;
|
21 |
-
protected $feeFixed;
|
22 |
-
protected $feeRate;
|
23 |
-
protected $deliveryTimeIndication;
|
24 |
-
protected $expectedDeliveryDate;
|
25 |
-
protected $status;
|
26 |
-
protected $closedDate;
|
27 |
-
protected $closedQuantity;
|
28 |
-
protected $cancelledQuantity;
|
29 |
-
protected $shippedQuantity;
|
30 |
-
protected $mancoQuantity;
|
31 |
-
|
32 |
-
public function __construct()
|
33 |
-
{
|
34 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
35 |
-
}
|
36 |
-
|
37 |
-
function setChannelProductNo($channelProductNo) { $this->channelProductNo = $channelProductNo; }
|
38 |
-
function getChannelProductNo() { return $this->channelProductNo; }
|
39 |
-
|
40 |
-
function setMerchantProductNo($merchantProductNo) { $this->merchantProductNo = $merchantProductNo; }
|
41 |
-
function getMerchantProductNo() { return $this->merchantProductNo; }
|
42 |
-
|
43 |
-
function setProductEan($productEan) { $this->productEan = $productEan; }
|
44 |
-
function getProductEan() { return $this->productEan; }
|
45 |
-
|
46 |
-
function setProductName($productName) { $this->productName = $productName; }
|
47 |
-
function getProductName() { return $this->productName; }
|
48 |
-
|
49 |
-
function setProductBrand($productBrand) { $this->productBrand = $productBrand; }
|
50 |
-
function getProductBrand() { return $this->productBrand; }
|
51 |
-
|
52 |
-
function setProductVariantColor($productVariantColor) { $this->productVariantColor = $productVariantColor; }
|
53 |
-
function getProductVariantColor() { return $this->productVariantColor; }
|
54 |
-
|
55 |
-
function setProductVariantSize($productVariantSize) { $this->productVariantSize = $productVariantSize; }
|
56 |
-
function getProductVariantSize() { return $this->productVariantSize; }
|
57 |
-
|
58 |
-
function setQuantity($quantity) { $this->quantity = $quantity; }
|
59 |
-
function getQuantity() { return $this->quantity; }
|
60 |
-
|
61 |
-
function setUnitPriceInclVat($unitPriceInclVat) { $this->unitPriceInclVat = $unitPriceInclVat; }
|
62 |
-
function getUnitPriceInclVat() { return $this->unitPriceInclVat; }
|
63 |
-
|
64 |
-
function setLineTotalInclVat($lineTotalInclVat) { $this->lineTotalInclVat = $lineTotalInclVat; }
|
65 |
-
function getLineTotalInclVat() { return $this->lineTotalInclVat; }
|
66 |
-
|
67 |
-
function setVatRate($vatRate) { $this->vatRate = $vatRate; }
|
68 |
-
function getVatRate() { return $this->vatRate; }
|
69 |
-
|
70 |
-
function setUnitVat($unitVat) { $this->unitVat = $unitVat; }
|
71 |
-
function getUnitVat() { return $this->unitVat; }
|
72 |
-
|
73 |
-
function setLineVat($lineVat) { $this->lineVat = $lineVat; }
|
74 |
-
function getLineVat() { return $this->lineVat; }
|
75 |
-
|
76 |
-
function setFeeFixed($feeFixed) { $this->feeFixed = $feeFixed; }
|
77 |
-
function getFeeFixed() { return $this->feeFixed; }
|
78 |
-
|
79 |
-
function setFeeRate($feeRate) { $this->feeRate = $feeRate; }
|
80 |
-
function getFeeRate() { return $this->feeRate; }
|
81 |
-
|
82 |
-
function setExpectedDeliveryDate( $expectedDeliveryDate) { $this->expectedDeliveryDate = $expectedDeliveryDate; }
|
83 |
-
function getExpectedDeliveryDate() { return $this->expectedDeliveryDate; }
|
84 |
-
|
85 |
-
function setDeliveryTimeIndication($deliveryTimeIndication) { $this->deliveryTimeIndication = $deliveryTimeIndication; }
|
86 |
-
function getDeliveryTimeIndication() { return $this->deliveryTimeIndication; }
|
87 |
-
|
88 |
-
function setStatus($status) { $this->status = $status; }
|
89 |
-
function getStatus() { return $this->status; }
|
90 |
-
|
91 |
-
function setClosedDate( $closedDate) { $this->closedDate = $closedDate; }
|
92 |
-
function getClosedDate() { return $this->closedDate; }
|
93 |
-
|
94 |
-
function setClosedQuantity($closedQuantity) { $this->closedQuantity = $closedQuantity; }
|
95 |
-
function getClosedQuantity() { return $this->closedQuantity; }
|
96 |
-
|
97 |
-
function setCancelledQuantity($cancelledQuantity) { $this->cancelledQuantity = $cancelledQuantity; }
|
98 |
-
function getCancelledQuantity() { return $this->cancelledQuantity; }
|
99 |
-
|
100 |
-
function setShippedQuantity($shippedQuantity) { $this->shippedQuantity = $shippedQuantity; }
|
101 |
-
function getShippedQuantity() { return $this->shippedQuantity; }
|
102 |
-
|
103 |
-
function setMancoQuantity($mancoQuantity) { $this->mancoQuantity = $mancoQuantity; }
|
104 |
-
function getMancoQuantity() { return $this->mancoQuantity; }
|
105 |
-
/*
|
106 |
-
[Required]
|
107 |
-
[StringLength(50)]
|
108 |
-
public string ChannelProductNo { get; set; }
|
109 |
-
// This one or ProductEan is required:
|
110 |
-
[StringLength(50)]
|
111 |
-
public string MerchantProductNo { get; set; }
|
112 |
-
[StringLength(20)]
|
113 |
-
public string ProductEan { get; set; }
|
114 |
-
|
115 |
-
// For non-vital fields, no string length errors, but they are silently truncated.
|
116 |
-
// productName, (100)
|
117 |
-
// productGroup, (50)
|
118 |
-
// productBrand,productVariantColor,productVariantSize (20)
|
119 |
-
|
120 |
-
[Required]
|
121 |
-
public string ProductName { get; set; }
|
122 |
-
public string ProductGroup { get; set; }
|
123 |
-
public string ProductBrand { get; set; }
|
124 |
-
public string ProductVariantColor { get; set; }
|
125 |
-
public string ProductVariantSize { get; set; }
|
126 |
-
|
127 |
-
public int Quantity { get; set; }
|
128 |
-
public decimal UnitPriceInclVat { get; set; }
|
129 |
-
public decimal? LineTotalInclVat { get; set; }
|
130 |
-
public decimal VatRate { get; set; }
|
131 |
-
public decimal? UnitVat { get; set; }
|
132 |
-
public decimal? LineVat { get; set; }
|
133 |
-
public decimal FeeFixed { get; set; }
|
134 |
-
public decimal FeeRate { get; set; }
|
135 |
-
|
136 |
-
public DateTime ExpectedDeliveryDate { get; set; }
|
137 |
-
|
138 |
-
public OrderStatus Status { get; set; }
|
139 |
-
|
140 |
-
public DateTime? ClosedDate { get; set; }
|
141 |
-
public int ClosedQuantity { get; set; }
|
142 |
-
public int CancelledQuantity { get; set; }
|
143 |
-
public int ShippedQuantity { get; set; }
|
144 |
-
public int MancoQuantity { get; set; }
|
145 |
-
*/
|
146 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/ReturnLine.php
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_ReturnLine extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $returnId;
|
9 |
-
protected $orderLineId;
|
10 |
-
protected $shipmentLineId;
|
11 |
-
protected $quantity;
|
12 |
-
protected $acceptedQuantity;
|
13 |
-
protected $rejectedQuantity;
|
14 |
-
protected $refundInclVat;
|
15 |
-
protected $refundExclVat;
|
16 |
-
|
17 |
-
public function __construct()
|
18 |
-
{
|
19 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
20 |
-
}
|
21 |
-
|
22 |
-
function setReturnId($returnId) { $this->returnId = $returnId; }
|
23 |
-
function getReturnId() { return $this->returnId; }
|
24 |
-
|
25 |
-
function setOrderLineId($orderLineId) { $this->orderLineId = $orderLineId; }
|
26 |
-
function getOrderLineId() { return $this->orderLineId; }
|
27 |
-
|
28 |
-
function setShipmentLineId($shipmentLineId) { $this->shipmentLineId = $shipmentLineId; }
|
29 |
-
function getShipmentLineId() { return $this->shipmentLineId; }
|
30 |
-
|
31 |
-
function setQuantity($quantity) { $this->quantity = $quantity; }
|
32 |
-
function getQuantity() { return $this->quantity; }
|
33 |
-
|
34 |
-
function setAcceptedQuantity($acceptedQuantity) { $this->acceptedQuantity = $acceptedQuantity; }
|
35 |
-
function getAcceptedQuantity() { return $this->acceptedQuantity; }
|
36 |
-
|
37 |
-
function setRejectedQuantity($rejectedQuantity) { $this->rejectedQuantity = $rejectedQuantity; }
|
38 |
-
function getRejectedQuantity() { return $this->rejectedQuantity; }
|
39 |
-
|
40 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
41 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
42 |
-
|
43 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
44 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
45 |
-
|
46 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/ReturnObject.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_ReturnObject extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
'lines' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_ReturnLine)'
|
7 |
-
);
|
8 |
-
|
9 |
-
protected $orderId;
|
10 |
-
protected $shipmentId;
|
11 |
-
protected $merchantReturnNo;
|
12 |
-
protected $createdAt;
|
13 |
-
protected $updatedAt;
|
14 |
-
protected $status;
|
15 |
-
protected $reason;
|
16 |
-
protected $comment;
|
17 |
-
protected $merchantComment;
|
18 |
-
protected $refundInclVat;
|
19 |
-
protected $refundExclVat;
|
20 |
-
protected $lines;
|
21 |
-
|
22 |
-
public function __construct()
|
23 |
-
{
|
24 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
25 |
-
|
26 |
-
$this->lines = new Tritac_ChannelEngineApiClient_Helpers_Collection('Tritac_ChannelEngineApiClient_Models_ReturnLine');
|
27 |
-
}
|
28 |
-
|
29 |
-
function setOrderId($orderId) { $this->orderId = $orderId; }
|
30 |
-
function getOrderId() { return $this->orderId; }
|
31 |
-
|
32 |
-
function setShipmentId($shipmentId) { $this->shipmentId = $shipmentId; }
|
33 |
-
function getShipmentId() { return $this->shipmentId; }
|
34 |
-
|
35 |
-
function setMerchantReturnNo($merchantReturnNo) { $this->merchantReturnNo = $merchantReturnNo; }
|
36 |
-
function getMerchantReturnNo() { return $this->merchantReturnNo; }
|
37 |
-
|
38 |
-
function setCreatedAt( $createdAt) { $this->createdAt = $createdAt; }
|
39 |
-
function getCreatedAt() { return $this->createdAt; }
|
40 |
-
|
41 |
-
function setUpdatedAt( $updatedAt) { $this->updatedAt = $updatedAt; }
|
42 |
-
function getUpdatedAt() { return $this->updatedAt; }
|
43 |
-
|
44 |
-
function setStatus($status) { $this->status = $status; }
|
45 |
-
function getStatus() { return $this->status; }
|
46 |
-
|
47 |
-
function setReason($reason) { $this->reason = $reason; }
|
48 |
-
function getReason() { return $this->reason; }
|
49 |
-
|
50 |
-
function setComment($comment) { $this->comment = $comment; }
|
51 |
-
function getComment() { return $this->comment; }
|
52 |
-
|
53 |
-
function setMerchantComment($merchantComment) { $this->merchantComment = $merchantComment; }
|
54 |
-
function getMerchantComment() { return $this->merchantComment; }
|
55 |
-
|
56 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
57 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
58 |
-
|
59 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
60 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
61 |
-
|
62 |
-
function setLines($lines) { $this->lines = $lines; }
|
63 |
-
function getLines() { return $this->lines; }
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/Shipment.php
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_Shipment extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
'lines' => 'Tritac_ChannelEngineApiClient_Helpers_Collection(Tritac_ChannelEngineApiClient_Models_ShipmentLine)',
|
7 |
-
);
|
8 |
-
|
9 |
-
protected $orderId;
|
10 |
-
protected $createdAt;
|
11 |
-
protected $updatedAt;
|
12 |
-
protected $trackTraceNo;
|
13 |
-
protected $trackTraceUrl;
|
14 |
-
protected $method;
|
15 |
-
protected $merchantShipmentNo;
|
16 |
-
protected $lines;
|
17 |
-
protected $refundInclVat;
|
18 |
-
protected $refundExclVat;
|
19 |
-
protected $status;
|
20 |
-
protected $mancoReason;
|
21 |
-
protected $mancoComment;
|
22 |
-
|
23 |
-
public function __construct()
|
24 |
-
{
|
25 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
26 |
-
$date = new DateTime();
|
27 |
-
$this->orderId = null;
|
28 |
-
$this->trackTraceNo = '';
|
29 |
-
$this->trackTraceUrl = '';
|
30 |
-
$this->method = '';
|
31 |
-
$this->merchantShipmentNo = '';
|
32 |
-
$this->lines = new Tritac_ChannelEngineApiClient_Helpers_Collection('Tritac_ChannelEngineApiClient_Models_ShipmentLine');
|
33 |
-
$this->refundInclVat = null;
|
34 |
-
$this->refundExclVat = null;
|
35 |
-
$this->status = Tritac_ChannelEngineApiClient_Enums_ShipmentStatus::PENDING;
|
36 |
-
$this->mancoReason = Tritac_ChannelEngineApiClient_Enums_MancoReason::NOT_IN_STOCK;
|
37 |
-
$this->mancoComment = '';
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
function setOrderId($orderId) { $this->orderId = $orderId; }
|
42 |
-
function getOrderId() { return $this->orderId; }
|
43 |
-
|
44 |
-
function setTrackTraceNo($trackTraceNo) { $this->trackTraceNo = $trackTraceNo; }
|
45 |
-
function getTrackTraceNo() { return $this->trackTraceNo; }
|
46 |
-
|
47 |
-
function setTrackTraceUrl($trackTraceUrl) { $this->trackTraceUrl = $trackTraceUrl; }
|
48 |
-
function getTrackTraceUrl() { return $this->trackTraceUrl; }
|
49 |
-
|
50 |
-
function setMethod($method) { $this->method = $method; }
|
51 |
-
function getMethod() { return $this->method; }
|
52 |
-
|
53 |
-
function setMerchantShipmentNo($merchantShipmentNo) { $this->merchantShipmentNo = $merchantShipmentNo; }
|
54 |
-
function getMerchantShipmentNo() { return $this->merchantShipmentNo; }
|
55 |
-
|
56 |
-
function setLines($lines) { $this->lines = $lines; }
|
57 |
-
function getLines() { return $this->lines; }
|
58 |
-
|
59 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
60 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
61 |
-
|
62 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
63 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
64 |
-
|
65 |
-
function setStatus($status) { $this->status = $status; }
|
66 |
-
function getStatus() { return $this->status; }
|
67 |
-
|
68 |
-
function setMancoReason($mancoReason) { $this->mancoReason = $mancoReason; }
|
69 |
-
function getMancoReason() { return $this->mancoReason; }
|
70 |
-
|
71 |
-
function setMancoComment($mancoComment) { $this->mancoComment = $mancoComment; }
|
72 |
-
function getMancoComment() { return $this->mancoComment; }
|
73 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/Models/ShipmentLine.php
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Tritac_ChannelEngineApiClient_Models_ShipmentLine extends Tritac_ChannelEngineApiClient_Models_BaseModel {
|
4 |
-
|
5 |
-
public static $typeMap = array(
|
6 |
-
);
|
7 |
-
|
8 |
-
protected $shipmentId;
|
9 |
-
protected $orderLineId;
|
10 |
-
protected $status;
|
11 |
-
protected $quantity;
|
12 |
-
protected $expectedDate;
|
13 |
-
protected $refundInclVat;
|
14 |
-
protected $refundExclVat;
|
15 |
-
|
16 |
-
public function __construct()
|
17 |
-
{
|
18 |
-
self::$typeMap = array_merge(parent::$typeMap, self::$typeMap);
|
19 |
-
$this->shipmentId = null;
|
20 |
-
$this->orderLineId = 0;
|
21 |
-
$this->status = Tritac_ChannelEngineApiClient_Enums_ShipmentLineStatus::SHIPPED;
|
22 |
-
$this->quantity = 0;
|
23 |
-
$this->expectedDate = null;
|
24 |
-
$this->refundInclVat = 0;
|
25 |
-
$this->refundExclVat = 0;
|
26 |
-
}
|
27 |
-
|
28 |
-
function setShipmentId($shipmentId) { $this->shipmentId = $shipmentId; }
|
29 |
-
function getShipmentId() { return $this->shipmentId; }
|
30 |
-
|
31 |
-
function setOrderLineId($orderLineId) { $this->orderLineId = $orderLineId; }
|
32 |
-
function getOrderLineId() { return $this->orderLineId; }
|
33 |
-
|
34 |
-
function setStatus($status) { $this->status = $status; }
|
35 |
-
function getStatus() { return $this->status; }
|
36 |
-
|
37 |
-
function setQuantity($quantity) { $this->quantity = $quantity; }
|
38 |
-
function getQuantity() { return $this->quantity; }
|
39 |
-
|
40 |
-
function setExpectedDate( $expectedDate) { $this->expectedDate = $expectedDate; }
|
41 |
-
function getExpectedDate() { return $this->expectedDate; }
|
42 |
-
|
43 |
-
function setRefundInclVat($refundInclVat) { $this->refundInclVat = $refundInclVat; }
|
44 |
-
function getRefundInclVat() { return $this->refundInclVat; }
|
45 |
-
|
46 |
-
function setRefundExclVat($refundExclVat) { $this->refundExclVat = $refundExclVat; }
|
47 |
-
function getRefundExclVat() { return $this->refundExclVat; }
|
48 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Tritac/ChannelEngineApiClient/loader.php
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// This loader is required to make use of the php __autoload functionality.
|
4 |
-
|
5 |
-
/*function __autoload($class) {
|
6 |
-
$class = str_replace('\\', '/', $class) . '.php';
|
7 |
-
require_once($class);
|
8 |
-
}*/
|
9 |
-
|
10 |
-
// Add your class dir to include path
|
11 |
-
set_include_path(get_include_path() . PATH_SEPARATOR);
|
12 |
-
|
13 |
-
// Use default autoload implementation
|
14 |
-
spl_autoload_register();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tritac_ChannelEngine</name>
|
4 |
-
<version>3.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -20,12 +20,11 @@ Features of ChannelEngine:
|
|
20 |
* Receive orders from marketplaces using one single connection.
|
21 |
* Using this magento extension you can connect to ChannelEngine instantly without any further configuration.
|
22 |
* For more information, visit: ChannelEngine.com</description>
|
23 |
-
<notes>*
|
24 |
-
* Fetch attributes for child products</notes>
|
25 |
<authors><author><name>Christiaan de Ridder</name><user>christiaander</user><email>support@channelengine.com</email></author></authors>
|
26 |
-
<date>2017-
|
27 |
-
<time>
|
28 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="f6b4a6d9af9aa3bcd3019fd566d6a67c"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="ChannelEngine"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="004083344207a444e00ebaf4a86835b9"/></dir></dir></dir><file name="Head.php" hash="74004d8749f6267c4ce024b47970af23"/></dir><dir name="Helper"><file name="Data.php" hash="7517ee0d0acd0567e1f1f14cf794107c"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="b6e04e43096e934d57e8e8745dd67c75"/></dir><file name="Observer.php" hash="7bf9280e95303d71685b4836dfbdfb89"/><file name="Order.php" hash="7b5d59152a0341cf5bff5b7adf6c76b7"/><dir name="Payment"><dir name="Method"><file name="Channelengine.php" hash="b938300284d504de42dd04777c45c75b"/></dir></dir><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="fedd812bdf0090a36ce7bdd23e7876f5"/></dir><file name="Order.php" hash="cab73cceec877cda4daadc5c66f356fe"/><file name="Setup.php" hash="ed5ca35f61e6158a8b617630ae84c5b8"/><dir name="Shipment"><file name="Collection.php" hash="56e7c3bee221edefdcb587801bd36cc2"/></dir><file name="Shipment.php" hash="e09302f0ff110b94fc34031ee9255caa"/></dir><file name="Shipment.php" hash="5aa413e4e1ca441456d0d28ed541d2fc"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Gtin.php" hash="d2c18169dfaf87a01d9d7357329f1c78"/><file name="Shipping.php" hash="00d71eaebba3014fe9d17ee75f7cf0a9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GenerateController.php" hash="b69ead94a34e01bdf093ee6282b66c18"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2a9dc6ac1738bebb470c1aa699478467"/><file name="config.xml" hash="adca574233237009c8fd49d17aacfaaa"/><file name="system.xml" hash="ebd9a53cd2b8bc9c7c0ab19c68996d8c"/></dir><dir name="sql"><dir name="channelengine_setup"><file name="mysql4-install-1.0.0.php" hash="6d04678d7750ff3de5a9eb697c13d52f"/><file name="mysql4-upgrade-2.6.0-2.7.0.php" hash="1f8c2f9d0239c9fbf31d3bfdd1c6cc46"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Tritac"><dir name="ChannelEngineApiClient"><file name="AddTrustExternalCARoot.crt" hash="f85d1ff17b0079709f131f3ce3f288d2"/><file name="Client.php" hash="9e0065d5902495dcf12c6526a6309998"/><dir name="Enums"><file name="CancellationLineStatus.php" hash="b48713c95dea7855255eca6d9af68ba4"/><file name="CancellationStatus.php" hash="ea61f9cdf047d615c63d49e943ef7776"/><file name="Gender.php" hash="ec9d3e083df38a188c57b1015e011bce"/><file name="MancoReason.php" hash="b5a7ecf30975a494223df3135e111760"/><file name="OrderStatus.php" hash="451569e1788da5f08b01527ee86463cd"/><file name="ReturnAcceptStatus.php" hash="760598e7176288210d349686899e76aa"/><file name="ReturnReason.php" hash="9d8aea80edbb7d012e7abcbb0f54d5e4"/><file name="ReturnStatus.php" hash="7827e8d3b27faf6073835ecbcde1db6b"/><file name="ShipmentLineStatus.php" hash="ccdddd9f80610cbf284154db5930247a"/><file name="ShipmentStatus.php" hash="0b0351af3409590614ff249e1bac688e"/></dir><dir name="Helpers"><file name="Collection.php" hash="4dcae246e9de6e847818dc3be49ddad0"/><file name="HttpMethod.php" hash="79b753f221780fbf75773669cf3d1f86"/><file name="JsonMapper.php" hash="c8742a0636d3f866c8a1c2c97365cfb8"/></dir><dir name="Models"><file name="Address.php" hash="49a1cd2a405ba2832f638979a14c7187"/><file name="BaseModel.php" hash="9604e198f22fef25d60992c2cb9f506c"/><file name="Cancellation.php" hash="edddc28fc842661311da1d79f9b6b634"/><file name="CancellationLine.php" hash="f2eb604ccc7ea5678941394cb5861c48"/><file name="Message.php" hash="658c867e131588eb2520c349d6ebc5a7"/><file name="Order.php" hash="11df07d8acb3fc985b3eec812955ef42"/><file name="OrderExtraDataItem.php" hash="965abccf11c8157b7fd85e05a8ef4e28"/><file name="OrderLine.php" hash="78252a465c5f1b9b1c5e23c8ce09552d"/><file name="ReturnLine.php" hash="c011dfcf44f25b255e529fd26755fbd9"/><file name="ReturnObject.php" hash="28378a651ad7e41b127bfd1839f25dad"/><file name="Shipment.php" hash="c8903a23b59a1cada56b8518db56ce2d"/><file name="ShipmentLine.php" hash="0ca0e5441553f722ade5ad5924c9f801"/></dir><file name="loader.php" hash="5bba6033b0bdc5cb87afdbdde2deadf9"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="channelengine.xml" hash="ae6a00b46a84a610964743034eb72081"/></dir><dir name="template"><dir name="channelengine"><dir name="checkout"><file name="success.phtml" hash="dbcb8298cd52a3c44560ae911349a3c7"/></dir><file name="head.phtml" hash="a7a7ab566adc1dc7d2645bf1cdfac0d4"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="channelengine"><dir name="system"><dir name="config"><dir name="feed"><file name="generate_button.phtml" hash="ed8c5f4a81f19c7ceaacd1b1c004772e"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
29 |
<compatible/>
|
30 |
-
<dependencies><required><php><min>5.
|
31 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Tritac_ChannelEngine</name>
|
4 |
+
<version>4.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
20 |
* Receive orders from marketplaces using one single connection.
|
21 |
* Using this magento extension you can connect to ChannelEngine instantly without any further configuration.
|
22 |
* For more information, visit: ChannelEngine.com</description>
|
23 |
+
<notes>* Performance improvements for different catalog settings</notes>
|
|
|
24 |
<authors><author><name>Christiaan de Ridder</name><user>christiaander</user><email>support@channelengine.com</email></author></authors>
|
25 |
+
<date>2017-05-04</date>
|
26 |
+
<time>12:42:28</time>
|
27 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Tritac_ChannelEngine.xml" hash="f6b4a6d9af9aa3bcd3019fd566d6a67c"/></dir></target><target name="magecommunity"><dir name="Tritac"><dir name="ChannelEngine"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="004083344207a444e00ebaf4a86835b9"/></dir></dir></dir><file name="Head.php" hash="74004d8749f6267c4ce024b47970af23"/></dir><dir name="Helper"><file name="Data.php" hash="e4668703b1ca36956ab3658c422982c4"/></dir><dir name="Model"><dir name="Carrier"><file name="Channelengine.php" hash="b6e04e43096e934d57e8e8745dd67c75"/></dir><file name="Loader.php" hash="b8207f87e0e26c0b62b433ad44e85c58"/><file name="Observer.php" hash="0ef4f2f48398b236f193bc139d662477"/><file name="Order.php" hash="7b5d59152a0341cf5bff5b7adf6c76b7"/><dir name="Payment"><dir name="Method"><file name="Channelengine.php" hash="b938300284d504de42dd04777c45c75b"/></dir></dir><dir name="Resource"><dir name="Order"><file name="Collection.php" hash="fedd812bdf0090a36ce7bdd23e7876f5"/></dir><file name="Order.php" hash="cab73cceec877cda4daadc5c66f356fe"/><file name="Setup.php" hash="ed5ca35f61e6158a8b617630ae84c5b8"/><dir name="Shipment"><file name="Collection.php" hash="56e7c3bee221edefdcb587801bd36cc2"/></dir><file name="Shipment.php" hash="e09302f0ff110b94fc34031ee9255caa"/></dir><file name="Shipment.php" hash="5aa413e4e1ca441456d0d28ed541d2fc"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Gtin.php" hash="d2c18169dfaf87a01d9d7357329f1c78"/><file name="Shipping.php" hash="00d71eaebba3014fe9d17ee75f7cf0a9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GenerateController.php" hash="dcbe89c407a00b53f4ea95691090ba23"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2a9dc6ac1738bebb470c1aa699478467"/><file name="config.xml" hash="514eb047b40c6fb02144356cbdb367a0"/><file name="system.xml" hash="24023c392556155e77b6ab1cf02e84a6"/></dir><dir name="sql"><dir name="channelengine_setup"><file name="mysql4-install-1.0.0.php" hash="6d04678d7750ff3de5a9eb697c13d52f"/><file name="mysql4-upgrade-2.6.0-2.7.0.php" hash="1f8c2f9d0239c9fbf31d3bfdd1c6cc46"/></dir></dir></dir></dir></target><target name="magelib"><dir name="ChannelEngine"><file name="composer.json" hash="0409500a61e93de939a4dbe6a287db9b"/><file name="composer.lock" hash="6564646e142a50bab18a5d2c0ec6438a"/><dir name="vendor"><file name="autoload.php" hash="a318487cebe1e11bb07ff9ca3859f466"/><dir name="channelengine"><dir name="api-client"><file name="README.md" hash="bd216e504ca4e5db1e0b44031b52d279"/><file name="api-client.sublime-project" hash="3b415c0c18b0c5aba978e919389acb31"/><file name="autoload.php" hash="705933da41eaf10d3874a1843118558c"/><file name="composer.json" hash="22f8d07476d06c404c059ff9da66f31f"/><dir name="docs"><dir name="Api"><file name="BackOrderApi.md" hash="502a8dd3880ae59abd08d1d0e5a1abeb"/><file name="CancellationApi.md" hash="603fc4f25887e55a97f2aec34109d8a3"/><file name="ClientApi.md" hash="1569a1fd53bde30b8b04bebec5c12756"/><file name="OrderApi.md" hash="2d5adef1989c78c406bd97d5ffec3744"/><file name="ProductApi.md" hash="dee883c5ab049bab98c25b26ad615e88"/><file name="ReturnApi.md" hash="4994513857e57786beb793523769a225"/><file name="ShipmentApi.md" hash="c8cb49e2b8bbc728106acc6f3b00c591"/></dir><dir name="Model"><file name="ApiResponse.md" hash="c2c27b0cde81c5b1fe3e7eb16fc0f491"/><file name="BackOrder.md" hash="84a6006f4447ec2f3bc38e1f4f6aa032"/><file name="BackOrderLine.md" hash="95579a0724930de6e28616a0ef24fb44"/><file name="ChannelCancellationLineResponse.md" hash="60cd567274761c97d498b96a419b3d90"/><file name="ChannelCancellationResponse.md" hash="d26af09dc0e5896af8255e6fa46f6398"/><file name="ChannelOfferResponse.md" hash="665ca9f581db6f876240e3afca489b43"/><file name="ChannelOrderLineRequest.md" hash="63e6f8749551c7e6e35654b7d757d32f"/><file name="ChannelOrderRequest.md" hash="d153101ffafe1f007aaa5ae1bb2b6ef8"/><file name="ChannelProcessedChangesRequest.md" hash="4a340f2bf061c99c2f0dc9ff08cf7eff"/><file name="ChannelProductChangesResponse.md" hash="1d60c94776a102ce70adfe423053662c"/><file name="ChannelProductResponse.md" hash="ab03738a7d36ca757d4d760f494f34eb"/><file name="ChannelReferencesRequest.md" hash="0093f0fb9f984d1b5487a21e7f228881"/><file name="ChannelReturnLineRequest.md" hash="8772b0e3d83aa4d9b9a5096d4e7d3a71"/><file name="ChannelReturnLineResponse.md" hash="3776c0d0d4c55b771f56cf7d54dfcbd6"/><file name="ChannelReturnRequest.md" hash="e3f7f0bac18928f306c7a6250a33559c"/><file name="ChannelReturnResponse.md" hash="fce03223b6d72522aaebbc571710c184"/><file name="ChannelShipmentLineResponse.md" hash="7af4b4969f67785856935ea2157ef777"/><file name="ChannelShipmentResponse.md" hash="d08e3ffaa74bb3cfacc302ab4ecc6647"/><file name="CollectionOfBackOrder.md" hash="a598d6feabc24120bb32d27039257815"/><file name="CollectionOfChannelCancellationResponse.md" hash="17d808e9a597a7b577f06dda3826b209"/><file name="CollectionOfChannelOfferResponse.md" hash="960220f338c97e7f7f8d22d6a1dda078"/><file name="CollectionOfChannelReturnResponse.md" hash="5aa569265ef1bffe72598717b54eb744"/><file name="CollectionOfChannelShipmentResponse.md" hash="921c98e16402963a54914a49b2ae4315"/><file name="CollectionOfMerchantOrderResponse.md" hash="2b485b16c88d9b572a920832cee2d640"/><file name="CollectionOfMerchantReturnResponse.md" hash="28e166e6c4334999d01e72ed45b9f1cd"/><file name="EntitiesAddressModels.md" hash="a39c3572451706980ef8ca89150839d1"/><file name="ExtraDataItem.md" hash="0de36fae230fc29f94271b1d4cfda0be"/><file name="MerchantCancellationLineRequest.md" hash="7d34f8383485ab49aeefda8bfb7a5549"/><file name="MerchantCancellationRequest.md" hash="18b66e8fb6bac478187c47f9d1b9f33a"/><file name="MerchantOrderLineResponse.md" hash="2c9798e602c11355d27673d6dd5c595f"/><file name="MerchantOrderResponse.md" hash="aa294617b05c2ff8e1b8827e12dfbe58"/><file name="MerchantProductRequest.md" hash="b716f6455a82ac7edd34a805944e45be"/><file name="MerchantProductResponse.md" hash="1feac7443fa488fcf3049dd9fae9f9f3"/><file name="MerchantReturnLineRequest.md" hash="00ffe9d7430d1f8906664335f31dab47"/><file name="MerchantReturnLineResponse.md" hash="9d93c86dfc723c70013b38194821a4c0"/><file name="MerchantReturnRequest.md" hash="c6f8feb89091a6934edda9afc303055d"/><file name="MerchantReturnResponse.md" hash="68556dd65cf825c8bbfc9c4258732890"/><file name="MerchantShipmentLineRequest.md" hash="c64bb2841e6220eebec76af08f6521b4"/><file name="MerchantShipmentRequest.md" hash="a6375c9cd3353a9e1f58ecd13bc9db46"/><file name="MerchantShipmentTrackingRequest.md" hash="31de02f6fc295de48495954e0661cedf"/><file name="OrderAcknowledgement.md" hash="4efbc52fac5d1096411b71dbf9eadfc8"/><file name="ProductCreationResult.md" hash="f7405b1242dac1e7691fea916126a762"/><file name="ProductMessage.md" hash="f0183ec14571d04083c97184fd0d0cb0"/><file name="SingleOfBackOrder.md" hash="40d153f95799d834702713f67f51f2dd"/><file name="SingleOfChannelProductChangesResponse.md" hash="66b59de7b2664656f0dbe41aaf236bc2"/><file name="SingleOfMerchantProductResponse.md" hash="0bb93f7335afe61d1f3085147eb2c62f"/><file name="SingleOfProductCreationResult.md" hash="b716e0f72131560a100ea752486b6fb0"/></dir></dir><file name="git_push.sh" hash="cb43424bd3b91aad6248982e6d022abf"/><dir name="lib"><dir name="Api"><file name="BackOrderApi.php" hash="5e81ec4edf4158643bec19b4bc1626f2"/><file name="CancellationApi.php" hash="d8dd5fc664e97e48a2b4d8675398075f"/><file name="ClientApi.php" hash="27b7e36e2e2a58a48e23b9b3d60718a0"/><file name="OrderApi.php" hash="878b6aef80ca14ae6e78e22e3e23d272"/><file name="ProductApi.php" hash="e2fda0f0bd93d83a8fd3341248951370"/><file name="ReturnApi.php" hash="bab74b31173552b26ddded0ab634f791"/><file name="ShipmentApi.php" hash="c959703b9f4b0625857909305f2bce9c"/></dir><file name="ApiClient.php" hash="842d8cc43ed577f9c6309325274cae8b"/><file name="ApiException.php" hash="35e42f31a447db6fa7829f3921bb71f3"/><file name="Configuration.php" hash="31b0a02797b7a7be75aee5882e4a71a4"/><dir name="Model"><file name="ApiResponse.php" hash="0a3b05df633ae7f3ab07a11a125fca9c"/><file name="BackOrder.php" hash="8381e382e6cb0003122fe0cf6724ffc6"/><file name="BackOrderLine.php" hash="d7bce03323b7fc81a247e9d2d1013a3b"/><file name="ChannelCancellationLineResponse.php" hash="bca9fdefe0c204ee9ef232f963b3de47"/><file name="ChannelCancellationResponse.php" hash="e67a3c71c1f2b233cc76d6a105cb3e3e"/><file name="ChannelOfferResponse.php" hash="c0dcfdd5e2176537cf8c65786806ab78"/><file name="ChannelOrderLineRequest.php" hash="e1731a835a52ce636c78782d87dc8ff6"/><file name="ChannelOrderRequest.php" hash="f76b555f79c9ef7bc891fb1e8c272702"/><file name="ChannelProcessedChangesRequest.php" hash="811154776d351b4a4b4cfdd8e52dabea"/><file name="ChannelProductChangesResponse.php" hash="4005bddd62fb2f3fa8c5cbd18915c769"/><file name="ChannelProductResponse.php" hash="5c56cb7c3e7b066a416e492cea0ae5a3"/><file name="ChannelReferencesRequest.php" hash="8475df642ea577070897525ec531df5a"/><file name="ChannelReturnLineRequest.php" hash="efb6cafb95306f9a1daa174cdced04da"/><file name="ChannelReturnLineResponse.php" hash="cb278e5cb10e4f8e96319fdfdcd011e5"/><file name="ChannelReturnRequest.php" hash="ec2e7c79e2f64c88ed3022d5b777132a"/><file name="ChannelReturnResponse.php" hash="d4476c0c9c9254a7e61efaf733a99633"/><file name="ChannelShipmentLineResponse.php" hash="05c3bf0d034f2ec710d5c31d787995ae"/><file name="ChannelShipmentResponse.php" hash="018ba0efa56760cc898db241c4fb1960"/><file name="CollectionOfBackOrder.php" hash="ceb2f8cce017d574f95c31fd710925db"/><file name="CollectionOfChannelCancellationResponse.php" hash="d16d711ec15156e378ef1d47cb7c2035"/><file name="CollectionOfChannelOfferResponse.php" hash="e2aa6951e00d415a0e1d01fb5039c571"/><file name="CollectionOfChannelReturnResponse.php" hash="82fbfd1ab05901cd5f9ed0378315ff21"/><file name="CollectionOfChannelShipmentResponse.php" hash="6887ab42ff36160caeea7fe3e7a81a3f"/><file name="CollectionOfMerchantOrderResponse.php" hash="25c69cc1c18d5d378a66b4b6510c90ad"/><file name="CollectionOfMerchantReturnResponse.php" hash="3cb0aae8dc98658933abe39596112238"/><file name="EntitiesAddressModels.php" hash="0e77da388045bcd741491f0e808c5590"/><file name="ExtraDataItem.php" hash="fd4591749f2db73f7419fa60eb61ece1"/><file name="MerchantCancellationLineRequest.php" hash="fc592a1326f5d757518f136868e79abe"/><file name="MerchantCancellationRequest.php" hash="aa91c8397263205bd2ea352487a4789b"/><file name="MerchantOrderLineResponse.php" hash="3a03961b88af656a8d445fd6ad362c61"/><file name="MerchantOrderResponse.php" hash="204e6f13d44bc7c39359db3dfbc259e8"/><file name="MerchantProductRequest.php" hash="d30cac5bde0749267b31122027b5faf3"/><file name="MerchantProductResponse.php" hash="59637638ced5d01950f74e129f17118f"/><file name="MerchantReturnLineRequest.php" hash="febc3d102920720bab159b3cc7b096f1"/><file name="MerchantReturnLineResponse.php" hash="1c684535ba88a7667920b3d7e75e3864"/><file name="MerchantReturnRequest.php" hash="50ee599cf61519fed768072a87c4dd8c"/><file name="MerchantReturnResponse.php" hash="01b709acf280d9c068e6d201e09a5222"/><file name="MerchantShipmentLineRequest.php" hash="5304190e3a68136f3c0aec3de99e2424"/><file name="MerchantShipmentRequest.php" hash="541886892421fb9b2d358578779ca849"/><file name="MerchantShipmentTrackingRequest.php" hash="037a86688447c3fb348221e2ce587265"/><file name="OrderAcknowledgement.php" hash="dda1ada83257f1ee8aecae11c0fa3e32"/><file name="ProductCreationResult.php" hash="889dc202026af5080801077a48361c64"/><file name="ProductMessage.php" hash="673e069e1fc5e6ad9f05825f57922d25"/><file name="SingleOfBackOrder.php" hash="f2c5ea0cb45bba633e37b3f7fdd6b5ca"/><file name="SingleOfChannelProductChangesResponse.php" hash="9bd19387159ffbc97e846c37f2414f43"/><file name="SingleOfMerchantProductResponse.php" hash="d729298d1ebc24064de1e157db0e5357"/><file name="SingleOfProductCreationResult.php" hash="dbd32037409ae8a9a6bc70e8bb394ef9"/></dir><file name="ObjectSerializer.php" hash="e6842da289d7dfa60c4ad2cd427f0ac5"/></dir><file name="phpunit.xml.dist" hash="82cdb47416d5294f68042ad4ef3bbdfb"/><dir name="test"><dir name="Api"><file name="BackOrderApiTest.php" hash="38eadf8e5bd8d5b64e751cd995a5d14c"/><file name="CancellationApiTest.php" hash="2e708e7da73249459a5f2135bf7a6493"/><file name="ClientApiTest.php" hash="9977a02ce29e75244a6cc0f77d7b2f2f"/><file name="OrderApiTest.php" hash="a5171f8ba78f55d71b500f0dd3ffd339"/><file name="ProductApiTest.php" hash="8e2c07929122cae5f2bca51e9b3f7a53"/><file name="ReturnApiTest.php" hash="6f41f9c096a319c8ffdd1512ea6eeeb3"/><file name="ShipmentApiTest.php" hash="69ce282bb21987efcaf9ef58a4e3c929"/></dir><dir name="Model"><file name="ApiResponseTest.php" hash="47ad10b81c24c046d26a721593743549"/><file name="BackOrderLineTest.php" hash="386d64b5b048dba890fdf527a9384bdc"/><file name="BackOrderTest.php" hash="20db2c9fc8bc7b2ee95b23217ec90324"/><file name="ChannelCancellationLineResponseTest.php" hash="c3911b9a14fa6e6e224e1fef0d14ebe3"/><file name="ChannelCancellationResponseTest.php" hash="5ac4db00dec924f7991e30f7cd851a85"/><file name="ChannelOfferResponseTest.php" hash="864f75a5ec3d1164a494fa7611a99d74"/><file name="ChannelOrderLineRequestTest.php" hash="1bc6bdc75b0ca3f7fc81600b00adce9e"/><file name="ChannelOrderRequestTest.php" hash="28e9fcf7f92df24cd4eade51e924c418"/><file name="ChannelProcessedChangesRequestTest.php" hash="2e31c7235b56f4c78ca961692740b2a4"/><file name="ChannelProductChangesResponseTest.php" hash="23f00d9199f2cc208efc55ecdf9365c6"/><file name="ChannelProductResponseTest.php" hash="a28341ed1fef5facb5ff2f2c30a1fe6f"/><file name="ChannelReferencesRequestTest.php" hash="cde66fa66d8ba5d6d2d9179e37e6d9f2"/><file name="ChannelReturnLineRequestTest.php" hash="ed6494db84eedab689da22870e0ad909"/><file name="ChannelReturnLineResponseTest.php" hash="e914765391866a51659fd4022381f760"/><file name="ChannelReturnRequestTest.php" hash="96080f38514039e9f5bd97c49575bd8c"/><file name="ChannelReturnResponseTest.php" hash="02fbc0c9be981e10fa825d40ce77b1cd"/><file name="ChannelShipmentLineResponseTest.php" hash="4b2876b2f6cc0466a1575348a04aeab6"/><file name="ChannelShipmentResponseTest.php" hash="d8fb3ed6643a2da9139873b9f40e1ded"/><file name="CollectionOfBackOrderTest.php" hash="5b213ba119b95cc1b1cd47f38c7ae4ae"/><file name="CollectionOfChannelCancellationResponseTest.php" hash="d1aafe9dfddb92125a7613194ba04d1d"/><file name="CollectionOfChannelOfferResponseTest.php" hash="178d3c84aacd4f3ad3edc84a17bdbf02"/><file name="CollectionOfChannelReturnResponseTest.php" hash="6d53549630c3337a31bb1ecb87e61555"/><file name="CollectionOfChannelShipmentResponseTest.php" hash="a934c9bf97695687f3a2d5116fedae58"/><file name="CollectionOfMerchantOrderResponseTest.php" hash="7428c9b0708ca263a036ff90a9278e08"/><file name="CollectionOfMerchantReturnResponseTest.php" hash="9215b1ef54894b1d18c74b165521962d"/><file name="EntitiesAddressModelsTest.php" hash="7ce550b6e3c4eba3a17e8a1c026ecb72"/><file name="ExtraDataItemTest.php" hash="caa7c4e33ad26050ede14df690d94ce2"/><file name="MerchantCancellationLineRequestTest.php" hash="f06c4131e5472a835c82c0f46d035c6d"/><file name="MerchantCancellationRequestTest.php" hash="f8d8cc7821aa1ecf842935656019a914"/><file name="MerchantOrderLineResponseTest.php" hash="b22d878593d9286a96733cf7d19a19c5"/><file name="MerchantOrderResponseTest.php" hash="0aab3e4a85d092aa9dd5ae353a61c027"/><file name="MerchantProductRequestTest.php" hash="e9f310562cca319e8e25220dcda2fd5c"/><file name="MerchantProductResponseTest.php" hash="5ca76d16364c27f5a5dd7f0ee41ac9b4"/><file name="MerchantReturnLineRequestTest.php" hash="a5c136a8524288aca4ac9cb356dcdc2a"/><file name="MerchantReturnLineResponseTest.php" hash="3d5dbd7817316a7d05c0472d7abf5017"/><file name="MerchantReturnRequestTest.php" hash="aab02e41fa8a30c80323758cf823e70e"/><file name="MerchantReturnResponseTest.php" hash="216d32bab151c70cc757dd3604548980"/><file name="MerchantShipmentLineRequestTest.php" hash="fb14a111aa135c9c2fbf8426fe4ec209"/><file name="MerchantShipmentRequestTest.php" hash="9b654c3525eb68df96dd267fc90575f2"/><file name="MerchantShipmentTrackingRequestTest.php" hash="a2e71dd4870faba873059a1f00ef6a3a"/><file name="OrderAcknowledgementTest.php" hash="ec258b97dcdea4cf0f32abbe4dca3846"/><file name="ProductCreationResultTest.php" hash="925f49219cb866042d0f5fa3b3bbceb2"/><file name="ProductMessageTest.php" hash="70c0ef075db83195b5767fd21cb0e1a9"/><file name="SingleOfBackOrderTest.php" hash="56ec1bd486a42d7bee62d5aac02dccd2"/><file name="SingleOfChannelProductChangesResponseTest.php" hash="6687c279b79298dc67490387637d19fb"/><file name="SingleOfMerchantProductResponseTest.php" hash="856d0ed5e85f30d263dc3f4b5a59e58a"/><file name="SingleOfProductCreationResultTest.php" hash="02720936c9cd7429c65ae0ebe6a57ecd"/></dir></dir><dir name=".git"><file name="FETCH_HEAD" hash="50aedfd6cdb44301be798508ac5acef2"/><file name="HEAD" hash="4cf2d64e44205fe628ddd534e1151b58"/><file name="ORIG_HEAD" hash="06a9e2afbf9b997b720e67b1a94c4f11"/><file name="config" hash="5bccd44cac74d41f008aae4b2c1165ac"/><file name="description" hash="a0a7c3fff21f2aea3cfa1d0316dd816c"/><dir name="hooks"><file name="applypatch-msg.sample" hash="ce562e08d8098926a3862fc6e7905199"/><file name="commit-msg.sample" hash="579a3c1e12a1e74a98169175fb913012"/><file name="post-update.sample" hash="2b7ea5cee3c49ff53d41e00785eb974c"/><file name="pre-applypatch.sample" hash="054f9ffb8bfe04a599751cc757226dda"/><file name="pre-commit.sample" hash="01b1688f97f94776baae85d77b06048b"/><file name="pre-push.sample" hash="3c5989301dd4b949dfa1f43738a22819"/><file name="pre-rebase.sample" hash="81005745454846bb79cc3c7c0c57658d"/><file name="prepare-commit-msg.sample" hash="7dfe15854212a30f346da5255c1d794b"/><file name="update.sample" hash="517f14b9239689dff8bda3022ebd9004"/></dir><file name="index" hash="3c7c7cf0ed3af3811696234c1e73cea2"/><dir name="info"><file name="exclude" hash="036208b4a1ab4a235d75c181e685e5a3"/><file name="refs" hash="08b5e1faac123d197d9c12a48005fd90"/></dir><dir name="logs"><file name="HEAD" hash="8c545eccfdc179b4384ba6676e4c62a3"/><dir name="refs"><dir name="heads"><file name="master" hash="71bb8c4bd4476f08ad74e986ea956a96"/></dir><dir name="remotes"><dir name="composer"><file name="api-v1" hash="bee5d577b35a6735030e7a1b5b4f1d8e"/><file name="api-v2" hash="f8d9397b6cbadde9173c1395951f6f6d"/><file name="master" hash="f5a13f8ffb1879af9b0f976df6514769"/></dir><dir name="origin"><file name="HEAD" hash="71bb8c4bd4476f08ad74e986ea956a96"/></dir></dir></dir></dir><dir name="objects"><dir name="info"><file name="packs" hash="752af241acaffff3a9471b72351cedd3"/></dir><dir name="pack"><file name="pack-e47c47649f897a00201c5eef09d8762776889f22.idx" hash="f5de3502fe2a901601f1ceb67f836e41"/><file name="pack-e47c47649f897a00201c5eef09d8762776889f22.pack" hash="ae0f7a609579239e92567c0574aa8026"/></dir></dir><file name="packed-refs" hash="7b18f74236c4f08e819dcdbf4b4f7723"/><dir name="refs"><dir name="heads"><file name="master" hash="06a9e2afbf9b997b720e67b1a94c4f11"/></dir><dir name="remotes"><dir name="composer"><file name="api-v1" hash="b754879e8b12404e41d9e4f0b41a2929"/><file name="api-v2" hash="a7071c5c96db32edc80867805c2304ae"/><file name="master" hash="06a9e2afbf9b997b720e67b1a94c4f11"/></dir><dir name="origin"><file name="HEAD" hash="73a00957034783b7b5c8294c54cd3e12"/></dir></dir></dir></dir><file name=".gitignore" hash="a72c432223a956b74e9bd5ea5dd8b8c3"/><file name=".php_cs" hash="a921a6cf564b1304d4ff8721ab46d435"/><file name=".travis.yml" hash="8c1fae058e6e8d1f0d2fd39dc488a850"/></dir></dir><dir name="composer"><file name="ClassLoader.php" hash="292c079dbe63ba06bfbf37fd99fe4bf9"/><file name="LICENSE" hash="955d5fe58c231244f6b49000f383b5e2"/><file name="autoload_classmap.php" hash="8645d3a4e3ad87e7cf4d88a46717aab4"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="34e17c04104094e954858e2e564ff4b0"/><file name="autoload_real.php" hash="692ff591b75b6853c6661061389055a9"/><file name="autoload_static.php" hash="e4628c11a0745f787a3e9de5a5de4ad7"/><file name="installed.json" hash="cd50a8b83c078b04628a5aa85e5551b5"/></dir></dir><file name=".gitignore" hash="ff52e986b98e9119818fbe49c33b967f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="channelengine.xml" hash="ae6a00b46a84a610964743034eb72081"/></dir><dir name="template"><dir name="channelengine"><dir name="checkout"><file name="success.phtml" hash="dbcb8298cd52a3c44560ae911349a3c7"/></dir><file name="head.phtml" hash="a7a7ab566adc1dc7d2645bf1cdfac0d4"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="channelengine"><dir name="system"><dir name="config"><dir name="feed"><file name="generate_button.phtml" hash="ed8c5f4a81f19c7ceaacd1b1c004772e"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
28 |
<compatible/>
|
29 |
+
<dependencies><required><php><min>5.4.0</min><max>7.1.3</max></php><extension><name>curl</name><min/><max/></extension><extension><name>mbstring</name><min/><max/></extension><extension><name>json</name><min/><max/></extension></required></dependencies>
|
30 |
</package>
|