Channelpilotsolutions_Channelpilot - Version 2.3.0

Version Notes

- added as comment in the order:
expectedShippingTimeFrom
expectedShippingTimeTo
isBusinessOrder
purchaseOrderNumber
externalTransactionId
- added discount

Download this release

Release Info

Developer ChannelPilot Solutions GmbH
Extension Channelpilotsolutions_Channelpilot
Version 2.3.0
Comparing to
See all releases


Code changes from version 2.2.8 to 2.3.0

Files changed (60) hide show
  1. app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/ExternalTransactionId/Values.php +33 -0
  2. app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Orderid/Values.php +33 -0
  3. app/code/community/Channelpilotsolutions/Channelpilot/Helper/Data.php +3 -3
  4. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/1_0/thin/CPOrderHeader.php +2 -1
  5. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/CPResultCodes.php +29 -0
  6. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/ChannelPilotSellerAPI_v3_2.php +194 -0
  7. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetManagedArticlePricesResponse.php +19 -0
  8. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetNewMarketplaceOrdersResponse.php +27 -0
  9. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetServerTimeResponse.php +14 -0
  10. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/Response.php +14 -0
  11. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/UpdateOrderResult.php +12 -0
  12. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/UpdateOrdersResponse.php +11 -0
  13. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPAddress.php +87 -0
  14. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPArticle.php +24 -0
  15. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPAuth.php +24 -0
  16. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCancellation.php +37 -0
  17. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCustomer.php +67 -0
  18. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCustomerGroup.php +21 -0
  19. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPDelivery.php +59 -0
  20. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPManagedArticlePrice.php +32 -0
  21. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPMoney.php +29 -0
  22. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrder.php +66 -0
  23. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderHeader.php +58 -0
  24. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderItem.php +74 -0
  25. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderStatus.php +58 -0
  26. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderSummary.php +34 -0
  27. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPPayment.php +29 -0
  28. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPRefund.php +39 -0
  29. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPResponseHeader.php +20 -0
  30. app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPShipping.php +24 -0
  31. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPAbstractHandler.php +1 -1
  32. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPCancellationHandler.php +1 -1
  33. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPDeliveryHandler.php +1 -1
  34. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPNewPriceHandler.php +1 -1
  35. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPOrderHandler.php +149 -42
  36. app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPPaymentHandler.php +1 -1
  37. app/code/community/Channelpilotsolutions/Channelpilot/etc/config.xml +12 -2
  38. app/code/community/Channelpilotsolutions/Channelpilot/etc/system.xml +29 -1
  39. app/code/community/Channelpilotsolutions/Channelpilot/sql/channelpilot_setup/mysql4-upgrade-2.2.7-2.3.0.php +20 -0
  40. app/locale/de_AT/Channelpilotsolutions_Channelpilot.csv +99 -97
  41. app/locale/de_CH/Channelpilotsolutions_Channelpilot.csv +99 -97
  42. app/locale/de_DE/Channelpilotsolutions_Channelpilot.csv +99 -97
  43. app/locale/en_AU/Channelpilotsolutions_Channelpilot.csv +99 -97
  44. app/locale/en_CA/Channelpilotsolutions_Channelpilot.csv +99 -97
  45. app/locale/en_GB/Channelpilotsolutions_Channelpilot.csv +99 -97
  46. app/locale/en_IE/Channelpilotsolutions_Channelpilot.csv +99 -97
  47. app/locale/en_NZ/Channelpilotsolutions_Channelpilot.csv +99 -97
  48. app/locale/en_US/Channelpilotsolutions_Channelpilot.csv +99 -97
  49. app/locale/es_AR/Channelpilotsolutions_Channelpilot.csv +66 -64
  50. app/locale/es_CL/Channelpilotsolutions_Channelpilot.csv +66 -64
  51. app/locale/es_CO/Channelpilotsolutions_Channelpilot.csv +66 -64
  52. app/locale/es_CR/Channelpilotsolutions_Channelpilot.csv +66 -64
  53. app/locale/es_ES/Channelpilotsolutions_Channelpilot.csv +66 -64
  54. app/locale/es_MX/Channelpilotsolutions_Channelpilot.csv +66 -64
  55. app/locale/es_PA/Channelpilotsolutions_Channelpilot.csv +66 -64
  56. app/locale/es_PE/Channelpilotsolutions_Channelpilot.csv +66 -64
  57. app/locale/es_VE/Channelpilotsolutions_Channelpilot.csv +66 -64
  58. app/locale/fr_CA/Channelpilotsolutions_Channelpilot.csv +66 -64
  59. app/locale/fr_FR/Channelpilotsolutions_Channelpilot.csv +66 -64
  60. package.xml +11 -5
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/ExternalTransactionId/Values.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Channelpilotsolutions_Channelpilot to newer
12
+ * versions in the future. If you wish to customize Channelpilotsolutions_Channelpilot for your
13
+ * needs please refer to http://www.channelpilot.com for more information.
14
+ *
15
+ * @category Channelpilotsolutions
16
+ * @package Channelpilotsolutions_Channelpilot
17
+ * @subpackage adminhtml_model_cookiemode
18
+ * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
19
+ * @author Peter Hoffmann <info@channelpilot.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.channelpilot.com
22
+ */
23
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_ExternalTransactionId_Values
24
+ {
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => 'orderComment', 'label'=>'Order Comment'),
29
+ array('value' => 'noWhere', 'label'=>'Don\'t Show')
30
+ );
31
+ }
32
+ }
33
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Adminhtml/Model/Orderid/Values.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the GNU General Public License (GPL 3)
7
+ * that is bundled with this package in the file LICENSE.txt
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade Channelpilotsolutions_Channelpilot to newer
12
+ * versions in the future. If you wish to customize Channelpilotsolutions_Channelpilot for your
13
+ * needs please refer to http://www.channelpilot.com for more information.
14
+ *
15
+ * @category Channelpilotsolutions
16
+ * @package Channelpilotsolutions_Channelpilot
17
+ * @subpackage adminhtml_model_cookiemode
18
+ * @copyright Copyright (c) 2012 <info@channelpilot.com> - www.channelpilot.com
19
+ * @author Peter Hoffmann <info@channelpilot.com>
20
+ * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
+ * @link http://www.channelpilot.com
22
+ */
23
+ class Channelpilotsolutions_Channelpilot_Adminhtml_Model_Orderid_Values
24
+ {
25
+ public function toOptionArray()
26
+ {
27
+ return array(
28
+ array('value' => 'orderId', 'label'=>'Order ID'),
29
+ array('value' => 'externalTransactionId', 'label'=>'External Transaction Id')
30
+ );
31
+ }
32
+ }
33
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/Data.php CHANGED
@@ -43,9 +43,9 @@ require_once 'responses/CPGetStatusHookResponse.php';
43
  require_once 'responses/CPRegisterHookResponse.php';
44
 
45
  // API
46
- require_once 'api/1_0/thin/CPDelivery.php';
47
- require_once 'api/1_0/ChannelPilotSellerAPI_v1_0.php';
48
- require_once 'api/1_0/CPResultCodes.php';
49
 
50
  // special customer functions
51
  require_once 'special/CustomerFunctions.php';
43
  require_once 'responses/CPRegisterHookResponse.php';
44
 
45
  // API
46
+ require_once 'api/3_2/thin/CPDelivery.php';
47
+ require_once 'api/3_2/ChannelPilotSellerAPI_v3_2.php';
48
+ require_once 'api/3_2/CPResultCodes.php';
49
 
50
  // special customer functions
51
  require_once 'special/CustomerFunctions.php';
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/1_0/thin/CPOrderHeader.php CHANGED
@@ -3,11 +3,12 @@
3
  /**
4
  * meta-data for an order.
5
  * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
- * @version 1.0
7
  */
8
  class CPOrderHeader {
9
  public $orderId;
10
  public $orderIdExternal;
 
11
 
12
  public $status;
13
 
3
  /**
4
  * meta-data for an order.
5
  * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 2.0
7
  */
8
  class CPOrderHeader {
9
  public $orderId;
10
  public $orderIdExternal;
11
+ public $orderIdExternalTransactionId;
12
 
13
  public $status;
14
 
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/CPResultCodes.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CPResultCodes. Collection of possible resultCodes for a request.
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class CPResultCodes {
8
+ // successfull
9
+ const SUCCESS = 200;
10
+
11
+ // client errors
12
+ const AUTH_ERROR = 401;
13
+ const ID_NOT_FOUND = 404;
14
+ const METHOD_INVALID = 405;
15
+ const REQUEST_INVALID = 406;
16
+ const DUPLICATED_ID_FOUND = 407;
17
+ const TOO_MANY_ELEMENTS = 413;
18
+
19
+ // server error
20
+ const SYSTEM_ERROR = 500;
21
+
22
+ const SHOP_ERROR_PAYMENT_METHOD_UNKNOWN = 700;
23
+ const SHOP_ERROR_DELIVERY_METHOD_UNKNOWN = 701;
24
+ const SHOP_ERROR_ARTICLE_UNKNOWN = 702;
25
+ const SHOP_ERROR_ARTICLE_UNKNOWN_EXISTING_ORDER = 703;
26
+ const SHOP_ERROR_MORE_THAN_ONE_ARTICLES_FOUND = 704;
27
+ }
28
+
29
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/ChannelPilotSellerAPI_v3_2.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // include the stub-classes
4
+ require_once 'thin/CPAuth.php';
5
+ require_once 'thin/CPResponseHeader.php';
6
+ require_once 'thin/CPAddress.php';
7
+ require_once 'thin/CPArticle.php';
8
+ require_once 'thin/CPCancellation.php';
9
+ require_once 'thin/CPManagedArticlePrice.php';
10
+ require_once 'thin/CPMoney.php';
11
+ require_once 'thin/CPPayment.php';
12
+ require_once 'thin/CPCustomer.php';
13
+ require_once 'thin/CPCustomerGroup.php';
14
+ require_once 'thin/CPDelivery.php';
15
+ require_once 'thin/CPOrderItem.php';
16
+ require_once 'thin/CPShipping.php';
17
+ require_once 'thin/CPOrderStatus.php';
18
+ require_once 'thin/CPOrderHeader.php';
19
+ require_once 'thin/CPOrder.php';
20
+ require_once 'thin/CPOrderSummary.php';
21
+ require_once 'thin/CPRefund.php';
22
+
23
+ // request-classes
24
+ // response-classes
25
+ require_once 'responses/Response.php';
26
+ require_once 'responses/GetServerTimeResponse.php';
27
+ require_once 'responses/UpdateOrdersResponse.php';
28
+ require_once 'responses/UpdateOrderResult.php';
29
+ require_once 'responses/GetNewMarketplaceOrdersResponse.php';
30
+ require_once 'responses/GetManagedArticlePricesResponse.php';
31
+
32
+ /**
33
+ * Main API-Class
34
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
35
+ * @version 3.2
36
+ */
37
+ class ChannelPilotSellerAPI_v3_2 extends SoapClient {
38
+
39
+ private $auth;
40
+ private $wsdlUrl = 'https://release.seller.api.channelpilot.com/3_2?wsdl';
41
+ private $soapOptions = array(
42
+ 'connection_timeout' => 20,
43
+ 'features' => SOAP_SINGLE_ELEMENT_ARRAYS
44
+ );
45
+ private $classmap = array(
46
+ 'CPAuth' => 'CPAuth',
47
+ 'CPResponseHeader' => 'CPResponseHeader',
48
+ 'AbstractResponse' => 'AbstractResponse',
49
+ 'GetServerTimeResponse' => 'GetServerTimeResponse',
50
+ 'CPArticleUpdate' => 'CPArticleUpdate',
51
+ 'UpdateArticlesResponse' => 'UpdateArticlesResponse',
52
+ 'UpdateArticleResult' => 'UpdateArticleResult',
53
+ 'UpdateOrdersResponse' => 'UpdateOrdersResponse',
54
+ 'UpdateOrderResult' => 'UpdateOrderResult',
55
+ 'CPAddress' => 'CPAddress',
56
+ 'CPArticle' => 'CPArticle',
57
+ 'CPManagedArticlePrice' => 'CPManagedArticlePrice',
58
+ 'CPMoney' => 'CPMoney',
59
+ 'CPPayment' => 'CPPayment',
60
+ 'CPCustomer' => 'CPCustomer',
61
+ 'CPOrderItem' => 'CPOrderItem',
62
+ 'CPShipping' => 'CPShipping',
63
+ 'CPOrderStatus' => 'CPOrderStatus',
64
+ 'CPOrderHeader' => 'CPOrderHeader',
65
+ 'CPOrder' => 'CPOrder',
66
+ 'CPOrderSummary' => 'CPOrderSummary',
67
+ 'GetNewMarketplaceOrdersResponse' => 'GetNewMarketplaceOrdersResponse',
68
+ 'GetManagedArticlePricesResponse' => 'GetManagedArticlePricesResponse',
69
+ 'CPRefund' => 'CPRefund'
70
+ );
71
+
72
+ public function __construct($merchantId, $shopToken) {
73
+ $this->auth = new CPAuth($merchantId, $shopToken);
74
+
75
+ foreach ($this->classmap as $key => $value) {
76
+ if (!isset($this->soapOptions['classmap'][$key])) {
77
+ $this->soapOptions['classmap'][$key] = $value;
78
+ }
79
+ }
80
+ parent::__construct($this->wsdlUrl, $this->soapOptions);
81
+ }
82
+
83
+ /**
84
+ * Receives the acutal server time. Can be used to test the connection.
85
+ * @return GetServerTimeResponse
86
+ */
87
+ public function getServerTime() {
88
+ return $this->__call(
89
+ 'getServerTime',
90
+ array(
91
+ new SoapParam($this->auth, 'auth')
92
+ )
93
+ );
94
+ }
95
+
96
+ /**
97
+ * retrieves new marketplace orders
98
+ * @return GetNewMarketplaceOrdersResponse
99
+ */
100
+ public function getNewMarketplaceOrders() {
101
+ return $this->__call(
102
+ 'getNewMarketplaceOrders',
103
+ array(
104
+ new SoapParam($this->auth, 'auth')
105
+ )
106
+ );
107
+ }
108
+
109
+ /**
110
+ * update orders in ChannelPilot to "imported", generates the matching between externalOrderId and the shop-internal orderId
111
+ * q
112
+ * @return GetNewMarketplaceOrdersResponse
113
+ */
114
+
115
+
116
+ /**
117
+ * update orders in ChannelPilot to "imported", generates the matching between externalOrderId and the shop-internal orderId
118
+ * @param array $orders array of CPOrders
119
+ * @param type $mapOrderItemIds boolean, if channelPilot should map your internal orderItemIds
120
+ * @return type
121
+ */
122
+ public function setImportedOrders(array $orders, $mapOrderItemIds) {
123
+ return $this->__call(
124
+ 'setImportedOrders',
125
+ array(
126
+ new SoapParam($this->auth, 'auth'),
127
+ new SoapParam($orders, 'importedOrders'),
128
+ new SoapParam($mapOrderItemIds, 'mapOrderItemIds')
129
+ )
130
+ );
131
+ }
132
+
133
+
134
+ public function registerDeliveries(array $deliveries) {
135
+ return $this->__call(
136
+ 'registerDeliveries',
137
+ array(
138
+ new SoapParam($this->auth, 'auth'),
139
+ new SoapParam($deliveries, 'deliveries')
140
+ )
141
+ );
142
+ }
143
+
144
+ public function registerCancellations(array $cancellations) {
145
+ return $this->__call(
146
+ 'registerCancellations',
147
+ array(
148
+ new SoapParam($this->auth, 'auth'),
149
+ new SoapParam($cancellations, 'cancellations')
150
+ )
151
+ );
152
+ }
153
+
154
+ public function getDynamicArticlePrices($priceId, $method, $filterArticles, $filterFrom) {
155
+ return $this->__call(
156
+ 'getDynamicArticlePrices',
157
+ array(
158
+ new SoapParam($this->auth, 'auth'),
159
+ new SoapParam($priceId, 'priceId'),
160
+ new SoapParam(null, 'pagination'),
161
+ new SoapParam($method, 'method'),
162
+ new SoapParam($filterArticles, 'filterArticles'),
163
+ new SoapParam($filterFrom, 'filterFrom')
164
+ )
165
+ );
166
+ }
167
+
168
+ /**
169
+ * Set paymentTime in ChannelPilot. Send CPOrder with CPOrderHeader and CPPayment (paymentTime is necessary).
170
+ * @param CPOrder[] $orders
171
+ * @return UpdateOrdersResponse
172
+ */
173
+ public function setPaidOrders(array $orders) {
174
+ return $this->__call(
175
+ 'setPaidOrders', array(
176
+ new SoapParam($this->auth, 'auth'),
177
+ new SoapParam($orders, 'paidOrders')
178
+ )
179
+ );
180
+ }
181
+
182
+ /**
183
+ *
184
+ *
185
+ */
186
+ public function registerRefunds(array $refunds) {
187
+ return $this->__call(
188
+ 'registerRefunds', array(
189
+ new SoapParam($this->auth, 'auth'),
190
+ new SoapParam($refunds, 'refunds')
191
+ )
192
+ );
193
+ }
194
+ }
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetManagedArticlePricesResponse.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * GetManagedArticlePricesResponse.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class GetManagedArticlePricesResponse extends Response {
9
+ /**
10
+ * array of managed article prices, can be empty
11
+ * @var type CPManagedArticlePrice[]
12
+ */
13
+
14
+ public $moreAvailable;
15
+ public $countMoreAvailable;
16
+ public $managedArticlePrices = array();
17
+ }
18
+
19
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetNewMarketplaceOrdersResponse.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * GetNewMarketplaceOrdersResponse.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class GetNewMarketplaceOrdersResponse extends Response {
9
+ /**
10
+ * are more orders available, than could be returned in this call
11
+ * @var type boolean
12
+ */
13
+ public $moreAvailable;
14
+
15
+ /**
16
+ *
17
+ */
18
+ public $countMoreAvailable;
19
+
20
+ /**
21
+ * array of new orders, can be empty
22
+ * @var type CPOrder[]
23
+ */
24
+ public $orders = array();
25
+ }
26
+
27
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/GetServerTimeResponse.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * GetServerTimeResponse.
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class GetServerTimeResponse extends Response {
8
+ /**
9
+ * @var type string
10
+ */
11
+ public $localTime;
12
+ }
13
+
14
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/Response.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AbstractRequestResponse.
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class Response {
8
+ /**
9
+ * @var type CPResponseHeader
10
+ */
11
+ public $header;
12
+ }
13
+
14
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/UpdateOrderResult.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * UpdateOrderResult
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class UpdateOrderResult {
8
+ public $orderHeader;
9
+ public $header;
10
+ }
11
+
12
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/responses/UpdateOrdersResponse.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * UpdateOrdersResponse
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class UpdateOrdersResponse extends Response {
8
+ public $updateResults = array();
9
+ }
10
+
11
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPAddress.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Holds an address. e.g. a shipping-address
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPAddress {
9
+
10
+ /**
11
+ * 1 for male, 2 for female, -1 for unknown/default. ChannelPilot will try to determine genderId if not provided by the channel.
12
+ * @var type int
13
+ */
14
+ public $genderId;
15
+
16
+ /**
17
+ * @var type string
18
+ */
19
+ public $nameFirst;
20
+
21
+ /**
22
+ * @var type string
23
+ */
24
+ public $nameLast;
25
+
26
+ /**
27
+ * @var type string
28
+ */
29
+ public $nameFull;
30
+
31
+ /**
32
+ * @var type string
33
+ */
34
+ public $company;
35
+
36
+ /**
37
+ * @var type string
38
+ */
39
+ public $streetTitle;
40
+
41
+ /**
42
+ * @var type string
43
+ */
44
+ public $streetNumber;
45
+
46
+ /**
47
+ * @var type string
48
+ */
49
+ public $streetFull;
50
+
51
+ /**
52
+ * @var type string
53
+ */
54
+ public $streetExtra;
55
+
56
+ /**
57
+ * @var type string
58
+ */
59
+ public $zip;
60
+
61
+ /**
62
+ * @var type string
63
+ */
64
+ public $city;
65
+
66
+ /**
67
+ * @var type string
68
+ */
69
+ public $countryIso2;
70
+
71
+ /**
72
+ * @var type string
73
+ */
74
+ public $countryIso3;
75
+
76
+ /**
77
+ * @var type string
78
+ */
79
+ public $state;
80
+
81
+ /**
82
+ * @var type string
83
+ */
84
+ public $phone;
85
+ }
86
+
87
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPArticle.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPArticle {
7
+
8
+ /**
9
+ * @var type string
10
+ */
11
+ public $id;
12
+
13
+ /**
14
+ * @var type string
15
+ */
16
+ public $idExternal;
17
+
18
+ /**
19
+ * @var type string
20
+ */
21
+ public $title;
22
+ }
23
+
24
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPAuth.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Basic authentication class to use the ChannelPilot seller API.
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class CPAuth {
8
+ /**
9
+ * MerchantId for your ChannelPilot account. You can get from go.channelpilot.com/api.
10
+ * @var type string
11
+ */
12
+ public $merchantId;
13
+ /**
14
+ * ShopToken for your shop in ChannelPilot. You can get from go.channelpilot.com/api.
15
+ * @var type string
16
+ */
17
+ public $shopToken;
18
+
19
+ function __construct($merchantId, $shopToken) {
20
+ $this->merchantId = $merchantId;
21
+ $this->shopToken = $shopToken;
22
+ }
23
+ }
24
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCancellation.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Holds information about a cancellation.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPCancellation {
9
+
10
+ /**The header of the order required to identify your order.
11
+ * @var type CPOrderHeader
12
+ */
13
+ public $orderHeader;
14
+
15
+ /**
16
+ * @var type string
17
+ */
18
+ public $cancellationTime;
19
+
20
+ /**
21
+ * @var type boolean
22
+ */
23
+ public $isWholeOrderCancelled;
24
+
25
+ /**
26
+ * @var type CPOrderItem[]
27
+ */
28
+ public $cancelledItems = array();
29
+
30
+ function __construct($orderId, $statusIdBefore, $source, $cancellationTime, $isWholeOrderCancelled) {
31
+ $this->orderHeader = new CPOrderHeader (null,$orderId,$source, $isWholeOrderCancelled ? CPOrderStatus::ID_CANCELLED : $statusIdBefore, false, null);
32
+ $this->cancellationTime = $cancellationTime;
33
+ $this->isWholeOrderCancelled = $isWholeOrderCancelled;
34
+ }
35
+ }
36
+
37
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCustomer.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Holds information about a customer.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPCustomer {
9
+
10
+ /**
11
+ * ID of the customer on the marketplace.
12
+ * @var type string
13
+ */
14
+ public $idExternal;
15
+
16
+ /**
17
+ * 0 for male, 1 for female. ChannelPilot will try to determine genderId if not provided by
18
+ * @var type int
19
+ */
20
+ public $genderId;
21
+
22
+ /**
23
+ * @var type CPCustomerGroup[]
24
+ */
25
+ public $customerGroups = array();
26
+
27
+ /**
28
+ * @var type string
29
+ */
30
+ public $nameFirst;
31
+
32
+ /**
33
+ * @var type string
34
+ */
35
+ public $nameLast;
36
+
37
+ /**
38
+ * @var type string
39
+ */
40
+ public $nameFull;
41
+
42
+ /**
43
+ * Email of the customer.
44
+ * Some marketplaces provide “forward-mails” that are only valid for
45
+ * email-forwarding through the marketplace
46
+ * and not for direct communication (e.g.Amazon).
47
+ * @var type string
48
+ */
49
+ public $email;
50
+
51
+ /**
52
+ * @var type string
53
+ */
54
+ public $phone;
55
+
56
+ /**
57
+ * @var type string
58
+ */
59
+ public $mobile;
60
+
61
+ /**
62
+ * @var type string
63
+ */
64
+ public $fax;
65
+ }
66
+
67
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPCustomerGroup.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPCustomerGroup {
7
+
8
+ /**
9
+ * Your ID of the mapped customerGroup.
10
+ * This ID should map to an ID in your Shop- or ERPsystem.
11
+ * @var type string
12
+ */
13
+ public $id;
14
+
15
+ /**
16
+ * @var type string
17
+ */
18
+ public $title;
19
+ }
20
+
21
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPDelivery.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Holds information about a delivery.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPDelivery {
9
+
10
+ /**The header of the order required to identify your order.
11
+ * @var type CPOrderHeader
12
+ */
13
+ public $orderHeader;
14
+
15
+ /**
16
+ * @var type string
17
+ */
18
+ public $deliveryTime;
19
+
20
+ /**
21
+ * the carrier (DHL/UPS/...). if not set, channelpilot will take the default-carrier defined for the orders shippingType
22
+ * @var type String
23
+ */
24
+ public $carrierName;
25
+
26
+ /**
27
+ * are all to be delivered items deliverd after this delivery?
28
+ * @var type boolean
29
+ */
30
+ public $isDeliveryCompleted;
31
+
32
+ /**
33
+ * tracking-number for this delivery
34
+ * @var type String
35
+ */
36
+ public $trackingNumber;
37
+
38
+ /**
39
+ *
40
+ * @var type CPShipping
41
+ */
42
+ public $shipping;
43
+
44
+
45
+ /**
46
+ * array of delivered items. is only evaluated and neccessary if ($isDeliveryCompleted == false).
47
+ * @var type CPOrderItem[]
48
+ */
49
+ public $deliveredItems = array();
50
+
51
+ function __construct($orderId, $source, $isDeliveryCompleted, $trackingNumber, $deliveryTime) {
52
+ $this->orderHeader = new CPOrderHeader(null, $orderId, $source, $isDeliveryCompleted ? CPOrderStatus::ID_DELIVERED : CPOrderStatus::ID_PARTIALLY_DELIVERED, null, false);
53
+ $this->trackingNumber = $trackingNumber;
54
+ $this->deliveryTime = $deliveryTime;
55
+ $this->isDeliveryCompleted = $isDeliveryCompleted;
56
+ }
57
+ }
58
+
59
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPManagedArticlePrice.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Holds an address. e.g. a shipping-address
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPManagedArticlePrice {
9
+
10
+ /**
11
+ * @var type CPArticle
12
+ */
13
+ public $article;
14
+
15
+ /**
16
+ * @var type number
17
+ */
18
+ public $price;
19
+
20
+ /**
21
+ * @var type string
22
+ */
23
+ public $lastUpdate;
24
+
25
+ function __construct($article, $price,$lastUpdate) {
26
+ $this->article=$article;
27
+ $this->price=$price;
28
+ $this->lastUpdate=$lastUpdate;
29
+ }
30
+ }
31
+
32
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPMoney.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPMoney {
7
+
8
+ /**
9
+ * @var type number
10
+ */
11
+ public $gross;
12
+
13
+ /**
14
+ * @var type number
15
+ */
16
+ public $net;
17
+
18
+ /**
19
+ * @var type number
20
+ */
21
+ public $tax;
22
+
23
+ /**
24
+ * @var type number
25
+ */
26
+ public $taxRate;
27
+
28
+ }
29
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrder.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The order class holds information about an order.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPOrder {
9
+
10
+ /**
11
+ * @var type CPOrderHeader
12
+ */
13
+ public $orderHeader;
14
+
15
+ /**
16
+ * @var type CPCustomer
17
+ */
18
+ public $customer;
19
+
20
+ /**
21
+ * @var type CPAdress
22
+ */
23
+ public $addressInvoice;
24
+
25
+ /**
26
+ * @var type CPAdress
27
+ */
28
+ public $addressDelivery;
29
+
30
+ /**
31
+ * @var type CPOrderItem[]
32
+ */
33
+ public $itemsOrdered = array();
34
+
35
+ /**
36
+ * @var type shipping
37
+ */
38
+ public $shipping;
39
+
40
+ /**
41
+ * @var type CPPayment
42
+ */
43
+ public $payment;
44
+
45
+ /**
46
+ * @var type CPOrderSummary
47
+ */
48
+ public $summary;
49
+
50
+ /**
51
+ * @var type CPMoney
52
+ */
53
+ public $discount;
54
+
55
+ /**
56
+ * @var type string
57
+ */
58
+ public $expectedShippingTimeFrom;
59
+
60
+ /**
61
+ * @var type string
62
+ */
63
+ public $expectedShippingTimeTo;
64
+ }
65
+
66
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderHeader.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * meta-data for an order.
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPOrderHeader {
9
+
10
+ /**
11
+ * @var type string
12
+ */
13
+ public $orderId;
14
+
15
+ /**
16
+ * @var type string
17
+ */
18
+ public $orderIdExternal;
19
+
20
+ /**
21
+ * @var type string
22
+ */
23
+ public $orderIdExternalTransactionId;
24
+
25
+ /**
26
+ * @var type string
27
+ */
28
+ public $source;
29
+
30
+ /**
31
+ * @var type CPOrderStatus
32
+ */
33
+ public $status;
34
+
35
+ /**
36
+ * @var type string
37
+ */
38
+ public $orderTime;
39
+
40
+ /**
41
+ * @var type string
42
+ */
43
+ public $purchaseOrderNumber;
44
+
45
+ /**
46
+ * @var type boolean
47
+ */
48
+ public $isBusinessOrder;
49
+
50
+ function __construct($orderIdExternal, $orderId, $source, $statusIdentifier, $hasError, $errorCode) {
51
+ $this->orderIdExternal = $orderIdExternal;
52
+ $this->orderId = $orderId;
53
+ $this->source = $source;
54
+ $this->status = new CPOrderStatus($statusIdentifier, $hasError, $errorCode);
55
+ }
56
+ }
57
+
58
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderItem.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPOrderItem {
7
+
8
+ /**
9
+ * @var type string
10
+ */
11
+ public $id;
12
+
13
+ /**
14
+ * @var type string
15
+ */
16
+ public $idExternal;
17
+
18
+ /**
19
+ * @var type CPArticle
20
+ */
21
+ public $article;
22
+
23
+ /**
24
+ * @var type int
25
+ */
26
+ public $quantityOrdered;
27
+
28
+ /**
29
+ * @var type int
30
+ */
31
+ public $quantityDelivered;
32
+
33
+ /**
34
+ * @var type int
35
+ */
36
+ public $quantityCancelled;
37
+
38
+ /**
39
+ * @var type CPMoney
40
+ */
41
+ public $costsSingle;
42
+
43
+ /**
44
+ * @var type CPMoney
45
+ */
46
+ public $costsTotal;
47
+
48
+ /**
49
+ * @var type number
50
+ */
51
+ public $feeSingleNet;
52
+
53
+ /**
54
+ * @var type number
55
+ */
56
+ public $feeTotalNet;
57
+
58
+ /**
59
+ * @var type CPMoney
60
+ */
61
+ public $discount;
62
+
63
+ /**
64
+ * @var type string
65
+ */
66
+ public $expectedShippingTimeFrom;
67
+
68
+ /**
69
+ * @var type string
70
+ */
71
+ public $expectedShippingTimeTo;
72
+ }
73
+
74
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderStatus.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * an order status
5
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
6
+ * @version 3.2
7
+ */
8
+ class CPOrderStatus {
9
+ const ID_READY_FOR_EXPORT = "10";
10
+ const ID_IMPORTED = "20";
11
+ const ID_PARTIALLY_DELIVERED = "25";
12
+ const ID_DELIVERED = "30";
13
+ const ID_CANCELLED = "99";
14
+
15
+ /**
16
+ * the unique-id for this orderStatus. Has a value of the constants defined in this class.
17
+ * @var type string
18
+ */
19
+ public $identifier;
20
+
21
+ /**
22
+ * the public title for the status, can be null
23
+ * @var type string
24
+ */
25
+ public $publicTitle;
26
+
27
+ /**
28
+ * the public description for the status, can be null
29
+ * @var type string
30
+ */
31
+ public $publicDescription;
32
+
33
+ /**
34
+ * was the orderimport successfully
35
+ * @var type boolean
36
+ */
37
+ public $hasError;
38
+
39
+ /**
40
+ * the public errormessage, can be null
41
+ * @var type string
42
+ */
43
+ public $errorMessage;
44
+
45
+ /**
46
+ * which error, can be null
47
+ * @var type int
48
+ */
49
+ public $errorCode;
50
+
51
+ function __construct($identifier, $hasError, $errorCode) {
52
+ $this->identifier = $identifier;
53
+ $this->hasError = $hasError;
54
+ $this->errorCode = $errorCode;
55
+ }
56
+ }
57
+
58
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPOrderSummary.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPOrderSummary {
7
+
8
+ /**
9
+ * @var type string
10
+ */
11
+ public $currencyIso3;
12
+
13
+ /**
14
+ * @var type CPMoney
15
+ */
16
+ public $totalSumItems;
17
+
18
+ /**
19
+ * @var type CPMoney
20
+ */
21
+ public $totalSumOrder;
22
+
23
+ /**
24
+ * @var type string
25
+ */
26
+ public $message;
27
+
28
+ /**
29
+ * @var type Number
30
+ */
31
+ public $feeTotalNet;
32
+ }
33
+
34
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPPayment.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPPayment {
7
+
8
+ /**
9
+ * @var type string
10
+ */
11
+ public $typeId;
12
+
13
+ /**
14
+ * @var type string
15
+ */
16
+ public $typeTitle;
17
+
18
+ /**
19
+ * @var type CPMoney
20
+ */
21
+ public $costs;
22
+
23
+ /**
24
+ * @var type string
25
+ */
26
+ public $paymentTime;
27
+ }
28
+
29
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPRefund.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPRefund {
7
+ /**The header of the order required to identify your order.
8
+ * @var type CPOrderHeader
9
+ */
10
+ public $orderHeader;
11
+
12
+ /**
13
+ * @var type string
14
+ */
15
+ public $refundTime;
16
+
17
+ /**
18
+ * @var type CPMoney
19
+ */
20
+ public $refund;
21
+
22
+ /**
23
+ * @var type string
24
+ */
25
+ public $refundReason;
26
+
27
+ function __construct($orderId, $refundTime, $refundReason, $net, $gross, $tax, $taxRate) {
28
+ $this->orderHeader = new CPOrderHeader(null, $orderId, null, null, null, null);
29
+ $this->refundTime = $refundTime;
30
+ $this->refundReason = $refundReason;
31
+ $this->refund = new CPMoney();
32
+ $this->refund ->net = $net;
33
+ $this->refund ->gross = $gross;
34
+ $this->refund ->tax = $tax;
35
+ $this->refund ->taxRate = $taxRate;
36
+ }
37
+ }
38
+
39
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPResponseHeader.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Header for a reponse.
4
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
5
+ * @version 3.2
6
+ */
7
+ class CPResponseHeader {
8
+ /**
9
+ * Every request returns a defined result code. @see CPResultCodes
10
+ * @var type int
11
+ */
12
+ public $resultCode;
13
+ /**
14
+ * the message could provide further information about the result.
15
+ * @var type string
16
+ */
17
+ public $resultMessage;
18
+ }
19
+
20
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/api/3_2/thin/CPShipping.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Channel Pilot Solutions GmbH <api@channelpilot.com>
4
+ * @version 3.2
5
+ */
6
+ class CPShipping {
7
+
8
+ /**
9
+ * @var type int
10
+ */
11
+ public $typeId;
12
+
13
+ /**
14
+ * @var type string
15
+ */
16
+ public $typeTitle;
17
+
18
+ /**
19
+ * @var type CPMoney
20
+ */
21
+ public $costs;
22
+ }
23
+
24
+ ?>
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPAbstractHandler.php CHANGED
@@ -9,7 +9,7 @@ class CPAbstractHandler {
9
 
10
  const defaultHeader = "Content-Type: application/json;";
11
  const errorHeader_forbidden = "HTTP/1.0 403 Forbidden";
12
- const ChannelPilot_IP = "148.251.65.130";
13
  const DB_REGISTRATION = "cp_registration";
14
  const DB_PRICES = "cp_prices";
15
  const DB_ORDERS = "cp_marketplace_orders";
9
 
10
  const defaultHeader = "Content-Type: application/json;";
11
  const errorHeader_forbidden = "HTTP/1.0 403 Forbidden";
12
+ const ChannelPilot_IP = "85.10.230.194";
13
  const DB_REGISTRATION = "cp_registration";
14
  const DB_PRICES = "cp_prices";
15
  const DB_ORDERS = "cp_marketplace_orders";
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPCancellationHandler.php CHANGED
@@ -38,7 +38,7 @@ class CPCancellationHandler extends CPAbstractHandler {
38
  self::hookResult(false);
39
  }
40
  $merchantId = self::getMerchantId($token);
41
- $api = new ChannelPilotSellerAPI_v1_0($merchantId, $token);
42
  $result = $api->registerCancellations($cancelled);
43
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
44
  self::changeStatusOrders($result->updateResults);
38
  self::hookResult(false);
39
  }
40
  $merchantId = self::getMerchantId($token);
41
+ $api = new ChannelPilotSellerAPI_v3_2($merchantId, $token);
42
  $result = $api->registerCancellations($cancelled);
43
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
44
  self::changeStatusOrders($result->updateResults);
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPDeliveryHandler.php CHANGED
@@ -131,7 +131,7 @@ class CPDeliveryHandler extends CPAbstractHandler {
131
  }
132
 
133
  $merchantId = self::getMerchantId($token);
134
- $api = new ChannelPilotSellerAPI_v1_0($merchantId, $token);
135
  $result = $api->registerDeliveries($deliveries);
136
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
137
  $defectiveOrderIncrementIds = self::changeStatusOrders($result->updateResults);
131
  }
132
 
133
  $merchantId = self::getMerchantId($token);
134
+ $api = new ChannelPilotSellerAPI_v3_2($merchantId, $token);
135
  $result = $api->registerDeliveries($deliveries);
136
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
137
  $defectiveOrderIncrementIds = self::changeStatusOrders($result->updateResults);
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPNewPriceHandler.php CHANGED
@@ -26,7 +26,7 @@ class CPNewPriceHandler extends CPAbstractHandler {
26
  }
27
  $filterArticles = null;
28
 
29
- $api = new ChannelPilotSellerAPI_v1_0($merchantId, $token);
30
  $result = $api->getDynamicArticlePrices($priceId, $method, $filterArticles, $filterFrom);
31
  $unknownArticles = array();
32
  $lastPriceUpdate = null;
26
  }
27
  $filterArticles = null;
28
 
29
+ $api = new ChannelPilotSellerAPI_v3_2($merchantId, $token);
30
  $result = $api->getDynamicArticlePrices($priceId, $method, $filterArticles, $filterFrom);
31
  $unknownArticles = array();
32
  $lastPriceUpdate = null;
app/code/community/Channelpilotsolutions/Channelpilot/Helper/handler/CPOrderHandler.php CHANGED
@@ -7,6 +7,8 @@
7
  */
8
  class CPOrderHandler extends CPAbstractHandler {
9
 
 
 
10
  protected $shopId;
11
  protected $store;
12
  protected $websiteId;
@@ -27,7 +29,7 @@ class CPOrderHandler extends CPAbstractHandler {
27
  $this->websiteId = $this->store->getWebsiteId();
28
  $oldOrders = self::getOrdersFromDb();
29
  ini_set('allow_url_fopen', 'On');
30
- $api = new ChannelPilotSellerAPI_v1_0($merchantId, $token);
31
  $result = $api->getNewMarketplaceOrders();
32
  // Check ResultCode of getNewMarketplaceOrders Result
33
  if ($result->header->resultCode == CPResultCodes::SUCCESS) {
@@ -121,14 +123,16 @@ class CPOrderHandler extends CPAbstractHandler {
121
 
122
  // set total values
123
  // total gross
124
- $quote->setGrandTotal($apiOrder->summary->totalSumOrder->gross);
125
- $quote->setBaseGrandTotal($apiOrder->summary->totalSumOrder->gross);
126
 
127
  // net
128
  $quote->setSubtotal($apiOrder->summary->totalSumOrder->net);
129
  $quote->setBaseSubtotal($apiOrder->summary->totalSumOrder->net);
130
- $quote->setSubtotalWithDiscount($apiOrder->summary->totalSumOrder->net);
131
- $quote->setBaseSubtotalWithDiscount($apiOrder->summary->totalSumOrder->net);
 
 
132
 
133
  // set item values
134
  /** @var $item Mage_Sales_Model_Quote_Item */
@@ -157,7 +161,13 @@ class CPOrderHandler extends CPAbstractHandler {
157
  // total gross
158
  $item->setRowTotalInclTax($orderItem->costsTotal->gross);
159
  $item->setBaseRowTotalInclTax($orderItem->costsTotal->gross);
160
-
 
 
 
 
 
 
161
  $item->save();
162
  }
163
  }
@@ -229,24 +239,14 @@ class CPOrderHandler extends CPAbstractHandler {
229
  if(array_key_exists($orderItem->article->id, $temp)) {
230
  // add the additonal row to the first one
231
  $temp[$orderItem->article->id]->quantityOrdered += $orderItem->quantityOrdered;
232
- $temp[$orderItem->article->id]->costsTotal->net = $temp[$orderItem->article->id]->costsSingle->net * $temp[$orderItem->article->id]->quantityOrdered;
233
- $temp[$orderItem->article->id]->costsTotal->gross = $temp[$orderItem->article->id]->costsSingle->gross * $temp[$orderItem->article->id]->quantityOrdered;
234
- $temp[$orderItem->article->id]->costsTotal->tax = $temp[$orderItem->article->id]->costsSingle->tax * $temp[$orderItem->article->id]->quantityOrdered;
235
-
236
- // calculate the totals for the current orderItem
237
- $costsNet = $orderItem->quantityOrdered * $orderItem->costsSingle->net;
238
- $costsGross = $orderItem->quantityOrdered * $orderItem->costsSingle->gross;
239
- $costsTax = $orderItem->quantityOrdered * $orderItem->costsSingle->tax;
240
-
241
- // add the calculated totals to the item summary
242
- $apiOrder->summary->totalSumItems->net = $apiOrder->summary->totalSumItems->net + $costsNet;
243
- $apiOrder->summary->totalSumItems->gross = $apiOrder->summary->totalSumItems->gross + $costsGross;
244
- $apiOrder->summary->totalSumItems->tax = $apiOrder->summary->totalSumItems->tax + $costsTax;
245
-
246
- // add the calculated totals to the order summary
247
- $apiOrder->summary->totalSumOrder->net = $apiOrder->summary->totalSumOrder->net + $costsNet;
248
- $apiOrder->summary->totalSumOrder->gross = $apiOrder->summary->totalSumOrder->gross + $costsGross;
249
- $apiOrder->summary->totalSumOrder->tax = $apiOrder->summary->totalSumOrder->tax + $costsTax;
250
  } else {
251
  $temp[$orderItem->article->id] = $orderItem;
252
  }
@@ -323,9 +323,9 @@ class CPOrderHandler extends CPAbstractHandler {
323
  $order = $service->getOrder();
324
  $items = $order->getAllItems();
325
 
 
326
  $orderItemIds = self::getSavedOrderItemArticleIds($items, $idField);
327
  $articleIds = self::getOrderedArticleIds($apiOrder);
328
-
329
  // check if the order has items and the amount of items matches the amount from the seller api
330
  if(count($orderItemIds) == 0 || count($articleIds) != count($orderItemIds)) {
331
  if(!Mage::registry('isSecureArea')) {
@@ -333,8 +333,6 @@ class CPOrderHandler extends CPAbstractHandler {
333
  }
334
  Mage::app('admin');
335
  $order->delete();
336
-
337
- $idField = Mage::getStoreConfig('channelpilot_general/channelpilot_general/channelpilot_articlenumber');
338
 
339
  $articleCount = count($articleIds);
340
  $orderItemCount = count($orderItemIds);
@@ -381,7 +379,8 @@ class CPOrderHandler extends CPAbstractHandler {
381
 
382
  $orderItemsResponse = array();
383
  try {
384
- foreach ($items as $item) {
 
385
  foreach ($apiOrder->itemsOrdered as $orderItem) {
386
  if ($orderItem->article->id == $item->getSku() || $orderItem->article->id == $item->getProductId()) {
387
  $item->setPrice($orderItem->costsSingle->net);
@@ -400,6 +399,15 @@ class CPOrderHandler extends CPAbstractHandler {
400
  $item->setBaseRowTotal($orderItem->costsTotal->net);
401
  $item->setRowTotalInclTax($orderItem->costsTotal->gross);
402
  $item->setBaseRowTotalInclTax($orderItem->costsTotal->gross);
 
 
 
 
 
 
 
 
 
403
 
404
  $item->save();
405
  $orderItem->id = $item->getId();
@@ -466,8 +474,14 @@ class CPOrderHandler extends CPAbstractHandler {
466
  $order->setBaseShippingInclTax($apiOrder->shipping->costs->gross);
467
 
468
  // Grand total
469
- $order->setBaseGrandTotal($apiOrder->summary->totalSumOrder->gross);
470
- $order->setGrandTotal($apiOrder->summary->totalSumOrder->gross);
 
 
 
 
 
 
471
 
472
  $order->setCreatedAt($apiOrder->orderHeader->orderTime);
473
 
@@ -482,7 +496,44 @@ class CPOrderHandler extends CPAbstractHandler {
482
  $order->setData('state', Mage::getStoreConfig('channelpilot_marketplace/channelpilot_marketplace/channelpilot_orderStatusImportedUnpayed'));