@@ 7-64 (lines=58) @@ | ||
4 | ||
5 | use Codexshaper\WooCommerce\PHP\WooCommerce; |
|
6 | ||
7 | class Note extends BaseModel |
|
8 | { |
|
9 | protected $endpoint; |
|
10 | ||
11 | /** |
|
12 | * Retrieve all Items. |
|
13 | * |
|
14 | * @param int $order_id |
|
15 | * @param array $options |
|
16 | * |
|
17 | * @return array |
|
18 | */ |
|
19 | protected function all($order_id, $options = []) |
|
20 | { |
|
21 | return WooCommerce::all("orders/{$order_id}/notes", $options); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * Retrieve single Item. |
|
26 | * |
|
27 | * @param int $order_id |
|
28 | * @param int $note_id |
|
29 | * @param array $options |
|
30 | * |
|
31 | * @return object |
|
32 | */ |
|
33 | protected function find($order_id, $note_id, $options = []) |
|
34 | { |
|
35 | return WooCommerce::find("orders/{$order_id}/notes/{$note_id}", $options); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * Create new Item. |
|
40 | * |
|
41 | * @param int $order_id |
|
42 | * @param array $data |
|
43 | * |
|
44 | * @return object |
|
45 | */ |
|
46 | protected function create($order_id, $data) |
|
47 | { |
|
48 | return WooCommerce::create("orders/{$order_id}/notes", $data); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * Destroy Item. |
|
53 | * |
|
54 | * @param int $order_id |
|
55 | * @param int $note_id |
|
56 | * @param array $options |
|
57 | * |
|
58 | * @return object |
|
59 | */ |
|
60 | protected function delete($order_id, $note_id, $options = []) |
|
61 | { |
|
62 | return WooCommerce::delete("orders/{$order_id}/notes/{$note_id}", $options); |
|
63 | } |
|
64 | } |
|
65 |
@@ 7-64 (lines=58) @@ | ||
4 | ||
5 | use Codexshaper\WooCommerce\PHP\WooCommerce; |
|
6 | ||
7 | class Refund extends BaseModel |
|
8 | { |
|
9 | protected $endpoint; |
|
10 | ||
11 | /** |
|
12 | * Retrieve all Items. |
|
13 | * |
|
14 | * @param int $order_id |
|
15 | * @param array $options |
|
16 | * |
|
17 | * @return array |
|
18 | */ |
|
19 | protected function all($order_id, $options = []) |
|
20 | { |
|
21 | return WooCommerce::all("orders/{$order_id}/refunds", $options); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * Retrieve single Item. |
|
26 | * |
|
27 | * @param int $order_id |
|
28 | * @param int $refund_id |
|
29 | * @param array $options |
|
30 | * |
|
31 | * @return object |
|
32 | */ |
|
33 | protected function find($order_id, $refund_id, $options = []) |
|
34 | { |
|
35 | return WooCommerce::find("orders/{$order_id}/refunds/{$refund_id}", $options); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * Create new Item. |
|
40 | * |
|
41 | * @param int $order_id |
|
42 | * @param array $data |
|
43 | * |
|
44 | * @return object |
|
45 | */ |
|
46 | protected function create($order_id, $data) |
|
47 | { |
|
48 | return WooCommerce::create("orders/{$order_id}/refunds", $data); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * Destroy Item. |
|
53 | * |
|
54 | * @param int $order_id |
|
55 | * @param int $refund_id |
|
56 | * @param array $options |
|
57 | * |
|
58 | * @return object |
|
59 | */ |
|
60 | protected function delete($order_id, $refund_id, $options = []) |
|
61 | { |
|
62 | return WooCommerce::delete("orders/{$order_id}/refunds/{$refund_id}", $options); |
|
63 | } |
|
64 | } |
|
65 |