Calls the API

@param array $attributes The attributes of the post body.

@return bool Is the request succesfull?
172349
protected function call_api( $attributes ) {
		$slug                  = $this->product->get_slug();
		$version               = $this->product->get_version();
		$attributes['slug']    = $slug;
		$attributes['version'] = $version;

		$response = wp_remote_post(
			self::FEEDBACK_ENDPOINT,
			array(
				'body' => $attributes,
			)
		);

		return is_wp_error( $response );
	}
983357
public function createCharge(array $attributes)
    {
        // Log Debug
        $this->flow->getLogger()->debug('Charging: ' . json_encode($attributes));

        return $this->makeCharge(
            $this->flow->send(
                'post',
                $this->endpoint . '/charge',
                $attributes
            )
        );
    }
158384
public function make(array $attributes = [])
    {
        /** @var Identifiable $model */
        $model = $this->performMake($attributes);
        $this->fill($model, $attributes);
        $this->callAfterListeners('make', [$model]);

        return $model;
    }
67075
protected function call(array $params)
    {
        $defaultParams = [
            'key'        => $this->apiKey,
            'format'     => 'json',
            'apiVersion' => self::VERSION,
        ];

        $params = array_merge($defaultParams, $params);

        $url = sprintf('%s?%s', self::ENDPOINT, http_build_query($params));

        $response = $this->adapter->get($url);

        $result = json_decode($response->getBody()->getContents(), true);

        if ($result['result'] == 'ERR') {
            throw new ApiException($result['message'], $result['code']);
        }

        return $result;
    }
1320474
public function update(array $attributes = [])
    {
        $attributes = array_merge($attributes, ['ID' => $this->ID]);

        if (is_wp_error(wp_update_user($attributes))) {
            return false;
        }

        $this->setRawAttributes($attributes, true);

        return true;
    }
967188
public function create(array $attributes): bool
    {
        $model = $this->getModel();
        $model->setAttributes($attributes);

        return $model->save();
    }
927738
public function fill(array $attributes = [])
    {
        foreach ($attributes as $key => $value) {
            $this->setAttribute($key, $value);
        }

        return $this;
    }
1258843
public function charge(array $attributes)
    {
        if ($this->exists && $this->creditCardType && $this->last4CardDigits) {
            return $this->service->charge($attributes + [
                $this->getIdKey() => $this->getId()
            ]);
        }
        return false;
    }
1171997
public function save(array $attributes = null)
    {
        if ($attributes !== null) {
            $this->fillProperties($attributes, false);
        }

        $this->doQuery($this->saveQuery($attributes));
    }
803799
public function set(array $attributes)
    {
        collect($attributes)->each(function ($value, $key) {
            $this->setKeyValue($key, $value);
        });

        // If we were working with eagerly-loaded relation,
        // we need to reload its data to be sure that we
        // are working only with the actual settings.

        if ($this->resource->relationLoaded('propertyBag')) {
            $this->resource->load('propertyBag');
        }

        return $this->sync();
    }
666635
public function update(array $attributes)
    {
        return $this->validate($attributes) ? (boolean) Language::where('id', $attributes['id'])->update($attributes) : false;
    }
1200513
public function create(array $attributes = [])
    {
        $results = $this->make($attributes);

        if ($results instanceof Model) {
            $this->store(collect([$results]));

            $this->callAfterCreating(collect([$results]));
        } else {
            $this->store($results);

            $this->callAfterCreating($results);
        }

        return $results;
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
466778
public static function areAttributesValid($attributes)
    {
        if (!is_array($attributes)) {
            return false;
        }

        if (empty($attributes)) {
            return true;
        }
        // At least one key string to be an associative array.
        return count(array_filter(array_keys($attributes), 'is_string')) > 0;
    }
449297
public function setAttributes(array $attributes = [])
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        isset($attributes['id']) ? $this->id         = $attributes['id'] : null;
        return $this;
    }
672880
public function haveAllRequiredAttributes( array $attributes ) : bool
   {

      foreach ( $this->_attributes as $attribute )
      {
         if ( ! $attribute->isRequired() )
         {
            continue;
         }
         if ( ! isset( $attributes[ $attribute->getName() ] ) )
         {
            if ( $attribute->hasValueMissedLink() && $attribute->getValueMissedLink()->isValid() )
            {
               continue;
            }
            return false;
         }
      }

      return true;

   }
912457
protected function populate(array $attributes)
    {
        if ( ! empty($keys = $this->getTranslatableAttributes())) {
            foreach ($keys as $key) {
                $this->setTranslations($key, $attributes[$key] ?? []);
            }

            $attributes = Arr::except($attributes, $keys);
        }

        return $this->fill($attributes);
    }