public function invoice(ApiResource $resource) { $idField = $resource->getIdField(); $url = $this->generateUrl($resource->{$idField} . '/invoice'); $response = \Httpful\Request::post($url)->body(json_encode($resource))->sendsJson()->send(); $this->checkResponseErrors($response); }
/** * Updates a Resource * * @param mixed $code String code, or a ApiResourceInterface object with code field * @param ApiResource $resource * @return \Httpful\Response */ public function put(ApiResource $resource) { $idField = $resource->getIdField(); $url = $this->generateUrl($resource->{$idField}); $body = $this->createPutBody($resource); $response = \Httpful\Request::put($url)->body($body)->sendsJson()->send(); $this->checkResponseErrors($response); return $response; }