Lue dans les fichiers PHP du paquet au commit 8536fdc8200b : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
ApiclassA client for Zenchef's partner API, configured from the documentation Zenchef sends on request - its base URL and the headers that carry the restaurant's credentials are not public, so nothing is assumed: they are options, "{token}" and "{restaurant_id}" in a header's value standing for the restaurant's token and id.
3 methods · 1 constant
ZenchefPlatformclassA restaurant's reservations at Zenchef - not yet: Zenchef's partner API is documented on request only (https://help.zenchef.com/hc/en-gb/articles/27690768125597-Zenchef-API).
13 methods · 1 constant
ZenchefPlatformFactoryclassZenchef: the restaurant's credentials, and a client ready for the partner API once Zenchef has sent its documentation:
4 options
Omnifood\Zenchef
Api class
final class Api Api.php:24
A client for Zenchef's partner API, configured from the documentation Zenchef sends on request - its base URL and the headers that carry the restaurant's credentials are not public, so nothing is assumed: they are options, "{token}" and "{restaurant_id}" in a header's value standing for the restaurant's token and id.
Zenchef's published limits: 100 calls a minute for the calls answered in less than a second, the slower ones one after the other, pages of 250 to 500.
const PLATFORM = 'zenchef'
Api::__construct()
public function __construct(readonly ?string $token = null, readonly ?string $restaurantId = null, readonly ?string $baseUri = null, readonly array $headers = [], ?HttpClientInterface $http = null)Api::request()
public function request(string $method, string $path, array $query = [], array|object|null $json = null): arrayApi::restaurantId()
public function restaurantId(): ?stringZenchefPlatform class
final class ZenchefPlatform implements ReservationsInterface, NotifiableInterface ZenchefPlatform.php:24
A restaurant's reservations at Zenchef - not yet: Zenchef's partner API is documented on request only (https://help.zenchef.com/hc/en-gb/articles/27690768125597-Zenchef-API).
Its help centre says what it offers - reservations read, created, updated, their status changed; availability and opening hours; guests; one webhook per restaurant, on a reservation made or updated - but not its paths, fields, statuses nor how a webhook is signed. Every call is refused (NotSupportedException) rather than guessed; api() is the client to write them with once the documentation is in hand.
const DOCUMENTATION = 'https://help.zenchef.com/hc/en-gb/articles/27690768125597-Zenchef-API'
ZenchefPlatform::__construct()
public function __construct(readonly Api $api)ZenchefPlatform::getName()
public function getName(): stringZenchefPlatform::getChannel()
public function getChannel(): ChannelZenchefPlatform::capabilities()
public function capabilities(): CapabilitiesZenchefPlatform::api()
public function api(): ApiThe client, configured with the restaurant's credentials, for the calls Zenchef's documentation describes.
ZenchefPlatform::reservations()
public function reservations(\DateTimeImmutable $from, \DateTimeImmutable $to): arrayZenchefPlatform::reservation()
public function reservation(string $ref): ReservationZenchefPlatform::createReservation()
public function createReservation(Reservation $reservation): ReservationZenchefPlatform::updateReservation()
public function updateReservation(Reservation $reservation): ReservationZenchefPlatform::cancelReservation()
public function cancelReservation(string $ref, ?string $reason = null): voidZenchefPlatform::setStatus()
public function setStatus(string $ref, ReservationStatus $status): voidZenchefPlatform::pushAvailability()
public function pushAvailability(array $slots): voidZenchefPlatform::notify()
public function notify(string $body, array $headers): NotificationZenchefPlatformFactory class
final class ZenchefPlatformFactory extends PlatformFactory ZenchefPlatformFactory.php:19
Zenchef: the restaurant's credentials, and a client ready for the partner API once Zenchef has sent its documentation:
options: token: '%env(default::ZENCHEF_TOKEN)%' # Settings > Partners in Zenchef: "Zenchef token" restaurant_id: '%env(default::ZENCHEF_RESTAURANT_ID)%' # Settings > Partners: the restaurant's id base_uri: ~ # from Zenchef's documentation (not public) headers: } # from it too: {"<header>": "{token}", "<header>": "{restaurant_id}"}
Options
| Option | Default | |
|---|---|---|
token | null | |
restaurant_id | null | |
base_uri | null | |
headers | [] |