1: <?php
2: namespace Izberg\Resource;
3: use Izberg\Resource;
4:
5: class Order extends Resource
6: {
7:
8: 9: 10: 11: 12: 13: 14: 15:
16: public function updateStatus($status, $id_order = null, $params = array())
17: {
18: if (!$id_order && !$this->id)
19: throw new Exception\GenericException("No order_id and no URI");
20: if ($status != "updateOrderPayment" && $status != "authorizeOrder" && $status != "cancel")
21: throw new Exception\GenericException("Wrong Status : authorizeOrder | updateOrderPayment");
22: $id = $id_order ? $id_order : $this->id;
23: $response = parent::$Izberg->Call($this->getName().'/'.$id.'/'.$status.'/', 'POST', $params, 'Content-Type: application/json');
24: $this->hydrate($response);
25: return $this;
26: }
27: }
28: