foodticket/jet-connect-client

A PHP client to integrate with the JET Connect API

1.0.1 2024-03-21 09:28 UTC

This package is auto-updated.

Last update: 2024-05-21 13:29:24 UTC


README

GitHub license

This package allows you to easily make requests to JustEatTakeaway's JET Connect API.

Requirements

  • PHP >= 8.1
  • Laravel >= 9.0

Installation

You can install the package via composer:

composer require foodticket/jet-connect

The package will automatically register itself.

Configuration

To start using the JET Connect API you will need an API key. Add the API key to your project's .env file:

JET_CONNECT_API_KEY=

Making requests

itemAvailability

To set an item's availability, you can use the following code:

$jetConnectApi = new JetConnectApi();
$jetConnectApi->setItemAvailability(
    Availability::UNAVAILABLE,
    ['itemReferences'],
    $restaurantId,
    $unavailableTill,
);

Create your own request

If you need to create your own request, you can use the following code:

$jetConnectApi = new JetConnectApi();
$jetConnectApi->request()->get('https://api.flytplatform.com/');

Webhooks

To start receiving webhooks from JET Connect, you need to add the following route the App\Providers\RouteServiceProvider file:

$this->routes(function () {
    // ...
    Route::jetConnectWebhooks();
});

Security Vulnerabilities

If you discover a security vulnerability within this project, please report this by email to developer@foodticket.nl.