public function get(GetRequest $request) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request->getUrl()); curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); return $this->send($ch); }
private function generateRequest($amount, $max, $ignoreScheduledDiscount) { $request = new GetRequest($this->url); $basic = new Basic(); $request->addHeader($basic->generateHeader($this->email, $this->token)); $request->addHeader("Content-Type:application/x-www-form-urlencoded;charset=" . Config::charset); $request->addParam("amount", $amount); if ($max != null) { $request->addParam("maxInstallments", $max); } $request->addParam("ignoreScheduledDiscount", 0); if ($ignoreScheduledDiscount === true) { $request->addParam("ignoreScheduledDiscount", 1); } $request->setUrl($this->url . "?" . http_build_query($request->getParams(), '', '&')); return $request; }