Lue dans les fichiers PHP du paquet au commit 5ae261f55f6c : 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é.
ApiclassGLS's ShipIT web API (basic auth) for shipments and their labels, and GLS's public tracking (gls-group.eu, no credentials) for where a parcel is.
3 methods · 2 properties · 3 constants
GlsGatewayFactoryclassoptions: username: '%env(GLS_USERNAME)%' # the ShipIT web API login password: '%env(GLS_PASSWORD)%' contact_id: '%env(GLS_CONTACT_ID)%' # the customer's contact id at GLS sandbox: true rates: [...] # prices from configuration: ShipIT quotes none
8 options
CancelActionclassPOST /shipments/cancel/{trackId}: a shipment not yet collected, cancelled.
3 methods
ShippingActionclassPOST /shipments: the parcels under a product (service: PARCEL by default, EXPRESS...), a ShopDelivery service when the shipment goes to a ParcelShop (pickupPoint: the shop's id), its labels as PDF.
3 methods
TrackingActionclassGLS's public parcel tracking: the history, oldest first.
3 methods
Omnibus\Gls
Api class
final class Api Api.php:15
GLS's ShipIT web API (basic auth) for shipments and their labels, and GLS's public tracking (gls-group.eu, no credentials) for where a parcel is.
Prices come from configuration: ShipIT quotes none.
const LIVE = 'https://shipit.gls-group.eu/backend/rs'const TEST = 'https://shipit-wbm-test01.gls-group.eu:8443/backend/rs'const TRACKING = 'https://gls-group.eu/app/service/open/rest/EU/en/rstt001'public readonly string $contactIdpublic readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $username, readonly string $password, public readonly string $contactId, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::call()
public function call(string $method, string $path, ?array $body = null, array $query = []): arrayApi::track()
public function track(string $number, string $locale): arrayGlsGatewayFactory class
final class GlsGatewayFactory extends GatewayFactory GlsGatewayFactory.php:22
options: username: '%env(GLS_USERNAME)%' # the ShipIT web API login password: '%env(GLS_PASSWORD)%' contact_id: '%env(GLS_CONTACT_ID)%' # the customer's contact id at GLS sandbox: true rates: [...] # prices from configuration: ShipIT quotes none
Pickup points (ParcelShops) are not offered by ShipIT: GLS's finder is a separate contract.
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['username'], (string) $c['password'], (string) … | |
omnibus.action.shipping | new ShippingAction() | |
omnibus.action.tracking | new TrackingAction() | |
omnibus.action.cancel | new CancelAction() | |
username | required | |
password | required | |
contact_id | required |
Omnibus\Gls\Action
CancelAction class
final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13
POST /shipments/cancel/{trackId}: a shipment not yet collected, cancelled.
CancelAction::__construct()
public function __construct()CancelAction::supports()
public function supports(Request $request): boolCancelAction::execute()
public function execute(Request $request): voidShippingAction class
final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:20
POST /shipments: the parcels under a product (service: PARCEL by default, EXPRESS...), a ShopDelivery service when the shipment goes to a ParcelShop (pickupPoint: the shop's id), its labels as PDF.
ShippingAction::__construct()
public function __construct()ShippingAction::supports()
public function supports(Request $request): boolShippingAction::execute()
public function execute(Request $request): voidTrackingAction class
final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:16
GLS's public parcel tracking: the history, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void