curl = new curl\Curl(); $this->providerToken = $providerToken; $this->restaurantToken = $restaurantToken; } public function getUrlAuthorizeCode(string $clientId = null, string $redirectUri = null): string { return "#"; } public function isAuthenticated(): bool { return true; } 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) { $params = array_merge([ 'provider_token' => $this->providerToken, 'restaurant_token' => $this->restaurantToken, ], $params); /*\Yii::$app->mailerService->sendAdmin('Log post order SumUp', 'contact', [ 'name' => 'Souke', 'email' => 'contact@souke.fr', 'content' => json_encode($params) ]);*/ return $this->curl->setPostParams($params)->post($this->urlApi . 'orders'); } }