PHP code example of foodticket / jet-connect-client
1. Go to this page and download the library: Download foodticket/jet-connect-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
foodticket / jet-connect-client example snippets
JET_CONNECT_API_KEY=
use Foodticket\JetConnect\Endpoints\JetConnectApi;
$api = new JetConnectApi();
use Foodticket\JetConnect\Enums\Availability;
$api->setItemAvailability(
availability: Availability::UNAVAILABLE,
itemsIds: ['plu-123', 'plu-456'],
restaurant: $restaurantId,
nextAvailableAt: now()->addHours(2), // optional, only used when UNAVAILABLE
);
use Foodticket\JetConnect\Enums\ErrorCode;
$api->sentToPosFailed(
orderId: $orderId,
errorCode: ErrorCode::TIMEOUT,
errorMessage: 'POS did not respond within the timeout window',
);