yproximite / ekomi-api-bundle
Integration of eKomi API into Symfony
Installs: 20 558
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.3
- symfony/framework-bundle: ^4.0||^5.0
- yproximite/ekomi-api: ^3.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16.1
- phpspec/phpspec: ^6.1
This package is auto-updated.
Last update: 2024-12-13 17:47:43 UTC
README
Integration of the eKomi API client library into Symfony3.
Installation
Require
yproximite/ekomi-api-bundle
to your composer.json
file:
$ composer require yproximite/ekomi-api-bundle
Register the bundle in app/AppKernel.php
:
// app/AppKernel.php public function registerBundles() { return array( // ... new Yproximite\Bundle\EkomiApiBundle\YproximiteEkomiApiBundle(), ); }
Enable the bundle's configuration in app/config/config.yml
:
# app/config/config.yml yproximite_ekomi_api: # Identifier of the service that represents "Http\Client\HttpClient" http_client: httplug.client.guzzle6 # Credentials client_id: 999999 secret_key: xxxxxxxxxxxxxx # Base url for the API, optional, by default is "https://csv.ekomi.com/api/3.0" base_url: https://csv.ekomi.com/api/3.0 # cache cache: cache.app cache_key: xxxxx
Usage
use Yproximite\Ekomi\Api\Message\Order\OrderListMessage; $api = $this->get('yproximite.ekomi_api.service_aggregator'); $message = new OrderListMessage(); $message->setOffset(5); $message->setLimit(10); $message->setOrderBy(OrderListMessage::ORDER_BY_CREATED); $message->setOrderDirection(OrderListMessage::ORDER_DIRECTION_DESC); $message->setWithFeedbackOnly(true); $message->setCreatedFrom(new \DateTime('2016-10-06 00:00:10')); $message->setCreatedTill(new \DateTime('2016-11-06 00:14:29')); $message->setShopId(11); $message->setCustomDataFilter(['vendor_id' => 123]); // Yproximite\Ekomi\Api\Model\Order\Order[] $orders = $api->order()->getOrders($message);