Read from the package's own PHP files at the commit 095e5280847a: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
ApiclassMondial Relay's web services (SOAP 1.1, Web_Services.asmx), spoken over plain HTTP: every call is its parameters in the documented order, signed with Security = MD5(the values one after the other + the private key), in capitals.
7 methods · 4 constants
MondialRelayGatewayFactoryclassoptions: enseigne: '%env(MONDIAL_RELAY_ENSEIGNE)%' # the brand code of the contract (8 characters) private_key: '%env(MONDIAL_RELAY_PRIVATE_KEY)%' sandbox: true # Mondial Relay's public test brand, no contract needed collection: CCC # CCC: collected at the shop; REL: dropped at a relay download_labels: false # true: the PDF inline in the Label, not only its URL rates: [...] # no rating service: Omnibus\Action\ConfiguredRatingAction
10 options
GetSlipActionclassWSI3_GetEtiquettes: a booked label again, 10x15 (thermal printers), else A4.
3 methods
PickupActionclassWSI4_PointRelais_Recherche: the relay points around a postcode, nearest first, that take the parcel's weight. A point's id is "<country>-<number>" (FR-066974): what ShippingAction books to.
3 methods
ShippingActionclassWSI2_CreationEtiquette: books the shipment - to a relay point when it has one (service 24R), else to the door (service HOM, or the one asked) - and gives the expedition number and the label's link.
3 methods
TrackingActionclassWSI2_TracingColisDetaille. Its STAT is the parcel's status - 80 registered, 81 on its way, 82 delivered, 83 an anomaly - and each step has a sentence, a date and a place.
4 methods
Omnibus\MondialRelay
Api class
final class Api Api.php:16
Mondial Relay's web services (SOAP 1.1, Web_Services.asmx), spoken over plain HTTP: every call is its parameters in the documented order, signed with Security = MD5(the values one after the other + the private key), in capitals.
const ENDPOINT = 'https://api.mondialrelay.com/Web_Services.asmx'const SITE = 'https://www.mondialrelay.com'const TEST_ENSEIGNE = 'BDTEST13'Mondial Relay's public test brand: works on the live endpoint, books nothing. Published by Mondial Relay in its integration documentation, the same for everyone: test identifiers, not a secret.
const TEST_PRIVATE_KEY = 'PrivateK'
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $enseigne, readonly string $privateKey, readonly string $endpoint = self::ENDPOINT)Api::enseigne()
public function enseigne(): stringApi::call()
public function call(string $method, array $params, array $accept = ['0']): \SimpleXMLElement$paramsin the method's order, Enseigne and Security left out
$acceptSTAT codes that are answers, not errors (tracing: 80-83)
Api::download()
public function download(string $url): stringA document the services link to (a label's PDF).
Api::security()
public static function security(array $params, string $privateKey): stringApi::text()
public static function text(?string $value, int $length = 32): stringMondial Relay takes addresses in capitals, without accents, and cuts each field at a length: "Émile Zola" -> "EMILE ZOLA".
Api::phone()
public static function phone(?string $phone): stringA phone as the services take it: +33612345678 or 0612345678.
MondialRelayGatewayFactory class
final class MondialRelayGatewayFactory extends GatewayFactory MondialRelayGatewayFactory.php:25
options: enseigne: '%env(MONDIAL_RELAY_ENSEIGNE)%' # the brand code of the contract (8 characters) private_key: '%env(MONDIAL_RELAY_PRIVATE_KEY)%' sandbox: true # Mondial Relay's public test brand, no contract needed collection: CCC # CCC: collected at the shop; REL: dropped at a relay download_labels: false # true: the PDF inline in the Label, not only its URL rates: [...] # no rating service: Omnibus\Action\ConfiguredRatingAction
No rating nor cancellation service: prices are the shop's contract, and a label not handed over simply expires.
Options
| Option | Default | |
|---|---|---|
enseigne | Api::TEST_ENSEIGNE | required |
private_key | Api::TEST_PRIVATE_KEY | required |
endpoint | Api::ENDPOINT | |
collection | 'CCC' | |
download_labels | false | |
omnibus.api | function (Config $c) {
return new Api($this->http ?? HttpClient::create(), (string) $c['enseigne'], (string) $c['private_key'], (string) $c['endpoint']);
} | |
omnibus.action.pickup | new PickupAction() | |
omnibus.action.shipping | static fn(Config $c) => new ShippingAction((string) $c['collection'], (bool) $c['download_labels']) | |
omnibus.action.tracking | new TrackingAction() | |
omnibus.action.get_slip | static fn(Config $c) => new GetSlipAction((bool) $c['download_labels']) |
Omnibus\MondialRelay\Action
GetSlipAction class
final class GetSlipAction implements ActionInterface, ApiAwareInterface GetSlipAction.php:14
WSI3_GetEtiquettes: a booked label again, 10x15 (thermal printers), else A4.
GetSlipAction::__construct()
public function __construct(readonly bool $download = false)GetSlipAction::supports()
public function supports(Request $request): boolGetSlipAction::execute()
public function execute(Request $request): voidPickupAction class
final class PickupAction implements ActionInterface, ApiAwareInterface PickupAction.php:19
WSI4_PointRelais_Recherche: the relay points around a postcode, nearest first, that take the parcel's weight. A point's id is "<country>-<number>" (FR-066974): what ShippingAction books to.
PickupAction::__construct()
public function __construct()PickupAction::supports()
public function supports(Request $request): boolPickupAction::execute()
public function execute(Request $request): voidShippingAction class
final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:19
WSI2_CreationEtiquette: books the shipment - to a relay point when it has one (service 24R), else to the door (service HOM, or the one asked) - and gives the expedition number and the label's link.
ShippingAction::__construct()
public function __construct(readonly string $collection = 'CCC', readonly bool $download = false)ShippingAction::supports()
public function supports(Request $request): boolShippingAction::execute()
public function execute(Request $request): voidTrackingAction class
final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:20
WSI2_TracingColisDetaille. Its STAT is the parcel's status - 80 registered, 81 on its way, 82 delivered, 83 an anomaly - and each step has a sentence, a date and a place.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): voidTrackingAction::publicUrl()
public static function publicUrl(string $number, string $enseigne): stringThe public tracking page, for the customer.