buy an order

@param mixed $params
@return $this
@throws \EasyPost\Error
559713
public function buy($params = null)
    {
        $requestor = new Requestor($this->_apiKey);
        $url = $this->instanceUrl() . '/buy';

        if ($params instanceof Rate) {
            $clone = $params;
            unset($params);
            $params['carrier'] = $clone->carrier;
            $params['service'] = $clone->service;
        }

        list($response, $apiKey) = $requestor->request('post', $url, $params);
        $this->refreshFrom($response, $apiKey, false);

        return $this;
    }
634639
public function bind(array $params)
    {
        foreach ($params as $key => $value) {
            $this->getParameters()->set($key, $value);
        }

        return $this;
    }
386188
public function purchase(array $parameters = [])
    {
        if ($this->isOldApi()) {
            $requestClass = OldPurchaseRequest::class;
        } else {
            $requestClass = PurchaseRequest::class;
        }

        return $this->createRequest($requestClass, $parameters);
    }
962531
public function set($condition, array $params = [])
    {
        $this->conditions = [];
        $this->add($condition, $params);
        return $this;
    }
176310
public function addParams(array $params)
    {
        foreach ($params as $k => $v) {
            $this->addParam($k, $v);
        }
        return $this;
    }
370147
public function updateOrder($requestParams)
    {
        $options["headers"] = self::retrieveContentTypeHeader(self::CONTENT_TYPE_JSON);
        $requiredParams = array("offer");
        return $this->client->request($requestParams, $this->_mainTransactionEndpoint . "/" . self::ORDER, "put", $requiredParams, $options);
    }
791077
public function add($params) 
    {
        $response = $this->client->update(
            $this->uri,
            $params
        );

        return json_encode($response->getContent(), JSON_FORCE_OBJECT);
    }
253618
public function setSiteParameters($params)
    {
        foreach ($params as $key => $param) {
            $this->setSiteParameter($key, $param);
        }

        return $this;
    }
1188224
public function query($query, array $params = [])
    {
        $this->query  = $query;
        $this->params = $params;
        $this->send();

        return $this;
    }
330921
public function createOrder(Array $params)
    {
        $createOrderRequest = $this->getRequestParam('CreateOrderRequestParam', $params, $this->config, $this->sign);

        $result = $this->executeRequest($createOrderRequest);

        if ($result['return_code'] != "SUCCESS") {
            return $this->error($result['return_msg'], $result);
        }
        if (!$this->sign->verifySign($result, $this->config['key'])) {
            return $this->error("验证微信的签名失败", $result);
        }
        if ($result['result_code'] != 'SUCCESS') {
            $message = "err_code＝{$result['err_code']}, err_code_des＝{$result['err_code_des']}";
            return $this->error($message, $result);
        }

        return $this->responseCreateOrder($result);
    }
25252
public function orderByField($column, array $params = [])
    {
        if (count($params) <= 0) return $this;

        $this->order->addByField($column, $params);
        return $this;
    }
780863
public function purchase($amount, $options = array())
  {
      $this->post = array_merge($this->post, array('METHOD' => 'DoExpressCheckoutPayment'));

      return $this->do_action($amount, 'Sale', $options);
  }
57495
public function setParameters(array $params)
    {
        foreach ($params as $name => $value) {
            $this->getParameterContainer()->add($name, $value);
        }
        return $this;
    }
454966
public function all(array $params = array())
    {
        $endpoint = '/admin/orders.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Order::class, $response['orders']);
    }
1353655
public function addQueryParams(array $params) {
		foreach ($params as $param => $value) {
			$this->setQueryParam($param, $value);
		}
		
		return $this;
	}
987777
public function verify($params = null, $options = null)
    {
        $url = $this->instanceUrl() . '/verify';
        list($response, $opts) = $this->_request('post', $url, $params, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }
551685
private function saveInputParams($params){
		foreach($params as $param => $value){
			$var = "_" . $param;

			if(!isset($this->{$var}) || !is_null($this->{$var})){
				$this->{$var} = $value;
			}
		}

		return $this;
	}