1
0
mirror of synced 2024-11-22 05:16:07 +03:00

stores get & stores edit

This commit is contained in:
Alex Lushpai 2015-06-15 16:40:39 +03:00
parent 67e0f4746e
commit 741ee9bb1a

View File

@ -520,6 +520,16 @@ class ApiClient
{ {
return $this->client->makeRequest('/reference/sites', Client::METHOD_GET); return $this->client->makeRequest('/reference/sites', Client::METHOD_GET);
} }
/**
* Returns stores list
*
* @return ApiResponse
*/
public function storesList()
{
return $this->client->makeRequest('/reference/stores', Client::METHOD_GET);
}
/** /**
* Edit deliveryService * Edit deliveryService
@ -710,6 +720,31 @@ class ApiClient
); );
} }
/**
* Edit store
*
* @param array $data site data
* @return ApiResponse
*/
public function storesEdit(array $data)
{
if (!isset($data['code'])) {
throw new \InvalidArgumentException('Data must contain "code" parameter.');
}
if (!isset($data['name'])) {
throw new \InvalidArgumentException('Data must contain "name" parameter.');
}
return $this->client->makeRequest(
'/reference/stores/' . $data['code'] . '/edit',
Client::METHOD_POST,
array(
'site' => json_encode($data)
)
);
}
/** /**
* Update CRM basic statistic * Update CRM basic statistic
* *