This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,19 @@ List a specified order:
355355Magento::api('orders')->show($orderId);
356356```
357357
358+ ` /V1/orders `
359+
360+ Updates an order specified by the entity id within the $body:
361+ ``` php
362+ $body = [
363+ 'entity' => [
364+ 'entity_id' => '', // required
365+ // ... attributes to update
366+ ]
367+ ];
368+ Magento::api('orders')->edit($body);
369+ ```
370+
358371
359372
360373
Original file line number Diff line number Diff line change @@ -32,4 +32,15 @@ public function show($orderId)
3232 {
3333 return $ this ->get ('/orders/ ' .$ orderId );
3434 }
35+
36+ /**
37+ * Edits and saves an order using the specified entity id within the body.
38+ *
39+ * @param array $body
40+ * @return array
41+ */
42+ public function edit ($ body = [])
43+ {
44+ return $ this ->post ('/orders ' , $ body );
45+ }
3546}
Original file line number Diff line number Diff line change @@ -48,4 +48,15 @@ public function test_can_call_magento_show()
4848
4949 $ this ->assertTrue ($ api ->ok ());
5050 }
51+
52+ public function test_can_edit_and_save_order ()
53+ {
54+ Http::fake ([
55+ '*rest/all/V1/orders ' => Http::response ([], 200 ),
56+ ]);
57+
58+ $ api = MagentoFacade::api ('orders ' )->edit ([]);
59+
60+ $ this ->assertTrue ($ api ->ok ());
61+ }
5162}
You can’t perform that action at this time.
0 commit comments