Example #1
0
 /**
  * Create new request.
  * @return object
  */
 public function create($attributes = array())
 {
     $resources = new Resources();
     $resources->setAuthorization();
     $resources->setBaseUrl(Config::get("resources::gemba.baseUrl"));
     $resources->setHeaders(array("content-type" => "application/json"));
     $resources->setContent($attributes, 'json');
     $json = $resources->post("packagesrequest/all");
     $packagesRequest = json_decode($json, true);
     if (empty($packagesRequest)) {
         return array();
     }
     $listPackages = array();
     return $packagesRequest;
 }
Example #2
0
 /**
  * Calculate budget finalPrice.
  * @return bool
  */
 public function calculate()
 {
     $resources = new Resources();
     $resources->setAuthorization();
     $resources->setHeaders(array("Content-Type" => "application/json"));
     $resources->setContent($this->toArray(), 'json');
     $json = $resources->post("budget");
     $budget = json_decode($json);
     return $budget;
 }