/** * Executes a put method to the Orbit API * * @param $method * @return mixed */ public function delete($method) { $this->request->clearParams(); $this->request->setMethod('delete'); $this->request->setURI($method . '?token=' . $this->getToken()); $this->request->execute(); $content = json_decode($this->request->getContent(), true); return $content; }
/** * An static call to create an instance * * @param string $url - The Request URL * @param string $method - The Request Method ( GET | POST | PUT | DELETE | UPDATE | PATCH ) * @return HttpHandler */ public static function Create($url, $method) { $http = new HttpHandler($url); $http->setMethod($method); return $http; }
public function submit() { $request = new HttpHandler(self::PAGSEGURO_URL . '?email=' . $this->email . '&token=' . $this->token); $request->setMethod('post'); $request->addHeader('Content-type', 'application/xml'); $request->setBody($this->getXML()); $request->execute(); $response = $request->getContent(true); if (isset($response['code'])) { $this->code = $response['code']; return $this->code; } else { $this->response = $response; } }