PHP wrapper for sinqro food market integration
Install with composer, requires PHP >8.0
composer require lsv/food-market-integration-wrapper
# Add a PSR 18 client, fx
composer require symfony/http-client
# If you add another PSR18 client, then look below on how to use other PSR 18 clients
Authenticate usage
use Lsv\FoodMarketIntegration\Authenticate;
use Lsv\FoodMarketIntegration\Request;
$userAccessToken = 'your user access token';
$serverAccessToken = 'your server access token';
$authenticate = new Authenticate($userAccessToken, $serverAccessToken);
Request\AbstractRequest::setAuthentication($authenticate);
// Your requests
And basic usage, to fetch an order
use Lsv\FoodMarketIntegration\Request;
$marketCodeIdentifier = 'your market code identifier';
$marketOrderIdentifier = 'order id';
$request = new Request\GetOrder($marketCodeIdentifier, $marketOrderIdentifier);
$response = $request->request();
# Response is now an object of Response\Order
For more usages, see below.
Request | Description | Response |
---|---|---|
CancelOrder | Cancel a order | Order |
GetOrder | Get order by identifier | Order |
GetOrderStatus | Get consumer order current status | OrderStatus |
PostOrder | Create new order | Order |
Request | Description | Response |
---|---|---|
GetMarketSellingPoint | Get market selling point by id | SellingPoint |
GetMarketSellingPoints | Get all market selling points | array of SellingPoint |
GetSellingPointAvailability | Return information about selling point services | SellingPointAvailability |
GetSellingPointClosingExceptions | Get selling point next closing exceptions | array of SellingPointException |
GetSellingPointMenus | Get menus | array of Menu |
GetSellingPointMenusAvailability | Get menus with availability | array of Menu |
GetSellingPointZonesAndTables | Get all the restaurant zones and tables | ServiceZone |
If you dont want to use symfony/http-client implementation, you can easily change it to another one.
You can use a http client from this list - These are all PSR18 http client implementations.
use Lsv\FoodMarketIntegration\Request;
$client = $YourPSR18Client;
Request\AbstractRequest::setHttpClient($client);
// Your requests
- Easier to make the websocket integration