Aller au contenu

omnibus/db-schenker Référence de l’API

Étage
Fournisseur · Omnibus
Version
2.x
Suite de conformité
branchée, CI non lue
Vérifié en réel
Non vérifié en réel
Licence
MIT
composer require omnibus/db-schenker:2.x-dev

Lue dans les fichiers PHP du paquet au commit 0f62a3e02b78 : 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é.

Omnibus\DbSchenker

  • Api class

    DB Schenker's public tracking (eschenker.dbschenker.com, no credentials) and the Schenker Open API for bookings (an API key from the partner portal, which is where the account's booking profile lives).

    3 methods · 2 properties · 2 constants

  • DbSchenkerGatewayFactory class

    options: api_key: null # the Schenker Open API key, for bookings account_number: null # the booking account rates: [...] # prices from configuration: Schenker quotes by contract

    5 options

Omnibus\DbSchenker\Action

  • ShippingAction class

    A land-transport booking through the Open API (service: a product code, SYSTEM by default); the booking's number is the tracking number. Unverified: built on the published shape.

    3 methods

  • TrackingAction class

    eSchenker's public tracking: the shipment's events, oldest first.

    3 methods

Omnibus\DbSchenker

Api class

final class Api Api.php:15

DB Schenker's public tracking (eschenker.dbschenker.com, no credentials) and the Schenker Open API for bookings (an API key from the partner portal, which is where the account's booking profile lives).

const TRACKING = 'https://eschenker.dbschenker.com/nges-portal/api/public/tracking'
const BOOKING = 'https://api.dbschenker.com/booking/v1'
public readonly ?string $apiKey
public readonly ?string $accountNumber

Api::__construct()

public function __construct(readonly HttpClientInterface $http, public readonly ?string $apiKey = null, public readonly ?string $accountNumber = null, readonly int $timeout = 20)

Api::track()

public function track(string $number): array

Api::call()

public function call(string $method, string $path, ?array $body = null): array

DbSchenkerGatewayFactory class

final class DbSchenkerGatewayFactory extends GatewayFactory DbSchenkerGatewayFactory.php:21

options: api_key: null # the Schenker Open API key, for bookings account_number: null # the booking account rates: [...] # prices from configuration: Schenker quotes by contract

Tracking needs no credentials. Bookings go through the Open API (land transport), unverified until an account's key is at hand: the booking action is built on its published shape and marked so.

Options

OptionDefault
api_keynull
account_numbernull
omnibus.apifunction (Config $c) { $http = $this->http ?? HttpClient::create(); return new Api($http, $c['api_key'] ?: null, $c['account_number'] ?: null); }
omnibus.action.trackingnew TrackingAction()
omnibus.action.shippingstatic fn(Config $c) => $c['api_key'] && $c['account_number'] ? new ShippingAction() : null

Omnibus\DbSchenker\Action

ShippingAction class

final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:16

A land-transport booking through the Open API (service: a product code, SYSTEM by default); the booking's number is the tracking number. Unverified: built on the published shape.

ShippingAction::__construct()

public function __construct()

ShippingAction::supports()

public function supports(Request $request): bool

ShippingAction::execute()

public function execute(Request $request): void

TrackingAction class

final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:16

eSchenker's public tracking: the shipment's events, oldest first.

TrackingAction::__construct()

public function __construct()

TrackingAction::supports()

public function supports(Request $request): bool

TrackingAction::execute()

public function execute(Request $request): void