curl = new curl\Curl(); $this->providerToken = $providerToken; $this->restaurantToken = $restaurantToken; } public function getOrders($date) { $orders = $this->curl->setGetParams([ 'provider_token' => $this->providerToken, 'restaurant_token' => $this->restaurantToken, 'dateFrom' => date('Y-m-d H-i-s', strtotime($date)), 'dateTo' => date( 'Y-m-d H-i-s', strtotime($date) + 24 * 60 * 60 - 1 ), 'status' => 'IN_PROGRESS', ])->get($this->urlApi . 'orders'); return json_decode($orders); } public function postOrder($params) { return $this->curl->setPostParams( array_merge([ 'provider_token' => $this->providerToken, 'restaurant_token' => $this->restaurantToken, ], $params) ) ->post($this->urlApi . 'orders'); } }