1 | <?php |
||
11 | class Multiorders extends MoipResource |
||
12 | { |
||
13 | /** |
||
14 | * @const string |
||
15 | */ |
||
16 | const PATH = 'multiorders'; |
||
17 | |||
18 | /** |
||
19 | * Initializes new instances. |
||
20 | */ |
||
21 | public function initialize() |
||
27 | |||
28 | /** |
||
29 | * Structure of order. |
||
30 | * |
||
31 | * @param Orders $order |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | public function addOrder(Orders $order) |
||
41 | |||
42 | /** |
||
43 | * Create a new multiorder in MoIP. |
||
44 | * |
||
45 | * @return stdClass |
||
46 | */ |
||
47 | public function create() |
||
51 | |||
52 | /** |
||
53 | * Get an multiorder in MoIP. |
||
54 | * |
||
55 | * @param string $id_moip Id MoIP order id |
||
56 | * |
||
57 | * @return stdClass |
||
58 | */ |
||
59 | public function get($id_moip) |
||
63 | |||
64 | /** |
||
65 | * Get MoIP order id. |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getId() |
||
73 | |||
74 | /** |
||
75 | * Get own request id. external reference. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getOwnId() |
||
83 | |||
84 | /** |
||
85 | * Get order status. |
||
86 | * Possible values: CREATED, WAITING, PAID, NOT_PAID, REVERTED. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getStatus() |
||
94 | |||
95 | /** |
||
96 | * Get total value of order. |
||
97 | * |
||
98 | * @return int|float |
||
99 | */ |
||
100 | public function getAmountTotal() |
||
104 | |||
105 | /** |
||
106 | * Get currency used in the application. Possible values: BRL. |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getAmountCurrency() |
||
114 | |||
115 | /** |
||
116 | * Get creation date of launch. |
||
117 | * |
||
118 | * @return \DateTime |
||
119 | */ |
||
120 | public function getCreatedAt() |
||
121 | { |
||
122 | // todo: didn't find createdAt type on documentation, assuming datetime. Have to confirm |
||
123 | return $this->getIfSetDateTime('createdAt'); |
||
124 | } |
||
125 | |||
126 | /** |
||
127 | * Get date of last update. |
||
128 | * |
||
129 | * @return \DateTime |
||
130 | */ |
||
131 | public function getUpdatedAt() |
||
135 | |||
136 | /** |
||
137 | * Get orders. |
||
138 | * |
||
139 | * @return \ArrayIterator |
||
140 | */ |
||
141 | public function getOrderIterator() |
||
145 | |||
146 | /** |
||
147 | * Structure of multipayments. |
||
148 | * |
||
149 | * @return \Moip\Resource\Payment |
||
150 | */ |
||
151 | public function multipayments() |
||
158 | |||
159 | /** |
||
160 | * Mount the structure of order. |
||
161 | * |
||
162 | * @param \stdClass $response |
||
163 | * |
||
164 | * @return Multiorders |
||
165 | */ |
||
166 | protected function populate(stdClass $response) |
||
191 | |||
192 | /** |
||
193 | * Set own request id. External reference. |
||
194 | * |
||
195 | * @param string $ownId |
||
196 | * |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function setOwnId($ownId) |
||
205 | } |
||
206 |