@@ 66-86 (lines=21) @@ | ||
63 | * @param string $site (default: null) |
|
64 | * @return ApiResponse |
|
65 | */ |
|
66 | public function ordersEdit(array $order, $by = 'externalId', $site = null) |
|
67 | { |
|
68 | if (!sizeof($order)) { |
|
69 | throw new \InvalidArgumentException('Parameter `order` must contains a data'); |
|
70 | } |
|
71 | ||
72 | $this->checkIdParameter($by); |
|
73 | ||
74 | if (!isset($order[$by])) { |
|
75 | throw new \InvalidArgumentException(sprintf('Order array must contain the "%s" parameter.', $by)); |
|
76 | } |
|
77 | ||
78 | return $this->client->makeRequest( |
|
79 | "/orders/" . $order[$by] . "/edit", |
|
80 | Client::METHOD_POST, |
|
81 | $this->fillSite($site, array( |
|
82 | 'order' => json_encode($order), |
|
83 | 'by' => $by, |
|
84 | )) |
|
85 | ); |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * Upload array of the orders |
|
@@ 275-298 (lines=24) @@ | ||
272 | * @param string $site (default: null) |
|
273 | * @return ApiResponse |
|
274 | */ |
|
275 | public function customersEdit(array $customer, $by = 'externalId', $site = null) |
|
276 | { |
|
277 | if (!sizeof($customer)) { |
|
278 | throw new \InvalidArgumentException('Parameter `customer` must contains a data'); |
|
279 | } |
|
280 | ||
281 | $this->checkIdParameter($by); |
|
282 | ||
283 | if (!isset($customer[$by])) { |
|
284 | throw new \InvalidArgumentException(sprintf('Customer array must contain the "%s" parameter.', $by)); |
|
285 | } |
|
286 | ||
287 | return $this->client->makeRequest( |
|
288 | "/customers/" . $customer[$by] . "/edit", |
|
289 | Client::METHOD_POST, |
|
290 | $this->fillSite( |
|
291 | $site, |
|
292 | array( |
|
293 | 'customer' => json_encode($customer), |
|
294 | 'by' => $by |
|
295 | ) |
|
296 | ) |
|
297 | ); |
|
298 | } |
|
299 | ||
300 | /** |
|
301 | * Upload array of the customers |