src/Operation/CartOperation.php
public function updateCart(Update $update, $nostoCustomerId, $accountId)
    {
        $request = new ApiRequest();
        $request->setContentType(self::CONTENT_TYPE_APPLICATION_JSON);
        $request->setPath(ApiRequest::PATH_CART_UPDATE);
        $channelName = 'cartUpdated/' . $accountId . '/' . $nostoCustomerId;
        $data = array();
        $item = array();
        $item['channel'] = $channelName;
        $item['formats'] = array('json-object' => json_decode(SerializationHelper::serialize($update)));
        $data['items'] = array($item);
        $updateJson = json_encode($data);
        $response = $request->postRaw($updateJson);

        return $this->checkResponse($request, $response);
    }
public function updateCart(Update $update, $nostoCustomerId, $accountId)
    {
        $request = new ApiRequest();
        $request->setContentType(self::CONTENT_TYPE_APPLICATION_JSON);
        $request->setPath(ApiRequest::PATH_CART_UPDATE);
        $channelName = 'cartUpdated/' . $accountId . '/' . $nostoCustomerId;
        $data = array();
        $item = array();
        $item['channel'] = $channelName;
        $item['formats'] = array('json-object' => json_decode(SerializationHelper::serialize($update)));
        $data['items'] = array($item);
        $updateJson = json_encode($data);
        $response = $request->postRaw($updateJson);

        return $this->checkResponse($request, $response);
    }
public function updateCart ( Update $ update , $ nostoCustomerId , $ accountId ) { $ request = new ApiRequest ( ) ; $ request -> setContentType ( self :: CONTENT_TYPE_APPLICATION_JSON ) ; $ request -> setPath ( ApiRequest :: PATH_CART_UPDATE ) ; $ channelName = 'cartUpdated/' . $ accountId . '/' . $ nostoCustomerId ; $ data = array ( ) ; $ item = array ( ) ; $ item [ 'channel' ] = $ channelName ; $ item [ 'formats' ] = array ( 'json-object' => json_decode ( SerializationHelper :: serialize ( $ update ) ) ) ; $ data [ 'items' ] = array ( $ item ) ; $ updateJson = json_encode ( $ data ) ; $ response = $ request -> postRaw ( $ updateJson ) ; return $ this -> checkResponse ( $ request , $ response ) ; }
Sends a POST request to update the cart

@param Update $update the cart changes
@param string $nostoCustomerId
@param string $accountId merchange id
@return bool if the request was successful.
@throws AbstractHttpException
Sends a POST request to update the cart