@@ -44,7 +44,7 @@ public function count(array $params = [])
4444 */
4545 public function get ($ orderId , array $ params = [])
4646 {
47- $ endpoint = 'orders/ ' . $ orderId. '.json ' ;
47+ $ endpoint = 'orders/ ' . $ orderId . '.json ' ;
4848 $ response = $ this ->request ($ endpoint , 'GET ' , $ params );
4949 return $ this ->createObject (Order::class, $ response ['order ' ]);
5050 }
@@ -61,9 +61,11 @@ public function create(Order &$order)
6161 $ data = $ order ->exportData ();
6262 $ endpoint = 'orders.json ' ;
6363 $ response = $ this ->request (
64- $ endpoint , 'POST ' , array (
65- 'order ' => $ data
66- )
64+ $ endpoint ,
65+ 'POST ' ,
66+ [
67+ 'order ' => $ data
68+ ]
6769 );
6870 $ order ->setData ($ response ['order ' ]);
6971 }
@@ -77,7 +79,7 @@ public function create(Order &$order)
7779 */
7880 public function close (Order &$ order )
7981 {
80- $ endpoint = 'orders/ ' . $ order ->id . '/close.json ' ;
82+ $ endpoint = 'orders/ ' . $ order ->id . '/close.json ' ;
8183 $ response = $ this ->request ($ endpoint , 'POST ' );
8284 $ order ->setData ($ response ['order ' ]);
8385 }
@@ -91,7 +93,7 @@ public function close(Order &$order)
9193 */
9294 public function open (Order &$ order )
9395 {
94- $ endpoint = 'orders/ ' . $ order ->id . '/open.json ' ;
96+ $ endpoint = 'orders/ ' . $ order ->id . '/open.json ' ;
9597 $ response = $ this ->request ($ endpoint , 'POST ' );
9698 $ order ->setData ($ response ['order ' ]);
9799 }
@@ -105,7 +107,7 @@ public function open(Order &$order)
105107 */
106108 public function cancel (Order &$ order )
107109 {
108- $ endpoint = '/orders/ ' . $ order ->id . '/cancel.json ' ;
110+ $ endpoint = '/orders/ ' . $ order ->id . '/cancel.json ' ;
109111 $ response = $ this ->request ($ endpoint , 'POST ' );
110112 $ order ->setData ($ response ['order ' ]);
111113 }
@@ -120,11 +122,13 @@ public function cancel(Order &$order)
120122 public function update (Order &$ order )
121123 {
122124 $ data = $ order ->exportData ();
123- $ endpoint = 'orders/ ' . $ order ->id . '.json ' ;
125+ $ endpoint = 'orders/ ' . $ order ->id . '.json ' ;
124126 $ response = $ this ->request (
125- $ endpoint , 'POST ' , array (
126- 'order ' => $ data
127- )
127+ $ endpoint ,
128+ 'PUT ' ,
129+ [
130+ 'order ' => $ data
131+ ]
128132 );
129133 $ order ->setData ($ response ['order ' ]);
130134 }
@@ -138,7 +142,7 @@ public function update(Order &$order)
138142 */
139143 public function delete (Order &$ order )
140144 {
141- $ endpoint = 'orders/ ' . $ order ->id . '.json ' ;
145+ $ endpoint = 'orders/ ' . $ order ->id . '.json ' ;
142146 $ this ->request ($ endpoint , 'DELETE ' );
143147 return ;
144148 }
0 commit comments