1: <?php
2: namespace Izberg\Resource;
3: use Izberg\Resource;
4:
5: class MerchantOrder extends Resource
6: {
7: 8: 9: 10: 11: 12: 13: 14:
15: public function updateStatus($status, $id_order = null, $params = array())
16: {
17: if (!$id_order && !$this->id)
18: throw new Exception("No order_id and no URI");
19: $id_order = $id_order ? $id_order : $this->id;
20: return (parent::$Izberg->Call($this->getName().'/'.$id_order.'/'.$status.'/', 'POST', $params, 'Content-Type: application/json'));
21: }
22:
23: 24: 25: 26: 27:
28: public function createReturn($params)
29: {
30: $params["return_type"] = 1;
31: return self::$Izberg->Call($this->getName()."/". $this->id ."/return/", "POST", $params, "Content-Type: application/json");
32: }
33:
34: 35: 36: 37:
38: public function createRefund($params)
39: {
40: $params["return_type"] = 2;
41: return self::$Izberg->Call($this->getName()."/". $this->id ."/return/", "POST", $params, "Content-Type: application/json");
42: }
43: }
44: